Average Error: 28.5 → 0.4
Time: 23.2s
Precision: 64
Internal Precision: 128
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
\[\frac{a \cdot c}{(\left(-a\right) \cdot \left(\sqrt{\sqrt[3]{(-3 \cdot \left(a \cdot c\right) + \left(b \cdot b\right))_* \cdot \left((-3 \cdot \left(a \cdot c\right) + \left(b \cdot b\right))_* \cdot (-3 \cdot \left(a \cdot c\right) + \left(b \cdot b\right))_*\right)}}\right) + \left(a \cdot \left(-b\right)\right))_*}\]

Error

Bits error versus a

Bits error versus b

Bits error versus c

Bits error versus d

Derivation

  1. Initial program 28.5

    \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
  2. Simplified28.5

    \[\leadsto \color{blue}{\frac{\sqrt{(-3 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*} - b}{3 \cdot a}}\]
  3. Using strategy rm
  4. Applied flip--28.5

    \[\leadsto \frac{\color{blue}{\frac{\sqrt{(-3 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*} \cdot \sqrt{(-3 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*} - b \cdot b}{\sqrt{(-3 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*} + b}}}{3 \cdot a}\]
  5. Applied associate-/l/28.5

    \[\leadsto \color{blue}{\frac{\sqrt{(-3 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*} \cdot \sqrt{(-3 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*} - b \cdot b}{\left(3 \cdot a\right) \cdot \left(\sqrt{(-3 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*} + b\right)}}\]
  6. Simplified0.6

    \[\leadsto \frac{\color{blue}{\left(a \cdot c\right) \cdot -3}}{\left(3 \cdot a\right) \cdot \left(\sqrt{(-3 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*} + b\right)}\]
  7. Using strategy rm
  8. Applied associate-/l*0.5

    \[\leadsto \color{blue}{\frac{a \cdot c}{\frac{\left(3 \cdot a\right) \cdot \left(\sqrt{(-3 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*} + b\right)}{-3}}}\]
  9. Using strategy rm
  10. Applied *-un-lft-identity0.5

    \[\leadsto \frac{a \cdot c}{\color{blue}{1 \cdot \frac{\left(3 \cdot a\right) \cdot \left(\sqrt{(-3 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*} + b\right)}{-3}}}\]
  11. Applied associate-/r*0.5

    \[\leadsto \color{blue}{\frac{\frac{a \cdot c}{1}}{\frac{\left(3 \cdot a\right) \cdot \left(\sqrt{(-3 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*} + b\right)}{-3}}}\]
  12. Simplified0.4

    \[\leadsto \frac{\frac{a \cdot c}{1}}{\color{blue}{(\left(-a\right) \cdot \left(\sqrt{(-3 \cdot \left(a \cdot c\right) + \left(b \cdot b\right))_*}\right) + \left(\left(-a\right) \cdot b\right))_*}}\]
  13. Using strategy rm
  14. Applied add-cbrt-cube0.4

    \[\leadsto \frac{\frac{a \cdot c}{1}}{(\left(-a\right) \cdot \left(\sqrt{\color{blue}{\sqrt[3]{\left((-3 \cdot \left(a \cdot c\right) + \left(b \cdot b\right))_* \cdot (-3 \cdot \left(a \cdot c\right) + \left(b \cdot b\right))_*\right) \cdot (-3 \cdot \left(a \cdot c\right) + \left(b \cdot b\right))_*}}}\right) + \left(\left(-a\right) \cdot b\right))_*}\]
  15. Final simplification0.4

    \[\leadsto \frac{a \cdot c}{(\left(-a\right) \cdot \left(\sqrt{\sqrt[3]{(-3 \cdot \left(a \cdot c\right) + \left(b \cdot b\right))_* \cdot \left((-3 \cdot \left(a \cdot c\right) + \left(b \cdot b\right))_* \cdot (-3 \cdot \left(a \cdot c\right) + \left(b \cdot b\right))_*\right)}}\right) + \left(a \cdot \left(-b\right)\right))_*}\]

Reproduce

herbie shell --seed 2019010 +o rules:numerics
(FPCore (a b c d)
  :name "Cubic critical, narrow range"
  :pre (and (< 1.0536712127723509e-08 a 94906265.62425156) (< 1.0536712127723509e-08 b 94906265.62425156) (< 1.0536712127723509e-08 c 94906265.62425156))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))

Details

Time bar (total: 22.2s)Debug log

sample157.0ms

Algorithm
intervals

simplify99.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
98.0ms
(/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a))

prune19.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 27.4b

localize40.0ms

Local error

Found 4 expressions with local error:

27.3b
(- (sqrt (fma -3 (* c a) (* b b))) b)
0.4b
(/ (- (sqrt (fma -3 (* c a) (* b b))) b) (* 3 a))
0.2b
(fma -3 (* c a) (* b b))
0.1b
(sqrt (fma -3 (* c a) (* b b)))

rewrite37.0ms

Algorithm
rewrite-expression-head
Rules
10×add-sqr-sqrt
add-cube-cbrt
*-un-lft-identity
sqrt-prod
add-exp-log
fma-neg
add-cbrt-cube
add-log-exp
log1p-expm1-u
pow1
expm1-log1p-u
associate-/l*
times-frac
associate-/l/
flip--
flip3--
div-inv
fma-udef
div-exp
div-sub
pow1/2
frac-2neg
sub-neg
associate-/r*
clear-num
rem-sqrt-square
cbrt-undiv
Counts
4 → 67
Calls
4 calls:
Slowest
25.0ms
(/ (- (sqrt (fma -3 (* c a) (* b b))) b) (* 3 a))
9.0ms
(- (sqrt (fma -3 (* c a) (* b b))) b)
1.0ms
(sqrt (fma -3 (* c a) (* b b)))
0.0ms
(fma -3 (* c a) (* b b))

series245.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
82.0ms
(/ (- (sqrt (fma -3 (* c a) (* b b))) b) (* 3 a))
67.0ms
(- (sqrt (fma -3 (* c a) (* b b))) b)
60.0ms
(sqrt (fma -3 (* c a) (* b b)))
36.0ms
(fma -3 (* c a) (* b b))

simplify1.4s

Counts
34 → 79
Calls
34 calls:
Slowest
709.0ms
(- (* (sqrt (fma -3 (* c a) (* b b))) (sqrt (fma -3 (* c a) (* b b)))) (* b b))
130.0ms
(- (pow (sqrt (fma -3 (* c a) (* b b))) 3) (pow b 3))
86.0ms
(/ (* (* (- (sqrt (fma -3 (* c a) (* b b))) b) (- (sqrt (fma -3 (* c a) (* b b))) b)) (- (sqrt (fma -3 (* c a) (* b b))) b)) (* (* (* 3 a) (* 3 a)) (* 3 a)))
77.0ms
(- (log (- (sqrt (fma -3 (* c a) (* b b))) b)) (log (* 3 a)))
46.0ms
(- (pow b 2) (* 3 (* a c)))

prune893.0ms

Pruning

5 alts after pruning (5 fresh and 0 done)

Merged error: 0.6b

localize14.0ms

Local error

Found 4 expressions with local error:

0.4b
(* (* 3 a) (+ (sqrt (fma -3 (* c a) (* b b))) b))
0.4b
(/ (* (* a c) -3) (* (* 3 a) (+ (sqrt (fma -3 (* c a) (* b b))) b)))
0.3b
(* (* a c) -3)
0.2b
(fma -3 (* c a) (* b b))

rewrite21.0ms

Algorithm
rewrite-expression-head
Rules
11×add-exp-log
11×add-cbrt-cube
pow1
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
add-log-exp
log1p-expm1-u
associate-*r/
expm1-log1p-u
associate-*r*
flip-+
cbrt-unprod
*-commutative
associate-/r/
prod-exp
associate-*l*
div-exp
flip3-+
cbrt-undiv
associate-/l*
div-inv
fma-udef
pow-prod-down
times-frac
distribute-lft-in
frac-2neg
associate-/r*
clear-num
distribute-rgt-in
Counts
4 → 63
Calls
4 calls:
Slowest
9.0ms
(/ (* (* a c) -3) (* (* 3 a) (+ (sqrt (fma -3 (* c a) (* b b))) b)))
8.0ms
(* (* 3 a) (+ (sqrt (fma -3 (* c a) (* b b))) b))
2.0ms
(* (* a c) -3)
0.0ms
(fma -3 (* c a) (* b b))

series263.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
113.0ms
(/ (* (* a c) -3) (* (* 3 a) (+ (sqrt (fma -3 (* c a) (* b b))) b)))
99.0ms
(* (* 3 a) (+ (sqrt (fma -3 (* c a) (* b b))) b))
39.0ms
(fma -3 (* c a) (* b b))
11.0ms
(* (* a c) -3)

simplify3.4s

Counts
32 → 75
Calls
32 calls:
Slowest
620.0ms
(- (log (* (* a c) -3)) (+ (log (* 3 a)) (log (+ (sqrt (fma -3 (* c a) (* b b))) b))))
599.0ms
(/ (* (* (* (* a c) -3) (* (* a c) -3)) (* (* a c) -3)) (* (* (* (* 3 a) (+ (sqrt (fma -3 (* c a) (* b b))) b)) (* (* 3 a) (+ (sqrt (fma -3 (* c a) (* b b))) b))) (* (* 3 a) (+ (sqrt (fma -3 (* c a) (* b b))) b))))
597.0ms
(/ (* (* (* (* a c) -3) (* (* a c) -3)) (* (* a c) -3)) (* (* (* (* 3 a) (* 3 a)) (* 3 a)) (* (* (+ (sqrt (fma -3 (* c a) (* b b))) b) (+ (sqrt (fma -3 (* c a) (* b b))) b)) (+ (sqrt (fma -3 (* c a) (* b b))) b))))
473.0ms
(- (log (* (* a c) -3)) (log (* (* 3 a) (+ (sqrt (fma -3 (* c a) (* b b))) b))))
226.0ms
(+ (* (sqrt (fma -3 (* c a) (* b b))) (sqrt (fma -3 (* c a) (* b b)))) (- (* b b) (* (sqrt (fma -3 (* c a) (* b b))) b)))

prune1.0s

Pruning

11 alts after pruning (11 fresh and 0 done)

Merged error: 0.0b

localize12.0ms

Local error

Found 4 expressions with local error:

0.4b
(* (* 3 a) (+ (sqrt (fma -3 (* c a) (* b b))) b))
0.3b
(/ (* a c) (/ (* (* 3 a) (+ (sqrt (fma -3 (* c a) (* b b))) b)) -3))
0.2b
(/ (* (* 3 a) (+ (sqrt (fma -3 (* c a) (* b b))) b)) -3)
0.2b
(fma -3 (* c a) (* b b))

rewrite48.0ms

Algorithm
rewrite-expression-head
Rules
add-exp-log
add-cbrt-cube
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
pow1
add-log-exp
div-inv
log1p-expm1-u
associate-*r/
times-frac
associate-/r*
expm1-log1p-u
associate-*r*
associate-/l/
associate-/l*
flip-+
flip3-+
frac-2neg
clear-num
fma-udef
cbrt-unprod
*-commutative
associate-/r/
prod-exp
pow-prod-down
associate-*l*
div-exp
distribute-lft-in
cbrt-undiv
distribute-rgt-in
Counts
4 → 70
Calls
4 calls:
Slowest
18.0ms
(/ (* (* 3 a) (+ (sqrt (fma -3 (* c a) (* b b))) b)) -3)
16.0ms
(* (* 3 a) (+ (sqrt (fma -3 (* c a) (* b b))) b))
12.0ms
(/ (* a c) (/ (* (* 3 a) (+ (sqrt (fma -3 (* c a) (* b b))) b)) -3))
0.0ms
(fma -3 (* c a) (* b b))

series387.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
119.0ms
(/ (* (* 3 a) (+ (sqrt (fma -3 (* c a) (* b b))) b)) -3)
119.0ms
(* (* 3 a) (+ (sqrt (fma -3 (* c a) (* b b))) b))
113.0ms
(/ (* a c) (/ (* (* 3 a) (+ (sqrt (fma -3 (* c a) (* b b))) b)) -3))
36.0ms
(fma -3 (* c a) (* b b))

simplify3.4s

Counts
39 → 82
Calls
39 calls:
Slowest
388.0ms
(* (* 3 a) (+ (pow (sqrt (fma -3 (* c a) (* b b))) 3) (pow b 3)))
331.0ms
(- (log (* a c)) (log (/ (* (* 3 a) (+ (sqrt (fma -3 (* c a) (* b b))) b)) -3)))
272.0ms
(/ c (/ (* (* 3 a) (+ (sqrt (fma -3 (* c a) (* b b))) b)) -3))
238.0ms
(/ (* (* (* a c) (* a c)) (* a c)) (* (* (/ (* (* 3 a) (+ (sqrt (fma -3 (* c a) (* b b))) b)) -3) (/ (* (* 3 a) (+ (sqrt (fma -3 (* c a) (* b b))) b)) -3)) (/ (* (* 3 a) (+ (sqrt (fma -3 (* c a) (* b b))) b)) -3)))
235.0ms
(+ (* (sqrt (fma -3 (* c a) (* b b))) (sqrt (fma -3 (* c a) (* b b)))) (- (* b b) (* (sqrt (fma -3 (* c a) (* b b))) b)))

prune989.0ms

Pruning

8 alts after pruning (8 fresh and 0 done)

Merged error: 0b

localize29.0ms

Local error

Found 4 expressions with local error:

0.3b
(/ (/ (* a c) 1) (fma (- a) (sqrt (fma -3 (* a c) (* b b))) (* (- a) b)))
0.2b
(fma -3 (* a c) (* b b))
0.1b
(fma (- a) (sqrt (fma -3 (* a c) (* b b))) (* (- a) b))
0.1b
(sqrt (fma -3 (* a c) (* b b)))

rewrite6.0ms

Algorithm
rewrite-expression-head
Rules
15×add-sqr-sqrt
14×add-cube-cbrt
14×*-un-lft-identity
12×times-frac
add-exp-log
add-cbrt-cube
div-inv
add-log-exp
associate-/l*
log1p-expm1-u
pow1
expm1-log1p-u
sqrt-prod
associate-/r*
fma-udef
associate-/l/
div-exp
pow1/2
frac-2neg
clear-num
rem-sqrt-square
cbrt-undiv
Counts
4 → 68
Calls
4 calls:
Slowest
5.0ms
(/ (/ (* a c) 1) (fma (- a) (sqrt (fma -3 (* a c) (* b b))) (* (- a) b)))
1.0ms
(sqrt (fma -3 (* a c) (* b b)))
0.0ms
(fma -3 (* a c) (* b b))
0.0ms
(fma (- a) (sqrt (fma -3 (* a c) (* b b))) (* (- a) b))

series387.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
195.0ms
(/ (/ (* a c) 1) (fma (- a) (sqrt (fma -3 (* a c) (* b b))) (* (- a) b)))
88.0ms
(fma (- a) (sqrt (fma -3 (* a c) (* b b))) (* (- a) b))
64.0ms
(sqrt (fma -3 (* a c) (* b b)))
40.0ms
(fma -3 (* a c) (* b b))

simplify3.1s

Counts
49 → 80
Calls
49 calls:
Slowest
305.0ms
(/ (/ (* a c) 1) (fma (- a) (sqrt (fma -3 (* a c) (* b b))) (* (- a) b)))
254.0ms
(- (log (/ (* a c) 1)) (log (fma (- a) (sqrt (fma -3 (* a c) (* b b))) (* (- a) b))))
156.0ms
(/ (sqrt (/ (* a c) 1)) (cbrt (fma (- a) (sqrt (fma -3 (* a c) (* b b))) (* (- a) b))))
152.0ms
(/ (sqrt (/ (* a c) 1)) (sqrt (fma (- a) (sqrt (fma -3 (* a c) (* b b))) (* (- a) b))))
150.0ms
(/ (/ (* a c) 1) (cbrt (fma (- a) (sqrt (fma -3 (* a c) (* b b))) (* (- a) b))))

prune999.0ms

Pruning

7 alts after pruning (7 fresh and 0 done)

Merged error: 0b

regimes244.0ms

Accuracy

0% (0.4b remaining)

Error of 0.4b against oracle of 0.0b and baseline of 0.4b

bsearch8.0ms

end0.0ms

sample4.9s

Algorithm
intervals