Average Error: 43.2 → 0.2
Time: 20.9s
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{\frac{\left(b \cdot b\right) \cdot \left(b \cdot b\right) - \left(\left(3 \cdot a\right) \cdot c\right) \cdot \left(\left(3 \cdot a\right) \cdot c\right)}{b \cdot b + \left(3 \cdot a\right) \cdot c}}}\]

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.2

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

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

    \[\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 flip--0.2

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

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

Reproduce

herbie shell --seed 2019010 
(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: 20.1s)Debug log

sample160.0ms

Algorithm
intervals

simplify78.0ms

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

prune21.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 42.8b

localize35.0ms

Local error

Found 4 expressions with local error:

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

rewrite38.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
18.0ms
(/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a))
10.0ms
(- (* b b) (* (* 3 a) c))
5.0ms
(+ (- b) (sqrt (- (* b b) (* (* 3 a) c))))
4.0ms
(* (* 3 a) c)

series158.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
70.0ms
(/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a))
47.0ms
(+ (- b) (sqrt (- (* b b) (* (* 3 a) c))))
26.0ms
(- (* b b) (* (* 3 a) c))
16.0ms
(* (* 3 a) c)

simplify1.6s

Counts
30 → 70
Calls
30 calls:
Slowest
326.0ms
(- (* (- b) (- b)) (* (sqrt (- (* b b) (* (* 3 a) c))) (sqrt (- (* b b) (* (* 3 a) c)))))
255.0ms
(+ (pow (- b) 3) (pow (sqrt (- (* b b) (* (* 3 a) c))) 3))
111.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)))
85.0ms
(/ (exp (* b b)) (exp (* (* 3 a) c)))
68.0ms
(- (log (+ (- b) (sqrt (- (* b b) (* (* 3 a) c))))) (log (* 3 a)))

prune780.0ms

Pruning

6 alts after pruning (6 fresh and 0 done)

Merged error: 0.3b

localize14.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.3b
(* 3 (* c a))
0.3b
(* (* 3 a) c)

rewrite30.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)))))
11.0ms
(/ (* 3 (* c a)) (* (* 3 a) (- (- b) (sqrt (- (* b b) (* (* 3 a) c))))))
4.0ms
(* (* 3 a) c)
2.0ms
(* 3 (* c a))

series268.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
166.0ms
(/ (* 3 (* c a)) (* (* 3 a) (- (- b) (sqrt (- (* b b) (* (* 3 a) c))))))
78.0ms
(* (* 3 a) (- (- b) (sqrt (- (* b b) (* (* 3 a) c)))))
13.0ms
(* (* 3 a) c)
11.0ms
(* 3 (* c a))

simplify6.2s

Counts
36 → 73
Calls
36 calls:
Slowest
2.3s
(/ (* (* (* 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.8s
(/ (* (* (* 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)))))))
444.0ms
(+ (* (- b) (- b)) (+ (* (sqrt (- (* b b) (* (* 3 a) c))) (sqrt (- (* b b) (* (* 3 a) c)))) (* (- b) (sqrt (- (* b b) (* (* 3 a) c))))))
350.0ms
(+ (* (- b) (- b)) (+ (* (sqrt (- (* b b) (* (* 3 a) c))) (sqrt (- (* b b) (* (* 3 a) c)))) (* (- b) (sqrt (- (* b b) (* (* 3 a) c))))))
183.0ms
(* (* 3 a) (- (- b) (sqrt (- (* b b) (* (* 3 a) c)))))

prune824.0ms

Pruning

11 alts after pruning (11 fresh and 0 done)

Merged error: 0b

localize13.0ms

Local error

Found 4 expressions with local error:

0.3b
(/ (* 3 (* c a)) (* 3 a))
0.3b
(* 3 (* c a))
0.3b
(* (* 3 a) c)
0.1b
(- (* b b) (* (* 3 a) c))

rewrite17.0ms

Algorithm
rewrite-expression-head
Rules
add-log-exp
add-exp-log
add-cbrt-cube
add-cube-cbrt
*-un-lft-identity
pow1
add-sqr-sqrt
*-commutative
associate-/l*
flip--
div-inv
associate-*l*
associate-*r*
div-exp
diff-log
flip3--
times-frac
frac-2neg
sub-neg
associate-/r*
clear-num
cbrt-undiv
Counts
4 → 45
Calls
4 calls:
Slowest
7.0ms
(/ (* 3 (* c a)) (* 3 a))
4.0ms
(- (* b b) (* (* 3 a) c))
4.0ms
(* (* 3 a) c)
2.0ms
(* 3 (* c a))

series90.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
42.0ms
(- (* b b) (* (* 3 a) c))
23.0ms
(* 3 (* c a))
18.0ms
(* (* 3 a) c)
7.0ms
(/ (* 3 (* c a)) (* 3 a))

simplify1.4s

Counts
17 → 57
Calls
17 calls:
Slowest
1.0s
(/ (* (* (* 3 (* c a)) (* 3 (* c a))) (* 3 (* c a))) (* (* (* 3 a) (* 3 a)) (* 3 a)))
183.0ms
(- (log (* 3 (* c a))) (log (* 3 a)))
77.0ms
(/ (exp (* b b)) (exp (* (* 3 a) c)))
43.0ms
(- (pow b 2) (* 3 (* a c)))
34.0ms
(- (pow b 2) (* 3 (* a c)))

prune827.0ms

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 0b

localize7.0ms

Local error

Found 4 expressions with local error:

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

rewrite28.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
11.0ms
(- (- b) (sqrt (- (* b b) (* (* 3 a) c))))
8.0ms
(/ c (- (- b) (sqrt (- (* b b) (* (* 3 a) c)))))
4.0ms
(* (* 3 a) c)
4.0ms
(- (* b b) (* (* 3 a) c))

series232.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
128.0ms
(/ c (- (- b) (sqrt (- (* b b) (* (* 3 a) c)))))
51.0ms
(- (- b) (sqrt (- (* b b) (* (* 3 a) c))))
30.0ms
(- (* b b) (* (* 3 a) c))
23.0ms
(* (* 3 a) c)

simplify1.3s

Counts
27 → 67
Calls
27 calls:
Slowest
328.0ms
(+ (* (- b) (- b)) (+ (* (sqrt (- (* b b) (* (* 3 a) c))) (sqrt (- (* b b) (* (* 3 a) c)))) (* (- b) (sqrt (- (* b b) (* (* 3 a) c))))))
84.0ms
(/ (exp (- b)) (exp (sqrt (- (* b b) (* (* 3 a) c)))))
77.0ms
(/ (exp (* b b)) (exp (* (* 3 a) c)))
76.0ms
(- (* 3/2 (/ (* a c) b)) (* 2 b))
57.0ms
(- (- b) (sqrt (- (* b b) (* (* 3 a) c))))

prune697.0ms

Pruning

8 alts after pruning (8 fresh and 0 done)

Merged error: 0b

regimes431.0ms

Accuracy

0% (0.2b remaining)

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

bsearch4.0ms

end0.0ms

sample4.8s

Algorithm
intervals