Average Error: 43.5 → 0.2
Time: 21.0s
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(\left(b \cdot b - c \cdot \left(3 \cdot a\right)\right) \cdot \left(b \cdot b - c \cdot \left(3 \cdot a\right)\right)\right) \cdot \left(b \cdot b - c \cdot \left(3 \cdot a\right)\right)}}}\]

Error

Bits error versus a

Bits error versus b

Bits error versus c

Bits error versus d

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 43.5

    \[\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-+43.5

    \[\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/43.5

    \[\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.5

    \[\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 associate-/r*0.5

    \[\leadsto \color{blue}{\frac{\frac{3 \cdot \left(c \cdot a\right)}{3 \cdot a}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}\]
  8. Taylor expanded around -inf 0.2

    \[\leadsto \frac{\color{blue}{c}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}\]
  9. Using strategy rm
  10. Applied add-cbrt-cube0.2

    \[\leadsto \frac{c}{\left(-b\right) - \sqrt{\color{blue}{\sqrt[3]{\left(\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right) \cdot \left(b \cdot b - \left(3 \cdot a\right) \cdot c\right)\right) \cdot \left(b \cdot b - \left(3 \cdot a\right) \cdot c\right)}}}}\]
  11. Final simplification0.2

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

Reproduce

herbie shell --seed 2019022 
(FPCore (a b c d)
  :name "Cubic critical, medium range"
  :pre (and (< 1.1102230246251565e-16 a 9007199254740992.0) (< 1.1102230246251565e-16 b 9007199254740992.0) (< 1.1102230246251565e-16 c 9007199254740992.0))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))

Details

Time bar (total: 19.8s)Debug log

sample139.0ms

Algorithm
intervals
Results
26.0ms135×body160valid
24.0ms266×body80nan
22.0ms522×pre80true
13.0ms46×body320valid
8.0ms75×body80valid

simplify53.0ms

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

prune16.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 39.9b

localize25.0ms

Local error

Found 4 expressions with local error:

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

rewrite42.0ms

Algorithm
rewrite-expression-head
Rules
12×*-un-lft-identity
add-log-exp
add-cube-cbrt
add-exp-log
add-cbrt-cube
add-sqr-sqrt
associate-/l*
times-frac
pow1
distribute-lft-out
associate-/l/
flip-+
associate-+l-
flip3-+
neg-sub0
flip--
div-inv
*-commutative
associate-*l*
div-exp
div-sub
diff-log
flip3--
frac-2neg
sub-neg
sum-log
associate-/r*
clear-num
+-commutative
cbrt-undiv
Counts
4 → 58
Calls
4 calls:
Slowest
28.0ms
(/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a))
10.0ms
(+ (- b) (sqrt (- (* b b) (* (* 3 a) c))))
2.0ms
(* (* 3 a) c)
2.0ms
(- (* b b) (* (* 3 a) c))

series537.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
436.0ms
(/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a))
44.0ms
(+ (- b) (sqrt (- (* b b) (* (* 3 a) c))))
40.0ms
(- (* b b) (* (* 3 a) c))
17.0ms
(* (* 3 a) c)

simplify1.6s

Counts
30 → 70
Calls
30 calls:
Slowest
307.0ms
(- (* (- b) (- b)) (* (sqrt (- (* b b) (* (* 3 a) c))) (sqrt (- (* b b) (* (* 3 a) c)))))
305.0ms
(+ (pow (- b) 3) (pow (sqrt (- (* b b) (* (* 3 a) c))) 3))
106.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)))
98.0ms
(* (exp (- b)) (exp (sqrt (- (* b b) (* (* 3 a) c)))))
84.0ms
(/ (exp (* b b)) (exp (* (* 3 a) c)))

prune779.0ms

Pruning

3 alts after pruning (3 fresh and 0 done)

Merged error: 0.3b

localize22.0ms

Local error

Found 4 expressions with local error:

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

rewrite26.0ms

Algorithm
rewrite-expression-head
Rules
11×add-exp-log
11×add-cbrt-cube
add-sqr-sqrt
associate-*r*
*-un-lft-identity
pow1
add-cube-cbrt
add-log-exp
associate-*r/
*-commutative
difference-of-squares
flip--
cbrt-unprod
associate-/r/
prod-exp
associate-*l*
div-exp
flip3--
distribute-lft-in
sub-neg
cbrt-undiv
distribute-rgt-in
distribute-lft-out--
associate-/l*
div-inv
sqrt-prod
pow-prod-down
times-frac
frac-2neg
associate-/r*
clear-num
Counts
4 → 61
Calls
4 calls:
Slowest
12.0ms
(* (* 3 a) (- (- b) (sqrt (- (* b b) (* (* 3 a) c)))))
10.0ms
(/ (* 3 (* c a)) (* (* 3 a) (- (- b) (sqrt (- (* b b) (* (* 3 a) c))))))
2.0ms
(* (* 3 a) c)
1.0ms
(* 3 (* c a))

series237.0ms

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

simplify6.0s

Counts
36 → 73
Calls
36 calls:
Slowest
2.0s
(/ (* (* (* 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)))))))
489.0ms
(+ (* (- b) (- b)) (+ (* (sqrt (- (* b b) (* (* 3 a) c))) (sqrt (- (* b b) (* (* 3 a) c)))) (* (- b) (sqrt (- (* b b) (* (* 3 a) c))))))
417.0ms
(+ (* (- b) (- b)) (+ (* (sqrt (- (* b b) (* (* 3 a) c))) (sqrt (- (* b b) (* (* 3 a) c)))) (* (- b) (sqrt (- (* b b) (* (* 3 a) c))))))
156.0ms
(* (* 3 a) (- (- b) (sqrt (- (* b b) (* (* 3 a) c)))))

prune833.0ms

Pruning

8 alts after pruning (8 fresh and 0 done)

Merged error: 0.0b

localize11.0ms

Local error

Found 4 expressions with local error:

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

rewrite21.0ms

Algorithm
rewrite-expression-head
Rules
add-sqr-sqrt
add-log-exp
add-exp-log
add-cbrt-cube
*-un-lft-identity
add-cube-cbrt
pow1
difference-of-squares
*-commutative
distribute-lft-out--
associate-/l*
flip--
div-inv
sqrt-prod
associate-*l*
associate-*r*
div-exp
diff-log
flip3--
times-frac
frac-2neg
sub-neg
associate-/r*
clear-num
cbrt-undiv
neg-sub0
associate--l-
Counts
4 → 49
Calls
4 calls:
Slowest
12.0ms
(/ (* 3 (* c a)) (* 3 a))
6.0ms
(- (- b) (sqrt (- (* b b) (* (* 3 a) c))))
2.0ms
(* (* 3 a) c)
1.0ms
(* 3 (* c a))

series80.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
53.0ms
(- (- b) (sqrt (- (* b b) (* (* 3 a) c))))
12.0ms
(* 3 (* c a))
11.0ms
(* (* 3 a) c)
4.0ms
(/ (* 3 (* c a)) (* 3 a))

simplify1.4s

Counts
22 → 61
Calls
22 calls:
Slowest
886.0ms
(/ (* (* (* 3 (* c a)) (* 3 (* c a))) (* 3 (* c a))) (* (* (* 3 a) (* 3 a)) (* 3 a)))
158.0ms
(- (log (* 3 (* c a))) (log (* 3 a)))
58.0ms
(* -3/2 (/ (* a c) b))
55.0ms
(- (* 3/2 (/ (* a c) b)) (* 2 b))
53.0ms
(/ (exp (- b)) (exp (sqrt (- (* b b) (* (* 3 a) c)))))

prune743.0ms

Pruning

8 alts after pruning (8 fresh and 0 done)

Merged error: 0.0b

localize4.0ms

Local error

Found 4 expressions with local error:

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

rewrite15.0ms

Algorithm
rewrite-expression-head
Rules
13×add-sqr-sqrt
*-un-lft-identity
add-log-exp
associate-/r*
add-cube-cbrt
difference-of-squares
add-exp-log
add-cbrt-cube
pow1
flip--
flip3--
distribute-lft-out--
sqrt-prod
associate-/r/
diff-log
sub-neg
div-inv
*-commutative
associate-*l*
frac-2neg
clear-num
neg-sub0
associate--l-
Counts
4 → 55
Calls
4 calls:
Slowest
5.0ms
(- (- b) (sqrt (- (* b b) (* (* 3 a) c))))
4.0ms
(/ c (- (- b) (sqrt (- (* b b) (* (* 3 a) c)))))
2.0ms
(- (* b b) (* (* 3 a) c))
2.0ms
(* (* 3 a) c)

series228.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
131.0ms
(/ c (- (- b) (sqrt (- (* b b) (* (* 3 a) c)))))
61.0ms
(- (- b) (sqrt (- (* b b) (* (* 3 a) c))))
25.0ms
(- (* b b) (* (* 3 a) c))
11.0ms
(* (* 3 a) c)

simplify1.1s

Counts
27 → 67
Calls
27 calls:
Slowest
326.0ms
(+ (* (- b) (- b)) (+ (* (sqrt (- (* b b) (* (* 3 a) c))) (sqrt (- (* b b) (* (* 3 a) c)))) (* (- b) (sqrt (- (* b b) (* (* 3 a) c))))))
76.0ms
(/ (exp (* b b)) (exp (* (* 3 a) c)))
65.0ms
(- (* 3/2 (/ (* a c) b)) (* 2 b))
59.0ms
(/ (exp (- b)) (exp (sqrt (- (* b b) (* (* 3 a) c)))))
45.0ms
(- (- b) (sqrt (- (* b b) (* (* 3 a) c))))

prune517.0ms

Pruning

7 alts after pruning (7 fresh and 0 done)

Merged error: 0b

regimes221.0ms

Accuracy

0% (0.2b remaining)

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

bsearch3.0ms

end0.0ms

sample5.1s

Algorithm
intervals
Results
1.4s16250×pre80true
1.3s4780×body160valid
1.1s8250×body80nan
608.0ms1358×body320valid
245.0ms1862×body80valid