Average Error: 52.7 → 0.1
Time: 18.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 52.7

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

    \[\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--52.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/52.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.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 2019004 
(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: 17.6s)Debug log

sample196.0ms

Algorithm
intervals

simplify450.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune25.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 50.9b

localize29.0ms

Local error

Found 4 expressions with local error:

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

rewrite42.0ms

Algorithm
rewrite-expression-head
Counts
4 → 53
Calls

4 calls. Slowest were:

20.0ms
(/ (- (sqrt (+ (* -3 (* c a)) (* b b))) b) (* 3 a))
17.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:

71.0ms
(- (sqrt (+ (* -3 (* c a)) (* b b))) b)
59.0ms
(/ (- (sqrt (+ (* -3 (* c a)) (* b b))) b) (* 3 a))
32.0ms
(+ (* -3 (* c a)) (* b b))
20.0ms
(* -3 (* c a))

simplify1.3s

Counts
26 → 65
Calls

26 calls. Slowest were:

672.0ms
(- (* (sqrt (+ (* -3 (* c a)) (* b b))) (sqrt (+ (* -3 (* c a)) (* b b)))) (* b b))
122.0ms
(- (pow (sqrt (+ (* -3 (* c a)) (* b b))) 3) (pow b 3))
89.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)))

prune702.0ms

Pruning

2 alts after pruning (2 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.3b
(* (* 3 a) (+ (sqrt (+ (* -3 (* c a)) (* b b))) b))
0.2b
(* (* a c) -3)
0.2b
(* -3 (* c a))

rewrite40.0ms

Algorithm
rewrite-expression-head
Counts
4 → 56
Calls

4 calls. Slowest were:

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

series261.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

150.0ms
(/ (* (* a c) -3) (* (* 3 a) (+ (sqrt (+ (* -3 (* c a)) (* b b))) b)))
89.0ms
(* (* 3 a) (+ (sqrt (+ (* -3 (* c a)) (* b b))) b))
12.0ms
(* (* a c) -3)
10.0ms
(* -3 (* c a))

simplify3.1s

Counts
32 → 68
Calls

32 calls. Slowest were:

737.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))))
671.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))))
618.0ms
(- (log (* (* a c) -3)) (+ (log (* 3 a)) (log (+ (sqrt (+ (* -3 (* c a)) (* b b))) b))))

prune752.0ms

Pruning

8 alts after pruning (8 fresh and 0 done)

Merged error: 0.0b

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

rewrite28.0ms

Algorithm
rewrite-expression-head
Counts
4 → 46
Calls

4 calls. Slowest were:

15.0ms
(+ (sqrt (+ (* -3 (* c a)) (* b b))) b)
10.0ms
(* (* 1/3 c) (/ -3 (+ (sqrt (+ (* -3 (* c a)) (* b b))) b)))
2.0ms
(* -3 (* c a))

series187.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

123.0ms
(* (* 1/3 c) (/ -3 (+ (sqrt (+ (* -3 (* c a)) (* b b))) b)))
47.0ms
(+ (sqrt (+ (* -3 (* c a)) (* b b))) b)
10.0ms
(* -3 (* c a))
7.0ms
(* 1/3 c)

simplify948.0ms

Counts
22 → 58
Calls

22 calls. Slowest were:

490.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))))
145.0ms
(+ (* (sqrt (+ (* -3 (* c a)) (* b b))) (sqrt (+ (* -3 (* c a)) (* b b)))) (- (* b b) (* (sqrt (+ (* -3 (* c a)) (* b b))) b)))
102.0ms
(+ (log (* 1/3 c)) (log (/ -3 (+ (sqrt (+ (* -3 (* c a)) (* b b))) b))))

prune581.0ms

Pruning

6 alts after pruning (6 fresh and 0 done)

Merged error: 0.0b

localize31.0ms

Local error

Found 4 expressions with local error:

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

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

series282.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

151.0ms
(/ (- c) (+ b (sqrt (+ (* b b) (* -3 (* c a))))))
75.0ms
(+ b (sqrt (+ (* b b) (* -3 (* c a)))))
38.0ms
(+ (* b b) (* -3 (* c a)))
18.0ms
(* -3 (* c a))

simplify1.3s

Counts
48 → 77
Calls

48 calls. Slowest were:

240.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)))))))
152.0ms
(+ (* b b) (- (* (sqrt (+ (* b b) (* -3 (* c a)))) (sqrt (+ (* b b) (* -3 (* c a))))) (* b (sqrt (+ (* b b) (* -3 (* c a)))))))
129.0ms
(- (* 2 b) (* 3/2 (/ (* a c) b)))

prune912.0ms

Pruning

7 alts after pruning (6 fresh and 1 done)

Merged error: 0b

regimes200.0ms

Accuracy

0% (0.1b remaining)

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

bsearch4.0ms

end0.0ms

sample6.0s

Algorithm
intervals