Average Error: 52.4 → 0.1
Time: 22.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}{\sqrt{b \cdot b + \left(a \cdot c\right) \cdot -3} + b}\]

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 52.4

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

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

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

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

    \[\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) + b \cdot b} + b\right)}\]
  7. Using strategy rm
  8. Applied times-frac0.5

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2018362 
(FPCore (a b c d)
  :name "Cubic critical, wide range"
  :pre (and (< 4.930380657631324e-32 a 2.028240960365167e+31) (< 4.930380657631324e-32 b 2.028240960365167e+31) (< 4.930380657631324e-32 c 2.028240960365167e+31))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))

Details

Time bar (total: 13.0s)Debug log

start231.0ms

Algorithm
intervals

setup120.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 51.3b

localize50.0ms

Local error

Found 4 expressions with local error:

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

rewrite65.0ms

Algorithm
rewrite-expression-head
Counts
4 → 53
Calls

4 calls. Slowest were:

40.0ms
(/ (- (sqrt (+ (* -3 (* c a)) (* b b))) b) (* 3 a))
21.0ms
(- (sqrt (+ (* -3 (* c a)) (* b b))) b)
3.0ms
(+ (* -3 (* c a)) (* b b))

series183.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

66.0ms
(/ (- (sqrt (+ (* -3 (* c a)) (* b b))) b) (* 3 a))
52.0ms
(- (sqrt (+ (* -3 (* c a)) (* b b))) b)
46.0ms
(+ (* -3 (* c a)) (* b b))
18.0ms
(* -3 (* c a))

simplify1.2s

Counts
26 → 65
Calls

26 calls. Slowest were:

624.0ms
(- (* (sqrt (+ (* -3 (* c a)) (* b b))) (sqrt (+ (* -3 (* c a)) (* b b)))) (* b b))
107.0ms
(- (pow (sqrt (+ (* -3 (* c a)) (* b b))) 3) (pow b 3))
83.0ms
(/ (* (* (- (sqrt (+ (* -3 (* c a)) (* b b))) b) (- (sqrt (+ (* -3 (* c a)) (* b b))) b)) (- (sqrt (+ (* -3 (* c a)) (* b b))) b)) (* (* (* 3 a) (* 3 a)) (* 3 a)))

prune843.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.5b

localize26.0ms

Local error

Found 4 expressions with local error:

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

rewrite63.0ms

Algorithm
rewrite-expression-head
Counts
4 → 56
Calls

4 calls. Slowest were:

33.0ms
(* (* 3 a) (+ (sqrt (+ (* -3 (* c a)) (* b b))) b))
23.0ms
(/ (* (* a c) -3) (* (* 3 a) (+ (sqrt (+ (* -3 (* c a)) (* b b))) b)))
4.0ms
(* (* a c) -3)

series276.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

121.0ms
(* (* 3 a) (+ (sqrt (+ (* -3 (* c a)) (* b b))) b))
119.0ms
(/ (* (* a c) -3) (* (* 3 a) (+ (sqrt (+ (* -3 (* c a)) (* b b))) b)))
18.0ms
(* (* a c) -3)
17.0ms
(* -3 (* c a))

simplify3.8s

Counts
32 → 68
Calls

32 calls. Slowest were:

1.2s
(/ (* (* (* (* a c) -3) (* (* a c) -3)) (* (* a c) -3)) (* (* (* (* 3 a) (* 3 a)) (* 3 a)) (* (* (+ (sqrt (+ (* -3 (* c a)) (* b b))) b) (+ (sqrt (+ (* -3 (* c a)) (* b b))) b)) (+ (sqrt (+ (* -3 (* c a)) (* b b))) b))))
717.0ms
(/ (* (* (* (* a c) -3) (* (* a c) -3)) (* (* a c) -3)) (* (* (* (* 3 a) (+ (sqrt (+ (* -3 (* c a)) (* b b))) b)) (* (* 3 a) (+ (sqrt (+ (* -3 (* c a)) (* b b))) b))) (* (* 3 a) (+ (sqrt (+ (* -3 (* c a)) (* b b))) b))))
643.0ms
(- (log (* (* a c) -3)) (+ (log (* 3 a)) (log (+ (sqrt (+ (* -3 (* c a)) (* b b))) b))))

prune867.0ms

Pruning

10 alts after pruning (9 fresh and 1 done)

Merged error: 0.0b

localize18.0ms

Local error

Found 4 expressions with local error:

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

rewrite12.0ms

Algorithm
rewrite-expression-head
Counts
4 → 47
Calls

4 calls. Slowest were:

8.0ms
(* (* 1/3 c) (/ -3 (+ (sqrt (+ (* -3 (* c a)) (* b b))) b)))
3.0ms
(+ (* -3 (* c a)) (* b b))
1.0ms
(* -3 (* c a))

series207.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

124.0ms
(* (* 1/3 c) (/ -3 (+ (sqrt (+ (* -3 (* c a)) (* b b))) b)))
53.0ms
(+ (* -3 (* c a)) (* b b))
16.0ms
(* -3 (* c a))
14.0ms
(* 1/3 c)

simplify1.3s

Counts
23 → 59
Calls

23 calls. Slowest were:

629.0ms
(* (* (* (* 1/3 c) (* 1/3 c)) (* 1/3 c)) (* (* (/ -3 (+ (sqrt (+ (* -3 (* c a)) (* b b))) b)) (/ -3 (+ (sqrt (+ (* -3 (* c a)) (* b b))) b))) (/ -3 (+ (sqrt (+ (* -3 (* c a)) (* b b))) b))))
152.0ms
(+ (* (sqrt (+ (* -3 (* c a)) (* b b))) (sqrt (+ (* -3 (* c a)) (* b b)))) (- (* b b) (* (sqrt (+ (* -3 (* c a)) (* b b))) b)))
97.0ms
(+ (log (* 1/3 c)) (log (/ -3 (+ (sqrt (+ (* -3 (* c a)) (* b b))) b))))

prune787.0ms

Pruning

6 alts after pruning (5 fresh and 1 done)

Merged error: 0b

localize16.0ms

Local error

Found 4 expressions with local error:

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

rewrite11.0ms

Algorithm
rewrite-expression-head
Counts
4 → 65
Calls

4 calls. Slowest were:

5.0ms
(/ (- c) (+ b (sqrt (+ (* b b) (* -3 (* c a))))))
2.0ms
(+ (* b b) (* -3 (* c a)))
2.0ms
(+ b (sqrt (+ (* b b) (* -3 (* c a)))))

series229.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

121.0ms
(/ (- c) (+ b (sqrt (+ (* b b) (* -3 (* c a))))))
64.0ms
(+ b (sqrt (+ (* b b) (* -3 (* c a)))))
29.0ms
(+ (* b b) (* -3 (* c a)))
15.0ms
(* -3 (* c a))

simplify1.4s

Counts
48 → 77
Calls

48 calls. Slowest were:

275.0ms
(/ (* (* (- c) (- c)) (- c)) (* (* (+ b (sqrt (+ (* b b) (* -3 (* c a))))) (+ b (sqrt (+ (* b b) (* -3 (* c a)))))) (+ b (sqrt (+ (* b b) (* -3 (* c a)))))))
176.0ms
(+ (* b b) (- (* (sqrt (+ (* b b) (* -3 (* c a)))) (sqrt (+ (* b b) (* -3 (* c a))))) (* b (sqrt (+ (* b b) (* -3 (* c a)))))))
134.0ms
(- (* 2 b) (* 3/2 (/ (* a c) b)))

prune1.1s

Pruning

5 alts after pruning (3 fresh and 2 done)

Merged error: 0b

regimes242.0ms

Accuracy

0% (0.1b remaining)

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

bsearch4.0ms