Average Error: 52.3 → 0.2
Time: 27.6s
Precision: 64
Internal Precision: 128
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\frac{c \cdot -4}{\frac{\left(\sqrt{\frac{{\left(b \cdot b\right)}^{3} - {\left(\left(a \cdot c\right) \cdot 4\right)}^{3}}{\left(\left(\left(a \cdot c\right) \cdot 4\right) \cdot \left(b \cdot b\right) + \left(\left(a \cdot c\right) \cdot 4\right) \cdot \left(\left(a \cdot c\right) \cdot 4\right)\right) + \left(b \cdot b\right) \cdot \left(b \cdot b\right)}} + b\right) \cdot \left(2 \cdot a\right)}{a}}\]

Error

Bits error versus a

Bits error versus b

Bits error versus c

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 52.3

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

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

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

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

    \[\leadsto \frac{\color{blue}{\left(c \cdot -4\right) \cdot a}}{\left(2 \cdot a\right) \cdot \left(\sqrt{b \cdot b - \left(c \cdot a\right) \cdot 4} + b\right)}\]
  7. Using strategy rm
  8. Applied associate-/l*0.2

    \[\leadsto \color{blue}{\frac{c \cdot -4}{\frac{\left(2 \cdot a\right) \cdot \left(\sqrt{b \cdot b - \left(c \cdot a\right) \cdot 4} + b\right)}{a}}}\]
  9. Using strategy rm
  10. Applied flip3--0.2

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

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

Reproduce

herbie shell --seed 2019002 
(FPCore (a b c)
  :name "Quadratic roots, 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) (* (* 4 a) c)))) (* 2 a)))

Details

Time bar (total: 26.6s)Debug log

sample771.0ms

Algorithm
intervals

simplify79.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

79.0ms
(/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a))

prune26.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 55.4b

localize30.0ms

Local error

Found 4 expressions with local error:

29.8b
(- (sqrt (- (* b b) (* (* c a) 4))) b)
0.1b
(/ (- (sqrt (- (* b b) (* (* c a) 4))) b) (* 2 a))
0.1b
(- (* b b) (* (* c a) 4))
0.0b
(sqrt (- (* b b) (* (* c a) 4)))

rewrite87.0ms

Algorithm
rewrite-expression-head
Counts
4 → 59
Calls

4 calls. Slowest were:

55.0ms
(/ (- (sqrt (- (* b b) (* (* c a) 4))) b) (* 2 a))
20.0ms
(- (sqrt (- (* b b) (* (* c a) 4))) b)
4.0ms
(- (* b b) (* (* c a) 4))

series241.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

98.0ms
(/ (- (sqrt (- (* b b) (* (* c a) 4))) b) (* 2 a))
63.0ms
(- (sqrt (- (* b b) (* (* c a) 4))) b)
41.0ms
(sqrt (- (* b b) (* (* c a) 4)))
39.0ms
(- (* b b) (* (* c a) 4))

simplify2.3s

Counts
32 → 71
Calls

32 calls. Slowest were:

421.0ms
(sqrt (- (pow (* b b) 3) (pow (* (* c a) 4) 3)))
320.0ms
(- (* (sqrt (- (* b b) (* (* c a) 4))) (sqrt (- (* b b) (* (* c a) 4)))) (* b b))
193.0ms
(- (pow (sqrt (- (* b b) (* (* c a) 4))) 3) (pow b 3))

prune659.0ms

Pruning

3 alts after pruning (3 fresh and 0 done)

Merged error: 0.1b

localize24.0ms

Local error

Found 4 expressions with local error:

0.4b
(/ (* (* c -4) a) (* (* 2 a) (+ (sqrt (- (* b b) (* (* c a) 4))) b)))
0.1b
(- (* b b) (* (* c a) 4))
0.1b
(+ (sqrt (- (* b b) (* (* c a) 4))) b)
0.1b
(* (* 2 a) (+ (sqrt (- (* b b) (* (* c a) 4))) b))

rewrite80.0ms

Algorithm
rewrite-expression-head
Counts
4 → 60
Calls

4 calls. Slowest were:

30.0ms
(* (* 2 a) (+ (sqrt (- (* b b) (* (* c a) 4))) b))
28.0ms
(/ (* (* c -4) a) (* (* 2 a) (+ (sqrt (- (* b b) (* (* c a) 4))) b)))
16.0ms
(+ (sqrt (- (* b b) (* (* c a) 4))) b)

series355.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

166.0ms
(/ (* (* c -4) a) (* (* 2 a) (+ (sqrt (- (* b b) (* (* c a) 4))) b)))
102.0ms
(* (* 2 a) (+ (sqrt (- (* b b) (* (* c a) 4))) b))
56.0ms
(+ (sqrt (- (* b b) (* (* c a) 4))) b)
31.0ms
(- (* b b) (* (* c a) 4))

simplify3.8s

Counts
33 → 72
Calls

33 calls. Slowest were:

963.0ms
(/ (* (* (* (* c -4) a) (* (* c -4) a)) (* (* c -4) a)) (* (* (* (* 2 a) (* 2 a)) (* 2 a)) (* (* (+ (sqrt (- (* b b) (* (* c a) 4))) b) (+ (sqrt (- (* b b) (* (* c a) 4))) b)) (+ (sqrt (- (* b b) (* (* c a) 4))) b))))
859.0ms
(/ (* (* (* (* c -4) a) (* (* c -4) a)) (* (* c -4) a)) (* (* (* (* 2 a) (+ (sqrt (- (* b b) (* (* c a) 4))) b)) (* (* 2 a) (+ (sqrt (- (* b b) (* (* c a) 4))) b))) (* (* 2 a) (+ (sqrt (- (* b b) (* (* c a) 4))) b))))
322.0ms
(+ (* (sqrt (- (* b b) (* (* c a) 4))) (sqrt (- (* b b) (* (* c a) 4)))) (- (* b b) (* (sqrt (- (* b b) (* (* c a) 4))) b)))

prune867.0ms

Pruning

7 alts after pruning (7 fresh and 0 done)

Merged error: 0b

localize7.0ms

Local error

Found 4 expressions with local error:

0.1b
(/ (* (* 2 a) (+ (sqrt (- (* b b) (* (* c a) 4))) b)) a)
0.1b
(- (* b b) (* (* c a) 4))
0.1b
(+ (sqrt (- (* b b) (* (* c a) 4))) b)
0.1b
(/ (* c -4) (/ (* (* 2 a) (+ (sqrt (- (* b b) (* (* c a) 4))) b)) a))

rewrite37.0ms

Algorithm
rewrite-expression-head
Counts
4 → 57
Calls

4 calls. Slowest were:

16.0ms
(/ (* (* 2 a) (+ (sqrt (- (* b b) (* (* c a) 4))) b)) a)
9.0ms
(/ (* c -4) (/ (* (* 2 a) (+ (sqrt (- (* b b) (* (* c a) 4))) b)) a))
9.0ms
(+ (sqrt (- (* b b) (* (* c a) 4))) b)

series342.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

158.0ms
(/ (* c -4) (/ (* (* 2 a) (+ (sqrt (- (* b b) (* (* c a) 4))) b)) a))
84.0ms
(/ (* (* 2 a) (+ (sqrt (- (* b b) (* (* c a) 4))) b)) a)
62.0ms
(+ (sqrt (- (* b b) (* (* c a) 4))) b)
38.0ms
(- (* b b) (* (* c a) 4))

simplify5.6s

Counts
30 → 69
Calls

30 calls. Slowest were:

636.0ms
(sqrt (/ (* (* 2 a) (+ (sqrt (- (* b b) (* (* c a) 4))) b)) a))
592.0ms
(cbrt (/ (* (* 2 a) (+ (sqrt (- (* b b) (* (* c a) 4))) b)) a))
560.0ms
(/ (* (* 2 a) (+ (sqrt (- (* b b) (* (* c a) 4))) b)) a)

prune869.0ms

Pruning

6 alts after pruning (6 fresh and 0 done)

Merged error: 0b

localize68.0ms

Local error

Found 4 expressions with local error:

0.7b
(pow (* b b) 3)
0.7b
(pow (* (* c a) 4) 3)
0.5b
(* (* b b) (* b b))
0.5b
(* (* (* c a) 4) (* (* c a) 4))

rewrite25.0ms

Algorithm
rewrite-expression-head
Counts
4 → 65
Calls

4 calls. Slowest were:

11.0ms
(* (* (* c a) 4) (* (* c a) 4))
7.0ms
(* (* b b) (* b b))
4.0ms
(pow (* (* c a) 4) 3)

series82.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

30.0ms
(pow (* (* c a) 4) 3)
19.0ms
(* (* (* c a) 4) (* (* c a) 4))
17.0ms
(pow (* b b) 3)
16.0ms
(* (* b b) (* b b))

simplify2.2s

Counts
37 → 77
Calls

37 calls. Slowest were:

637.0ms
(* (* (* (* (* c a) 4) (* (* c a) 4)) (* (* c a) 4)) (* (* (* (* c a) 4) (* (* c a) 4)) (* (* c a) 4)))
242.0ms
(* (* (* c a) 4) (* (* c a) 4))
213.0ms
(* (* (* c a) 4) (* (* c a) 4))

prune1.5s

Pruning

6 alts after pruning (5 fresh and 1 done)

Merged error: 0b

regimes290.0ms

Accuracy

0% (0.2b remaining)

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

bsearch6.0ms

end0.0ms

sample6.3s

Algorithm
intervals