Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: b4c04819c0
Fetching contributors…

Cannot retrieve contributors at this time

file 16 lines (13 sloc) 0.532 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
;;; -*- Mode:Lisp; Syntax:ANSI-Common-Lisp; Coding:utf-8 -*-

(in-package #:cl-num-utils-tests)

(deftestsuite rootfinding-tests (cl-num-utils-tests)
  ()
  (:equality-test #'==))

(addtest (rootfinding-tests)
  (let ((*rootfinding-delta-relative* 1e-6)
        (*lift-equality-test* (==* 1d-2)))
    (ensure-same (root-bisection #'identity (interval -1 2)) 0)
    (ensure-same (root-bisection (lambda (x)
                                   (expt (- x 5) 3))
                                 (interval -1 10))
                 5)))
Something went wrong with that request. Please try again.