Average Error: 28.4 → 0.3
Time: 17.2s
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(-3 \cdot \left(a \cdot c\right)\right)}^{3} + {\left(b \cdot b\right)}^{3}}{\left(\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \left(-3 \cdot \left(a \cdot c\right)\right) - \left(b \cdot b\right) \cdot \left(-3 \cdot \left(a \cdot c\right)\right)\right) + \left(b \cdot b\right) \cdot \left(b \cdot b\right)}} + 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.4

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

    \[\leadsto \color{blue}{\frac{\sqrt{-3 \cdot \left(c \cdot a\right) + b \cdot b} - b}{3 \cdot a}}\]
  3. Using strategy rm
  4. Applied flip--28.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/28.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.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 flip3-+0.3

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

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

Reproduce

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

sample186.0ms

Algorithm
intervals

simplify46.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune18.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 27.4b

localize26.0ms

Local error

Found 4 expressions with local error:

27.3b
(- (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))

rewrite49.0ms

Algorithm
rewrite-expression-head
Counts
4 → 53
Calls

4 calls. Slowest were:

23.0ms
(/ (- (sqrt (+ (* -3 (* c a)) (* b b))) b) (* 3 a))
22.0ms
(- (sqrt (+ (* -3 (* c a)) (* b b))) b)
3.0ms
(+ (* -3 (* c a)) (* b b))

series184.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

64.0ms
(/ (- (sqrt (+ (* -3 (* c a)) (* b b))) b) (* 3 a))
55.0ms
(+ (* -3 (* c a)) (* b b))
52.0ms
(- (sqrt (+ (* -3 (* c a)) (* b b))) b)
13.0ms
(* -3 (* c a))

simplify1.1s

Counts
26 → 65
Calls

26 calls. Slowest were:

587.0ms
(- (* (sqrt (+ (* -3 (* c a)) (* b b))) (sqrt (+ (* -3 (* c a)) (* b b)))) (* b b))
101.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)))
58.0ms
(- (pow (sqrt (+ (* -3 (* c a)) (* b b))) 3) (pow b 3))

prune605.0ms

Pruning

5 alts after pruning (5 fresh and 0 done)

Merged error: 0.6b

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

rewrite37.0ms

Algorithm
rewrite-expression-head
Counts
4 → 56
Calls

4 calls. Slowest were:

19.0ms
(* (* 3 a) (+ (sqrt (+ (* -3 (* c a)) (* b b))) b))
12.0ms
(/ (* (* a c) -3) (* (* 3 a) (+ (sqrt (+ (* -3 (* c a)) (* b b))) b)))
4.0ms
(* (* a c) -3)

series291.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

149.0ms
(/ (* (* a c) -3) (* (* 3 a) (+ (sqrt (+ (* -3 (* c a)) (* b b))) b)))
119.0ms
(* (* 3 a) (+ (sqrt (+ (* -3 (* c a)) (* b b))) b))
13.0ms
(* -3 (* c a))
11.0ms
(* (* a c) -3)

simplify3.1s

Counts
32 → 68
Calls

32 calls. Slowest were:

698.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))))
647.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))))
568.0ms
(- (log (* (* a c) -3)) (+ (log (* 3 a)) (log (+ (sqrt (+ (* -3 (* c a)) (* b b))) b))))

prune904.0ms

Pruning

11 alts after pruning (11 fresh and 0 done)

Merged error: 0.0b

localize11.0ms

Local error

Found 4 expressions with local error:

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

rewrite18.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)))
5.0ms
(+ (* -3 (* c a)) (* b b))
2.0ms
(* -3 (* c a))

series233.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

179.0ms
(* (* 1/3 c) (/ -3 (+ (sqrt (+ (* -3 (* c a)) (* b b))) b)))
35.0ms
(+ (* -3 (* c a)) (* b b))
10.0ms
(* -3 (* c a))
8.0ms
(* 1/3 c)

simplify1.1s

Counts
23 → 59
Calls

23 calls. Slowest were:

527.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))))
128.0ms
(+ (* (sqrt (+ (* -3 (* c a)) (* b b))) (sqrt (+ (* -3 (* c a)) (* b b)))) (- (* b b) (* (sqrt (+ (* -3 (* c a)) (* b b))) b)))
110.0ms
(+ (log (* 1/3 c)) (log (/ -3 (+ (sqrt (+ (* -3 (* c a)) (* b b))) b))))

prune735.0ms

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 0b

localize16.0ms

Local error

Found 4 expressions with local error:

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

rewrite12.0ms

Algorithm
rewrite-expression-head
Counts
4 → 65
Calls

4 calls. Slowest were:

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

series217.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

132.0ms
(/ (- c) (+ b (sqrt (+ (* b b) (* -3 (* c a))))))
46.0ms
(+ b (sqrt (+ (* b b) (* -3 (* c a)))))
27.0ms
(+ (* b b) (* -3 (* c a)))
11.0ms
(* -3 (* c a))

simplify1.3s

Counts
48 → 77
Calls

48 calls. Slowest were:

318.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)))))))
119.0ms
(+ (* b b) (- (* (sqrt (+ (* b b) (* -3 (* c a)))) (sqrt (+ (* b b) (* -3 (* c a))))) (* b (sqrt (+ (* b b) (* -3 (* c a)))))))
110.0ms
(- (* 2 b) (* 3/2 (/ (* a c) b)))

prune831.0ms

Pruning

8 alts after pruning (8 fresh and 0 done)

Merged error: 0b

regimes276.0ms

Accuracy

0% (0.3b remaining)

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

bsearch3.0ms

end0.0ms

sample4.5s

Algorithm
intervals