Average Error: 28.8 → 0.3
Time: 39.8s
Precision: 64
Internal Precision: 128
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
\[\frac{c}{\left(-b\right) - \sqrt{\sqrt[3]{(\left(a \cdot -3\right) \cdot c + \left(b \cdot b\right))_* \cdot \left((\left(a \cdot -3\right) \cdot c + \left(b \cdot b\right))_* \cdot (\left(a \cdot -3\right) \cdot c + \left(b \cdot 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.8

    \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
  2. Using strategy rm
  3. Applied flip-+28.8

    \[\leadsto \frac{\color{blue}{\frac{\left(-b\right) \cdot \left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}{3 \cdot a}\]
  4. Applied associate-/l/28.8

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

    \[\leadsto \frac{\color{blue}{3 \cdot \left(c \cdot a\right)}}{\left(3 \cdot a\right) \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}\]
  6. Using strategy rm
  7. Applied times-frac0.6

    \[\leadsto \color{blue}{\frac{3}{3 \cdot a} \cdot \frac{c \cdot a}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}\]
  8. Simplified0.5

    \[\leadsto \color{blue}{\frac{1}{a}} \cdot \frac{c \cdot a}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}\]
  9. Simplified0.5

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

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

    \[\leadsto \color{blue}{{\left(\frac{1}{a}\right)}^{1}} \cdot {\left(\frac{c \cdot a}{\left(-b\right) - \sqrt{(-3 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*}}\right)}^{1}\]
  13. Applied pow-prod-down0.5

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

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

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

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

Reproduce

herbie shell --seed 2019022 +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: 38.5s)Debug log

sample157.0ms

Algorithm
intervals
Results
55.0ms138×body160valid
31.0ms257×body80nan
31.0ms513×pre80true
16.0ms118×body80valid

simplify73.0ms

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

prune31.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 28.3b

localize46.0ms

Local error

Found 4 expressions with local error:

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

rewrite29.0ms

Algorithm
rewrite-expression-head
Rules
13×*-un-lft-identity
add-log-exp
add-cube-cbrt
add-sqr-sqrt
add-exp-log
add-cbrt-cube
associate-/l*
log1p-expm1-u
times-frac
fma-def
pow1
expm1-log1p-u
distribute-lft-out
associate-/l/
flip-+
associate-+l-
flip3-+
neg-sub0
flip--
div-inv
*-commutative
prod-diff
associate-*l*
div-exp
div-sub
diff-log
fma-neg
flip3--
frac-2neg
sub-neg
sum-log
neg-mul-1
associate-/r*
clear-num
+-commutative
cbrt-undiv
Counts
4 → 72
Calls
4 calls:
Slowest
17.0ms
(/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a))
6.0ms
(+ (- b) (sqrt (- (* b b) (* (* 3 a) c))))
2.0ms
(- (* b b) (* (* 3 a) c))
2.0ms
(* (* 3 a) c)

series180.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
71.0ms
(/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a))
58.0ms
(+ (- b) (sqrt (- (* b b) (* (* 3 a) c))))
32.0ms
(- (* b b) (* (* 3 a) c))
19.0ms
(* (* 3 a) c)

simplify1.6s

Counts
34 → 84
Calls
34 calls:
Slowest
357.0ms
(- (* (- b) (- b)) (* (sqrt (- (* b b) (* (* 3 a) c))) (sqrt (- (* b b) (* (* 3 a) c)))))
126.0ms
(+ (pow (- b) 3) (pow (sqrt (- (* b b) (* (* 3 a) c))) 3))
117.0ms
(/ (* (* (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (+ (- b) (sqrt (- (* b b) (* (* 3 a) c))))) (+ (- b) (sqrt (- (* b b) (* (* 3 a) c))))) (* (* (* 3 a) (* 3 a)) (* 3 a)))
78.0ms
(- (log (+ (- b) (sqrt (- (* b b) (* (* 3 a) c))))) (log (* 3 a)))
75.0ms
(/ (exp (* b b)) (exp (* (* 3 a) c)))

prune912.0ms

Pruning

4 alts after pruning (4 fresh and 0 done)

Merged error: 0.5b

localize30.0ms

Local error

Found 4 expressions with local error:

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

rewrite49.0ms

Algorithm
rewrite-expression-head
Rules
48×prod-diff
37×add-sqr-sqrt
35×*-un-lft-identity
33×add-cube-cbrt
26×distribute-lft-in
26×distribute-rgt-in
25×sqrt-prod
12×neg-mul-1
11×add-exp-log
11×add-cbrt-cube
associate-*r*
pow1
add-log-exp
log1p-expm1-u
associate-*r/
expm1-log1p-u
*-commutative
difference-of-squares
flip--
cbrt-unprod
associate-/r/
prod-exp
associate-*l*
div-exp
flip3--
sub-neg
cbrt-undiv
distribute-lft-out--
associate-/l*
div-inv
pow-prod-down
times-frac
frac-2neg
associate-/r*
clear-num
Counts
4 → 117
Calls
4 calls:
Slowest
29.0ms
(* (* 3 a) (- (- b) (sqrt (- (* b b) (* (* 3 a) c)))))
15.0ms
(/ (* 3 (* c a)) (* (* 3 a) (- (- b) (sqrt (- (* b b) (* (* 3 a) c))))))
2.0ms
(* (* 3 a) c)
1.0ms
(* 3 (* c a))

series275.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
163.0ms
(/ (* 3 (* c a)) (* (* 3 a) (- (- b) (sqrt (- (* b b) (* (* 3 a) c))))))
89.0ms
(* (* 3 a) (- (- b) (sqrt (- (* b b) (* (* 3 a) c)))))
12.0ms
(* (* 3 a) c)
10.0ms
(* 3 (* c a))

simplify17.9s

Counts
84 → 129
Calls
84 calls:
Slowest
2.2s
(/ (* (* (* 3 (* c a)) (* 3 (* c a))) (* 3 (* c a))) (* (* (* (* 3 a) (* 3 a)) (* 3 a)) (* (* (- (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (- (- b) (sqrt (- (* b b) (* (* 3 a) c))))) (- (- b) (sqrt (- (* b b) (* (* 3 a) c)))))))
1.7s
(/ (* (* (* 3 (* c a)) (* 3 (* c a))) (* 3 (* c a))) (* (* (* (* 3 a) (- (- b) (sqrt (- (* b b) (* (* 3 a) c))))) (* (* 3 a) (- (- b) (sqrt (- (* b b) (* (* 3 a) c)))))) (* (* 3 a) (- (- b) (sqrt (- (* b b) (* (* 3 a) c)))))))
493.0ms
(+ (* (- b) (- b)) (+ (* (sqrt (- (* b b) (* (* 3 a) c))) (sqrt (- (* b b) (* (* 3 a) c)))) (* (- b) (sqrt (- (* b b) (* (* 3 a) c))))))
476.0ms
(+ (* (- b) (- b)) (+ (* (sqrt (- (* b b) (* (* 3 a) c))) (sqrt (- (* b b) (* (* 3 a) c)))) (* (- b) (sqrt (- (* b b) (* (* 3 a) c))))))
386.0ms
(* (* 3 a) (fma (- (sqrt (- (* b b) (* (* 3 a) c)))) 1 (* (sqrt (- (* b b) (* (* 3 a) c))) 1)))

prune1.6s

Pruning

11 alts after pruning (11 fresh and 0 done)

Merged error: 0.0b

localize16.0ms

Local error

Found 4 expressions with local error:

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

rewrite32.0ms

Algorithm
rewrite-expression-head
Rules
40×add-sqr-sqrt
32×*-un-lft-identity
24×add-cube-cbrt
24×prod-diff
16×sqrt-prod
12×associate-*r*
12×times-frac
11×add-exp-log
11×add-cbrt-cube
difference-of-squares
neg-mul-1
add-log-exp
associate-/r*
pow1
distribute-lft-out--
log1p-expm1-u
associate-/r/
associate-*l*
fma-neg
expm1-log1p-u
flip--
div-inv
flip3--
cbrt-unprod
prod-exp
div-exp
cbrt-undiv
associate-/l*
fma-udef
*-commutative
associate-*r/
associate-*l/
pow-prod-down
diff-log
frac-2neg
sub-neg
clear-num
frac-times
neg-sub0
associate--l-
Counts
4 → 119
Calls
4 calls:
Slowest
14.0ms
(* (/ 1 a) (/ (* c a) (- (- b) (sqrt (fma -3 (* c a) (* b b))))))
9.0ms
(- (- b) (sqrt (fma -3 (* c a) (* b b))))
7.0ms
(/ (* c a) (- (- b) (sqrt (fma -3 (* c a) (* b b)))))
0.0ms
(fma -3 (* c a) (* b b))

series385.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
157.0ms
(/ (* c a) (- (- b) (sqrt (fma -3 (* c a) (* b b)))))
111.0ms
(* (/ 1 a) (/ (* c a) (- (- b) (sqrt (fma -3 (* c a) (* b b))))))
70.0ms
(- (- b) (sqrt (fma -3 (* c a) (* b b))))
48.0ms
(fma -3 (* c a) (* b b))

simplify5.1s

Counts
113 → 131
Calls
113 calls:
Slowest
474.0ms
(+ (* (- b) (- b)) (+ (* (sqrt (fma -3 (* c a) (* b b))) (sqrt (fma -3 (* c a) (* b b)))) (* (- b) (sqrt (fma -3 (* c a) (* b b))))))
435.0ms
(+ (* (- b) (- b)) (+ (* (sqrt (fma -3 (* c a) (* b b))) (sqrt (fma -3 (* c a) (* b b)))) (* (- b) (sqrt (fma -3 (* c a) (* b b))))))
325.0ms
(+ (log (/ 1 a)) (- (log (* c a)) (log (- (- b) (sqrt (fma -3 (* c a) (* b b)))))))
307.0ms
(* (/ 1 a) (/ (* c a) (- (- b) (sqrt (fma -3 (* c a) (* b b))))))
230.0ms
(+ (log (/ 1 a)) (log (/ (* c a) (- (- b) (sqrt (fma -3 (* c a) (* b b)))))))

prune1.3s

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 0b

localize22.0ms

Local error

Found 4 expressions with local error:

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

rewrite18.0ms

Algorithm
rewrite-expression-head
Rules
30×add-sqr-sqrt
25×*-un-lft-identity
24×prod-diff
21×add-cube-cbrt
17×sqrt-prod
neg-mul-1
add-log-exp
associate-/r*
difference-of-squares
log1p-expm1-u
add-exp-log
fma-neg
add-cbrt-cube
pow1
expm1-log1p-u
distribute-lft-out--
flip--
associate-/r/
flip3--
div-inv
fma-udef
diff-log
pow1/2
frac-2neg
sub-neg
clear-num
rem-sqrt-square
neg-sub0
associate--l-
Counts
4 → 90
Calls
4 calls:
Slowest
9.0ms
(- (- b) (sqrt (fma (* a -3) c (* b b))))
5.0ms
(/ c (- (- b) (sqrt (fma (* a -3) c (* b b)))))
1.0ms
(sqrt (fma (* a -3) c (* b b)))
0.0ms
(fma (* a -3) c (* b b))

series268.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
121.0ms
(/ c (- (- b) (sqrt (fma (* a -3) c (* b b)))))
60.0ms
(- (- b) (sqrt (fma (* a -3) c (* b b))))
48.0ms
(fma (* a -3) c (* b b))
39.0ms
(sqrt (fma (* a -3) c (* b b)))

simplify2.5s

Counts
80 → 102
Calls
80 calls:
Slowest
360.0ms
(+ (* (- b) (- b)) (+ (* (sqrt (fma (* a -3) c (* b b))) (sqrt (fma (* a -3) c (* b b)))) (* (- b) (sqrt (fma (* a -3) c (* b b))))))
57.0ms
(fma 1 (- b) (- (* (sqrt (cbrt (fma (* a -3) c (* b b)))) (sqrt (* (cbrt (fma (* a -3) c (* b b))) (cbrt (fma (* a -3) c (* b b))))))))
52.0ms
(fma 1 (- b) (- (* (cbrt (sqrt (fma (* a -3) c (* b b)))) (* (cbrt (sqrt (fma (* a -3) c (* b b)))) (cbrt (sqrt (fma (* a -3) c (* b b))))))))
50.0ms
(fma 1 (- b) (- (* (sqrt (fma (* a -3) c (* b b))) 1)))
48.0ms
(fma (sqrt (- b)) (sqrt (- b)) (- (* (sqrt (fma (* a -3) c (* b b))) (sqrt 1))))

prune1.2s

Pruning

8 alts after pruning (8 fresh and 0 done)

Merged error: 0b

regimes234.0ms

Accuracy

0% (0.3b remaining)

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

bsearch2.0ms

end0.0ms

sample4.5s

Algorithm
intervals
Results
1.6s4514×body160valid
1.0s8334×body80nan
977.0ms16334×pre80true
451.0ms3486×body80valid