Average Error: 28.6 → 0.3
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}{\sqrt{\frac{\left(b \cdot b\right) \cdot \left(b \cdot b\right) - \left(\left(c \cdot a\right) \cdot -3\right) \cdot \left(\left(c \cdot a\right) \cdot -3\right)}{b \cdot b - \left(c \cdot a\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.6

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

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

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

    \[\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. Using strategy rm
  16. Applied flip-+0.3

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

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

Reproduce

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

start190.0ms

Algorithm
intervals

setup98.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 30.0b

localize21.0ms

Local error

Found 4 expressions with local error:

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

rewrite62.0ms

Algorithm
rewrite-expression-head
Counts
4 → 53
Calls

4 calls. Slowest were:

31.0ms
(/ (- (sqrt (+ (* -3 (* c a)) (* b b))) b) (* 3 a))
27.0ms
(- (sqrt (+ (* -3 (* c a)) (* b b))) b)
3.0ms
(+ (* -3 (* c a)) (* b b))

series175.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

75.0ms
(/ (- (sqrt (+ (* -3 (* c a)) (* b b))) b) (* 3 a))
46.0ms
(- (sqrt (+ (* -3 (* c a)) (* b b))) b)
35.0ms
(+ (* -3 (* c a)) (* b b))
18.0ms
(* -3 (* c a))

simplify1.5s

Counts
26 → 65
Calls

26 calls. Slowest were:

906.0ms
(- (* (sqrt (+ (* -3 (* c a)) (* b b))) (sqrt (+ (* -3 (* c a)) (* b b)))) (* b b))
97.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)))
85.0ms
(- (pow (sqrt (+ (* -3 (* c a)) (* b b))) 3) (pow b 3))

prune750.0ms

Pruning

5 alts after pruning (5 fresh and 0 done)

Merged error: 0.6b

localize23.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))

rewrite30.0ms

Algorithm
rewrite-expression-head
Counts
4 → 56
Calls

4 calls. Slowest were:

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

series271.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

122.0ms
(/ (* (* a c) -3) (* (* 3 a) (+ (sqrt (+ (* -3 (* c a)) (* b b))) b)))
88.0ms
(* (* 3 a) (+ (sqrt (+ (* -3 (* c a)) (* b b))) b))
43.0ms
(* -3 (* c a))
19.0ms
(* (* a c) -3)

simplify3.6s

Counts
32 → 68
Calls

32 calls. Slowest were:

1.0s
(/ (* (* (* (* 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))))
702.0ms
(- (log (* (* a c) -3)) (+ (log (* 3 a)) (log (+ (sqrt (+ (* -3 (* c a)) (* b b))) b))))
628.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))))

prune1.0s

Pruning

13 alts after pruning (13 fresh and 0 done)

Merged error: 0.0b

localize19.0ms

Local error

Found 4 expressions with local error:

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

rewrite21.0ms

Algorithm
rewrite-expression-head
Counts
4 → 47
Calls

4 calls. Slowest were:

9.0ms
(* (* 1/3 c) (/ -3 (+ (sqrt (+ (* -3 (* c a)) (* b b))) b)))
8.0ms
(+ (* -3 (* c a)) (* b b))
2.0ms
(* -3 (* c a))

series230.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

152.0ms
(* (* 1/3 c) (/ -3 (+ (sqrt (+ (* -3 (* c a)) (* b b))) b)))
49.0ms
(+ (* -3 (* c a)) (* b b))
17.0ms
(* -3 (* c a))
13.0ms
(* 1/3 c)

simplify1.2s

Counts
23 → 59
Calls

23 calls. Slowest were:

641.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))))
147.0ms
(+ (log (* 1/3 c)) (log (/ -3 (+ (sqrt (+ (* -3 (* c a)) (* b b))) b))))
125.0ms
(+ (* (sqrt (+ (* -3 (* c a)) (* b b))) (sqrt (+ (* -3 (* c a)) (* b b)))) (- (* b b) (* (sqrt (+ (* -3 (* c a)) (* b b))) b)))

prune906.0ms

Pruning

8 alts after pruning (8 fresh and 0 done)

Merged error: 0.0b

localize30.0ms

Local error

Found 4 expressions with local error:

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

rewrite19.0ms

Algorithm
rewrite-expression-head
Counts
4 → 65
Calls

4 calls. Slowest were:

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

series294.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

158.0ms
(/ (- c) (+ b (sqrt (+ (* b b) (* -3 (* c a))))))
73.0ms
(+ b (sqrt (+ (* b b) (* -3 (* c a)))))
41.0ms
(+ (* b b) (* -3 (* c a)))
21.0ms
(* -3 (* c a))

simplify1.4s

Counts
48 → 77
Calls

48 calls. Slowest were:

277.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)))))))
163.0ms
(+ (* b b) (- (* (sqrt (+ (* b b) (* -3 (* c a)))) (sqrt (+ (* b b) (* -3 (* c a))))) (* b (sqrt (+ (* b b) (* -3 (* c a)))))))
141.0ms
(- (* 2 b) (* 3/2 (/ (* a c) b)))

prune1.1s

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 0b

regimes285.0ms

Accuracy

0% (0.3b remaining)

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

bsearch3.0ms