Average Error: 44.0 → 0.2
Time: 25.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}{\left(-b\right) - \sqrt{\frac{{\left(b \cdot b\right)}^{3} - {\left(\left(a \cdot 3\right) \cdot c\right)}^{3}}{\left(b \cdot b\right) \cdot \left(b \cdot b\right) + \left(\left(\left(a \cdot 3\right) \cdot c\right) \cdot \left(\left(a \cdot 3\right) \cdot c\right) + \left(\left(a \cdot 3\right) \cdot c\right) \cdot \left(b \cdot b\right)\right)}}}\]

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 44.0

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

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

    \[\leadsto \color{blue}{\frac{\left(-b\right) \cdot \left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{\left(3 \cdot a\right) \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}}\]
  5. Simplified0.5

    \[\leadsto \frac{\color{blue}{3 \cdot \left(c \cdot a\right)}}{\left(3 \cdot a\right) \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}\]
  6. Using strategy rm
  7. Applied times-frac0.5

    \[\leadsto \color{blue}{\frac{3}{3 \cdot a} \cdot \frac{c \cdot a}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}\]
  8. Simplified0.5

    \[\leadsto \color{blue}{\frac{1}{a}} \cdot \frac{c \cdot a}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}\]
  9. Using strategy rm
  10. Applied pow10.5

    \[\leadsto \frac{1}{a} \cdot \color{blue}{{\left(\frac{c \cdot a}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}\right)}^{1}}\]
  11. Applied pow10.5

    \[\leadsto \color{blue}{{\left(\frac{1}{a}\right)}^{1}} \cdot {\left(\frac{c \cdot a}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}\right)}^{1}\]
  12. Applied pow-prod-down0.5

    \[\leadsto \color{blue}{{\left(\frac{1}{a} \cdot \frac{c \cdot a}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}\right)}^{1}}\]
  13. Simplified0.2

    \[\leadsto {\color{blue}{\left(\frac{c}{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)}}\right)}}^{1}\]
  14. Using strategy rm
  15. Applied flip3--0.2

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

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

Reproduce

herbie shell --seed 2019016 
(FPCore (a b c d)
  :name "Cubic critical, medium range"
  :pre (and (< 1.1102230246251565e-16 a 9007199254740992.0) (< 1.1102230246251565e-16 b 9007199254740992.0) (< 1.1102230246251565e-16 c 9007199254740992.0))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))

Details

Time bar (total: 23.7s)Debug log

sample173.0ms

Algorithm
intervals
Results
554×(pre true 80)
297×(body nan 80)
159×(body real 160)
54×(body real 80)
44×(body real 320)

simplify75.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
75.0ms
(/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a))

prune19.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 44.6b

localize43.0ms

Local error

Found 4 expressions with local error:

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

rewrite41.0ms

Algorithm
rewrite-expression-head
Rules
12×*-un-lft-identity
add-log-exp
add-cube-cbrt
add-exp-log
add-cbrt-cube
add-sqr-sqrt
associate-/l*
times-frac
pow1
distribute-lft-out
associate-/l/
flip-+
associate-+l-
flip3-+
neg-sub0
flip--
div-inv
*-commutative
associate-*l*
div-exp
div-sub
diff-log
flip3--
frac-2neg
sub-neg
sum-log
associate-/r*
clear-num
+-commutative
cbrt-undiv
Counts
4 → 58
Calls
4 calls:
Slowest
25.0ms
(/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a))
11.0ms
(+ (- b) (sqrt (- (* b b) (* (* 3 a) c))))
2.0ms
(* (* 3 a) c)
2.0ms
(- (* b b) (* (* 3 a) c))

series172.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
76.0ms
(/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a))
46.0ms
(+ (- b) (sqrt (- (* b b) (* (* 3 a) c))))
31.0ms
(- (* b b) (* (* 3 a) c))
18.0ms
(* (* 3 a) c)

simplify1.7s

Counts
30 → 70
Calls
30 calls:
Slowest
300.0ms
(+ (pow (- b) 3) (pow (sqrt (- (* b b) (* (* 3 a) c))) 3))
245.0ms
(- (* (- b) (- b)) (* (sqrt (- (* b b) (* (* 3 a) c))) (sqrt (- (* b b) (* (* 3 a) c)))))
162.0ms
(/ (* (* (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (+ (- b) (sqrt (- (* b b) (* (* 3 a) c))))) (+ (- b) (sqrt (- (* b b) (* (* 3 a) c))))) (* (* (* 3 a) (* 3 a)) (* 3 a)))
88.0ms
(- (* 3/2 (/ (* a c) b)) (* 2 b))
78.0ms
(- (log (+ (- b) (sqrt (- (* b b) (* (* 3 a) c))))) (log (* 3 a)))

prune743.0ms

Pruning

5 alts after pruning (5 fresh and 0 done)

Merged error: 0.2b

localize14.0ms

Local error

Found 4 expressions with local error:

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

rewrite26.0ms

Algorithm
rewrite-expression-head
Rules
11×add-exp-log
11×add-cbrt-cube
add-sqr-sqrt
associate-*r*
*-un-lft-identity
pow1
add-cube-cbrt
add-log-exp
associate-*r/
*-commutative
difference-of-squares
flip--
cbrt-unprod
associate-/r/
prod-exp
associate-*l*
div-exp
flip3--
distribute-lft-in
sub-neg
cbrt-undiv
distribute-rgt-in
distribute-lft-out--
associate-/l*
div-inv
sqrt-prod
pow-prod-down
times-frac
frac-2neg
associate-/r*
clear-num
Counts
4 → 61
Calls
4 calls:
Slowest
12.0ms
(* (* 3 a) (- (- b) (sqrt (- (* b b) (* (* 3 a) c)))))
11.0ms
(/ (* 3 (* c a)) (* (* 3 a) (- (- b) (sqrt (- (* b b) (* (* 3 a) c))))))
2.0ms
(* (* 3 a) c)
1.0ms
(* 3 (* c a))

series697.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
563.0ms
(/ (* 3 (* c a)) (* (* 3 a) (- (- b) (sqrt (- (* b b) (* (* 3 a) c))))))
99.0ms
(* (* 3 a) (- (- b) (sqrt (- (* b b) (* (* 3 a) c)))))
22.0ms
(* (* 3 a) c)
13.0ms
(* 3 (* c a))

simplify5.9s

Counts
36 → 73
Calls
36 calls:
Slowest
1.9s
(/ (* (* (* 3 (* c a)) (* 3 (* c a))) (* 3 (* c a))) (* (* (* (* 3 a) (* 3 a)) (* 3 a)) (* (* (- (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (- (- b) (sqrt (- (* b b) (* (* 3 a) c))))) (- (- b) (sqrt (- (* b b) (* (* 3 a) c)))))))
1.7s
(/ (* (* (* 3 (* c a)) (* 3 (* c a))) (* 3 (* c a))) (* (* (* (* 3 a) (- (- b) (sqrt (- (* b b) (* (* 3 a) c))))) (* (* 3 a) (- (- b) (sqrt (- (* b b) (* (* 3 a) c)))))) (* (* 3 a) (- (- b) (sqrt (- (* b b) (* (* 3 a) c)))))))
514.0ms
(+ (* (- b) (- b)) (+ (* (sqrt (- (* b b) (* (* 3 a) c))) (sqrt (- (* b b) (* (* 3 a) c)))) (* (- b) (sqrt (- (* b b) (* (* 3 a) c))))))
413.0ms
(+ (* (- b) (- b)) (+ (* (sqrt (- (* b b) (* (* 3 a) c))) (sqrt (- (* b b) (* (* 3 a) c)))) (* (- b) (sqrt (- (* b b) (* (* 3 a) c))))))
190.0ms
(* (* 3 a) (- (- b) (sqrt (- (* b b) (* (* 3 a) c)))))

prune797.0ms

Pruning

10 alts after pruning (10 fresh and 0 done)

Merged error: 0.0b

localize17.0ms

Local error

Found 4 expressions with local error:

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

rewrite49.0ms

Algorithm
rewrite-expression-head
Rules
25×add-sqr-sqrt
17×*-un-lft-identity
12×associate-*r*
12×times-frac
11×add-exp-log
11×add-cbrt-cube
add-cube-cbrt
difference-of-squares
add-log-exp
associate-/r*
pow1
associate-*l*
distribute-lft-out--
sqrt-prod
associate-/r/
flip--
div-inv
flip3--
cbrt-unprod
*-commutative
prod-exp
div-exp
cbrt-undiv
associate-/l*
associate-*r/
associate-*l/
pow-prod-down
diff-log
frac-2neg
sub-neg
clear-num
frac-times
neg-sub0
associate--l-
Counts
4 → 84
Calls
4 calls:
Slowest
24.0ms
(* (/ 1 a) (/ (* c a) (- (- b) (sqrt (- (* b b) (* (* 3 a) c))))))
17.0ms
(/ (* c a) (- (- b) (sqrt (- (* b b) (* (* 3 a) c)))))
5.0ms
(- (- b) (sqrt (- (* b b) (* (* 3 a) c))))
2.0ms
(* (* 3 a) c)

series336.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
129.0ms
(/ (* c a) (- (- b) (sqrt (- (* b b) (* (* 3 a) c)))))
125.0ms
(* (/ 1 a) (/ (* c a) (- (- b) (sqrt (- (* b b) (* (* 3 a) c))))))
66.0ms
(- (- b) (sqrt (- (* b b) (* (* 3 a) c))))
16.0ms
(* (* 3 a) c)

simplify4.4s

Counts
63 → 96
Calls
63 calls:
Slowest
419.0ms
(+ (* (- b) (- b)) (+ (* (sqrt (- (* b b) (* (* 3 a) c))) (sqrt (- (* b b) (* (* 3 a) c)))) (* (- b) (sqrt (- (* b b) (* (* 3 a) c))))))
379.0ms
(+ (* (- b) (- b)) (+ (* (sqrt (- (* b b) (* (* 3 a) c))) (sqrt (- (* b b) (* (* 3 a) c)))) (* (- b) (sqrt (- (* b b) (* (* 3 a) c))))))
376.0ms
(+ (log (/ 1 a)) (- (log (* c a)) (log (- (- b) (sqrt (- (* b b) (* (* 3 a) c)))))))
353.0ms
(* (/ 1 a) (/ (* c a) (- (- b) (sqrt (- (* b b) (* (* 3 a) c))))))
264.0ms
(+ (log (/ 1 a)) (log (/ (* c a) (- (- b) (sqrt (- (* b b) (* (* 3 a) c)))))))

prune1.0s

Pruning

8 alts after pruning (7 fresh and 1 done)

Merged error: 0b

localize16.0ms

Local error

Found 4 expressions with local error:

0.3b
(* c (* 3 a))
0.1b
(/ c (- (- b) (sqrt (- (* b b) (* c (* 3 a))))))
0.1b
(- (- b) (sqrt (- (* b b) (* c (* 3 a)))))
0.1b
(- (* b b) (* c (* 3 a)))

rewrite13.0ms

Algorithm
rewrite-expression-head
Rules
13×add-sqr-sqrt
*-un-lft-identity
add-log-exp
associate-/r*
add-cube-cbrt
difference-of-squares
add-exp-log
add-cbrt-cube
pow1
flip--
flip3--
distribute-lft-out--
sqrt-prod
associate-/r/
diff-log
sub-neg
div-inv
*-commutative
associate-*r*
frac-2neg
clear-num
neg-sub0
associate--l-
Counts
4 → 55
Calls
4 calls:
Slowest
5.0ms
(- (- b) (sqrt (- (* b b) (* c (* 3 a)))))
4.0ms
(/ c (- (- b) (sqrt (- (* b b) (* c (* 3 a))))))
2.0ms
(- (* b b) (* c (* 3 a)))
1.0ms
(* c (* 3 a))

series280.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
156.0ms
(/ c (- (- b) (sqrt (- (* b b) (* c (* 3 a))))))
72.0ms
(- (- b) (sqrt (- (* b b) (* c (* 3 a)))))
41.0ms
(- (* b b) (* c (* 3 a)))
11.0ms
(* c (* 3 a))

simplify1.2s

Counts
27 → 67
Calls
27 calls:
Slowest
400.0ms
(+ (* (- b) (- b)) (+ (* (sqrt (- (* b b) (* c (* 3 a)))) (sqrt (- (* b b) (* c (* 3 a))))) (* (- b) (sqrt (- (* b b) (* c (* 3 a)))))))
71.0ms
(/ (exp (* b b)) (exp (* c (* 3 a))))
67.0ms
(- (* 3/2 (/ (* a c) b)) (* 2 b))
58.0ms
(- (sqrt (- b)) (sqrt (sqrt (- (* b b) (* c (* 3 a))))))
55.0ms
(- (- b) (sqrt (- (* b b) (* c (* 3 a)))))

prune781.0ms

Pruning

7 alts after pruning (6 fresh and 1 done)

Merged error: 0b

regimes297.0ms

Accuracy

0% (0.2b remaining)

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

bsearch3.0ms

end0.0ms

sample4.9s

Algorithm
intervals
Results
16309×(pre true 80)
8309×(body nan 80)
4795×(body real 160)
1796×(body real 80)
1409×(body real 320)