Average Error: 28.7 → 0.3
Time: 19.6s
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 28.7

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

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

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

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

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

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

    \[\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, 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: 12.4s)Debug log

start213.0ms

Algorithm
intervals

setup139.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 29.0b

localize43.0ms

Local error

Found 4 expressions with local error:

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

rewrite48.0ms

Algorithm
rewrite-expression-head
Counts
4 → 53
Calls

4 calls. Slowest were:

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

series170.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

61.0ms
(/ (- (sqrt (+ (* -3 (* c a)) (* b b))) b) (* 3 a))
49.0ms
(- (sqrt (+ (* -3 (* c a)) (* b b))) b)
43.0ms
(+ (* -3 (* c a)) (* b b))
17.0ms
(* -3 (* c a))

simplify1.1s

Counts
26 → 65
Calls

26 calls. Slowest were:

613.0ms
(- (* (sqrt (+ (* -3 (* c a)) (* b b))) (sqrt (+ (* -3 (* c a)) (* b b)))) (* b b))
93.0ms
(- (pow (sqrt (+ (* -3 (* c a)) (* b b))) 3) (pow b 3))
65.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)))

prune734.0ms

Pruning

6 alts after pruning (6 fresh and 0 done)

Merged error: 0.6b

localize13.0ms

Local error

Found 4 expressions with local error:

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

rewrite52.0ms

Algorithm
rewrite-expression-head
Counts
4 → 56
Calls

4 calls. Slowest were:

28.0ms
(* (* 3 a) (+ (sqrt (+ (* -3 (* c a)) (* b b))) b))
17.0ms
(/ (* (* a c) -3) (* (* 3 a) (+ (sqrt (+ (* -3 (* c a)) (* b b))) b)))
4.0ms
(* (* a c) -3)

series258.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

138.0ms
(/ (* (* a c) -3) (* (* 3 a) (+ (sqrt (+ (* -3 (* c a)) (* b b))) b)))
90.0ms
(* (* 3 a) (+ (sqrt (+ (* -3 (* c a)) (* b b))) b))
16.0ms
(* -3 (* c a))
14.0ms
(* (* a c) -3)

simplify3.3s

Counts
32 → 68
Calls

32 calls. Slowest were:

793.0ms
(/ (* (* (* (* 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))))
699.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))))
677.0ms
(- (log (* (* a c) -3)) (+ (log (* 3 a)) (log (+ (sqrt (+ (* -3 (* c a)) (* b b))) b))))

prune941.0ms

Pruning

12 alts after pruning (12 fresh and 0 done)

Merged error: 0.0b

localize12.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.2b
(+ (* -3 (* c a)) (* b b))

rewrite10.0ms

Algorithm
rewrite-expression-head
Counts
4 → 47
Calls

4 calls. Slowest were:

6.0ms
(* (* 1/3 c) (/ -3 (+ (sqrt (+ (* -3 (* c a)) (* b b))) b)))
2.0ms
(+ (* -3 (* c a)) (* b b))
1.0ms
(* -3 (* c a))

series192.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

130.0ms
(* (* 1/3 c) (/ -3 (+ (sqrt (+ (* -3 (* c a)) (* b b))) b)))
43.0ms
(+ (* -3 (* c a)) (* b b))
11.0ms
(* -3 (* c a))
7.0ms
(* 1/3 c)

simplify1.3s

Counts
23 → 59
Calls

23 calls. Slowest were:

637.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))))
154.0ms
(+ (* (sqrt (+ (* -3 (* c a)) (* b b))) (sqrt (+ (* -3 (* c a)) (* b b)))) (- (* b b) (* (sqrt (+ (* -3 (* c a)) (* b b))) b)))
126.0ms
(+ (log (* 1/3 c)) (log (/ -3 (+ (sqrt (+ (* -3 (* c a)) (* b b))) b))))

prune814.0ms

Pruning

8 alts after pruning (8 fresh and 0 done)

Merged error: 0.0b

localize32.0ms

Local error

Found 4 expressions with local error:

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

rewrite23.0ms

Algorithm
rewrite-expression-head
Counts
4 → 65
Calls

4 calls. Slowest were:

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

series204.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

118.0ms
(/ (- c) (+ b (sqrt (+ (* b b) (* -3 (* c a))))))
50.0ms
(+ b (sqrt (+ (* b b) (* -3 (* c a)))))
25.0ms
(+ (* b b) (* -3 (* c a)))
11.0ms
(* -3 (* c a))

simplify1.5s

Counts
48 → 77
Calls

48 calls. Slowest were:

311.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)))))))
138.0ms
(+ (* b b) (- (* (sqrt (+ (* b b) (* -3 (* c a)))) (sqrt (+ (* b b) (* -3 (* c a))))) (* b (sqrt (+ (* b b) (* -3 (* c a)))))))
126.0ms
(- (* 2 b) (* 3/2 (/ (* a c) b)))

prune984.0ms

Pruning

9 alts after pruning (8 fresh and 1 done)

Merged error: 0b

regimes340.0ms

Accuracy

0% (0.3b remaining)

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

bsearch2.0ms