Average Error: 8.4 → 5.1
Time: 34.5s
Precision: 64
Internal Precision: 128
\[\frac{x0}{1 - x1} - x0\]
\[\frac{\sqrt[3]{{\left(\frac{x0}{1 - x1}\right)}^{3} + \left(-x0\right) \cdot \left(x0 \cdot x0\right)}}{\frac{x0}{1 - x1} \cdot \frac{x0}{1 - x1} + \left(x0 + \frac{x0}{1 - x1}\right) \cdot x0} \cdot \left(\sqrt[3]{{\left(\frac{1}{\frac{1 - x1}{x0}}\right)}^{3} - {x0}^{3}} \cdot \sqrt[3]{{\left(\frac{1}{\frac{1 - x1}{x0}}\right)}^{3} - {x0}^{3}}\right)\]

Error

Bits error versus x0

Bits error versus x1

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original8.4
Target0.5
Herbie5.1
\[\frac{x0 \cdot x1}{1 - x1}\]

Derivation

  1. Initial program 8.4

    \[\frac{x0}{1 - x1} - x0\]
  2. Using strategy rm
  3. Applied clear-num7.5

    \[\leadsto \color{blue}{\frac{1}{\frac{1 - x1}{x0}}} - x0\]
  4. Using strategy rm
  5. Applied flip3--7.6

    \[\leadsto \color{blue}{\frac{{\left(\frac{1}{\frac{1 - x1}{x0}}\right)}^{3} - {x0}^{3}}{\frac{1}{\frac{1 - x1}{x0}} \cdot \frac{1}{\frac{1 - x1}{x0}} + \left(x0 \cdot x0 + \frac{1}{\frac{1 - x1}{x0}} \cdot x0\right)}}\]
  6. Using strategy rm
  7. Applied *-un-lft-identity7.6

    \[\leadsto \frac{{\left(\frac{1}{\frac{1 - x1}{x0}}\right)}^{3} - {x0}^{3}}{\color{blue}{1 \cdot \left(\frac{1}{\frac{1 - x1}{x0}} \cdot \frac{1}{\frac{1 - x1}{x0}} + \left(x0 \cdot x0 + \frac{1}{\frac{1 - x1}{x0}} \cdot x0\right)\right)}}\]
  8. Applied add-cube-cbrt7.5

    \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{{\left(\frac{1}{\frac{1 - x1}{x0}}\right)}^{3} - {x0}^{3}} \cdot \sqrt[3]{{\left(\frac{1}{\frac{1 - x1}{x0}}\right)}^{3} - {x0}^{3}}\right) \cdot \sqrt[3]{{\left(\frac{1}{\frac{1 - x1}{x0}}\right)}^{3} - {x0}^{3}}}}{1 \cdot \left(\frac{1}{\frac{1 - x1}{x0}} \cdot \frac{1}{\frac{1 - x1}{x0}} + \left(x0 \cdot x0 + \frac{1}{\frac{1 - x1}{x0}} \cdot x0\right)\right)}\]
  9. Applied times-frac7.5

    \[\leadsto \color{blue}{\frac{\sqrt[3]{{\left(\frac{1}{\frac{1 - x1}{x0}}\right)}^{3} - {x0}^{3}} \cdot \sqrt[3]{{\left(\frac{1}{\frac{1 - x1}{x0}}\right)}^{3} - {x0}^{3}}}{1} \cdot \frac{\sqrt[3]{{\left(\frac{1}{\frac{1 - x1}{x0}}\right)}^{3} - {x0}^{3}}}{\frac{1}{\frac{1 - x1}{x0}} \cdot \frac{1}{\frac{1 - x1}{x0}} + \left(x0 \cdot x0 + \frac{1}{\frac{1 - x1}{x0}} \cdot x0\right)}}\]
  10. Simplified5.1

    \[\leadsto \frac{\sqrt[3]{{\left(\frac{1}{\frac{1 - x1}{x0}}\right)}^{3} - {x0}^{3}} \cdot \sqrt[3]{{\left(\frac{1}{\frac{1 - x1}{x0}}\right)}^{3} - {x0}^{3}}}{1} \cdot \color{blue}{\frac{\sqrt[3]{{\left(\frac{x0}{1 - x1}\right)}^{3} + \left(-x0\right) \cdot \left(x0 \cdot x0\right)}}{\frac{x0}{1 - x1} \cdot \frac{x0}{1 - x1} + x0 \cdot \left(x0 + \frac{x0}{1 - x1}\right)}}\]
  11. Final simplification5.1

    \[\leadsto \frac{\sqrt[3]{{\left(\frac{x0}{1 - x1}\right)}^{3} + \left(-x0\right) \cdot \left(x0 \cdot x0\right)}}{\frac{x0}{1 - x1} \cdot \frac{x0}{1 - x1} + \left(x0 + \frac{x0}{1 - x1}\right) \cdot x0} \cdot \left(\sqrt[3]{{\left(\frac{1}{\frac{1 - x1}{x0}}\right)}^{3} - {x0}^{3}} \cdot \sqrt[3]{{\left(\frac{1}{\frac{1 - x1}{x0}}\right)}^{3} - {x0}^{3}}\right)\]

Reproduce

herbie shell --seed 2019010 
(FPCore (x0 x1)
  :name "(- (/ x0 (- 1 x1)) x0)"
  :pre (or (and (== x0 1.855) (== x1 0.000209)) (and (== x0 2.985) (== x1 0.0186)))

  :herbie-target
  (/ (* x0 x1) (- 1 x1))

  (- (/ x0 (- 1 x1)) x0))

Details

Time bar (total: 34.4s)Debug log

sample3.0ms

Algorithm
sampled

simplify4.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
4.0ms
(- (/ x0 (- 1 x1)) x0)

prune1.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 8.4b

localize0.0ms

Local error

Found 2 expressions with local error:

7.5b
(- (/ x0 (- 1 x1)) x0)
1.0b
(/ x0 (- 1 x1))

rewrite5.0ms

Algorithm
rewrite-expression-head
Rules
add-cube-cbrt
*-un-lft-identity
associate-/r*
add-sqr-sqrt
add-log-exp
flip--
associate-/r/
add-exp-log
add-cbrt-cube
flip3--
pow1
div-inv
frac-2neg
sub-neg
clear-num
Counts
2 → 26
Calls
2 calls:
Slowest
4.0ms
(- (/ x0 (- 1 x1)) x0)
0.0ms
(/ x0 (- 1 x1))

series39.0ms

Counts
2 → 6
Calls
2 calls:
Slowest
21.0ms
(- (/ x0 (- 1 x1)) x0)
18.0ms
(/ x0 (- 1 x1))

simplify785.0ms

Counts
11 → 32
Calls
11 calls:
Slowest
384.0ms
(+ (* x0 (pow x1 3)) (+ (* x0 (pow x1 2)) (* x0 x1)))
91.0ms
(+ x0 (+ (* x0 x1) (* x0 (pow x1 2))))
83.0ms
(- (+ (/ x0 (pow x1 3)) (+ (/ x0 (pow x1 2)) (/ x0 x1))))
70.0ms
(- (+ x0 (+ (/ x0 x1) (/ x0 (pow x1 2)))))
69.0ms
(- (+ x0 (+ (/ x0 x1) (/ x0 (pow x1 2)))))

prune38.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 7.3b

localize0.0ms

Local error

Found 1 expressions with local error:

7.5b
(- (/ 1 (/ (- 1 x1) x0)) x0)

rewrite6.0ms

Algorithm
rewrite-expression-head
Rules
add-log-exp
flip--
add-cube-cbrt
add-exp-log
add-cbrt-cube
flip3--
*-un-lft-identity
sub-neg
pow1
add-sqr-sqrt
Counts
1 → 11
Calls
1 calls:
Slowest
6.0ms
(- (/ 1 (/ (- 1 x1) x0)) x0)

series24.0ms

Counts
1 → 3
Calls
1 calls:
Slowest
24.0ms
(- (/ 1 (/ (- 1 x1) x0)) x0)

simplify458.0ms

Counts
3 → 14
Calls
3 calls:
Slowest
329.0ms
(+ (* x0 (pow x1 3)) (+ (* x0 (pow x1 2)) (* x0 x1)))
71.0ms
(- (+ x0 (+ (/ x0 x1) (/ x0 (pow x1 2)))))
57.0ms
(- (+ x0 (+ (/ x0 x1) (/ x0 (pow x1 2)))))

prune21.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 7.1b

localize1.0ms

Local error

Found 4 expressions with local error:

5.4b
(- (pow (/ 1 (/ (- 1 x1) x0)) 3) (pow x0 3))
1.3b
(pow (/ 1 (/ (- 1 x1) x0)) 3)
0.5b
(/ (- (pow (/ 1 (/ (- 1 x1) x0)) 3) (pow x0 3)) (+ (* (/ 1 (/ (- 1 x1) x0)) (/ 1 (/ (- 1 x1) x0))) (+ (* x0 x0) (* (/ 1 (/ (- 1 x1) x0)) x0))))
0.5b
(* (/ 1 (/ (- 1 x1) x0)) (/ 1 (/ (- 1 x1) x0)))

rewrite54.0ms

Algorithm
rewrite-expression-head
Rules
53×add-sqr-sqrt
43×*-un-lft-identity
30×times-frac
24×associate-/r/
23×add-cube-cbrt
17×pow1
16×add-exp-log
15×difference-of-squares
15×cube-prod
15×unpow-prod-down
10×associate-/l*
10×distribute-rgt-out--
add-cbrt-cube
frac-add
inv-pow
pow-flip
add-log-exp
distribute-lft-out--
div-inv
flip-+
pow-prod-up
associate-*l*
associate-*r*
flip3-+
rec-exp
difference-cubes
prod-exp
un-div-inv
associate-*r/
associate-*l/
pow-prod-down
pow-pow
associate-/r*
frac-times
associate-/l/
flip--
pow-exp
flip3--
rem-cube-cbrt
cbrt-unprod
*-commutative
div-exp
div-sub
unpow3
diff-log
pow-plus
frac-2neg
sub-neg
clear-num
cbrt-undiv
pow-to-exp
cube-mult
pow2
cube-div
Counts
4 → 151
Calls
4 calls:
Slowest
32.0ms
(/ (- (pow (/ 1 (/ (- 1 x1) x0)) 3) (pow x0 3)) (+ (* (/ 1 (/ (- 1 x1) x0)) (/ 1 (/ (- 1 x1) x0))) (+ (* x0 x0) (* (/ 1 (/ (- 1 x1) x0)) x0))))
9.0ms
(* (/ 1 (/ (- 1 x1) x0)) (/ 1 (/ (- 1 x1) x0)))
7.0ms
(- (pow (/ 1 (/ (- 1 x1) x0)) 3) (pow x0 3))
1.0ms
(pow (/ 1 (/ (- 1 x1) x0)) 3)

series178.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
69.0ms
(/ (- (pow (/ 1 (/ (- 1 x1) x0)) 3) (pow x0 3)) (+ (* (/ 1 (/ (- 1 x1) x0)) (/ 1 (/ (- 1 x1) x0))) (+ (* x0 x0) (* (/ 1 (/ (- 1 x1) x0)) x0))))
57.0ms
(- (pow (/ 1 (/ (- 1 x1) x0)) 3) (pow x0 3))
31.0ms
(pow (/ 1 (/ (- 1 x1) x0)) 3)
21.0ms
(* (/ 1 (/ (- 1 x1) x0)) (/ 1 (/ (- 1 x1) x0)))

simplify25.5s

Counts
161 → 163
Calls
161 calls:
Slowest
637.0ms
(/ (- (/ 1 (/ (- 1 x1) x0)) x0) (+ (* (/ 1 (/ (- 1 x1) x0)) (/ 1 (/ (- 1 x1) x0))) (+ (* x0 x0) (* (/ 1 (/ (- 1 x1) x0)) x0))))
587.0ms
(- (+ (/ (pow x0 3) (pow x1 3)) (+ (* 3 (/ (pow x0 3) (pow x1 4))) (pow x0 3))))
506.0ms
(- (pow (/ 1 (- 1 x1)) 3) 1)
503.0ms
(/ (- (pow (/ 1 (- 1 x1)) 3) 1) (sqrt (+ (* (/ 1 (/ (- 1 x1) x0)) (/ 1 (/ (- 1 x1) x0))) (+ (* x0 x0) (* (/ 1 (/ (- 1 x1) x0)) x0)))))
449.0ms
(/ (- (pow (/ 1 (- 1 x1)) 3) 1) (cbrt (+ (* (/ 1 (/ (- 1 x1) x0)) (/ 1 (/ (- 1 x1) x0))) (+ (* x0 x0) (* (/ 1 (/ (- 1 x1) x0)) x0)))))

prune552.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 5.1b

localize2.0ms

Local error

Found 4 expressions with local error:

5.4b
(- (pow (/ 1 (/ (- 1 x1) x0)) 3) (pow x0 3))
5.4b
(- (pow (/ 1 (/ (- 1 x1) x0)) 3) (pow x0 3))
5.4b
(+ (pow (/ x0 (- 1 x1)) 3) (* (- x0) (* x0 x0)))
1.3b
(pow (/ x0 (- 1 x1)) 3)

rewrite33.0ms

Algorithm
rewrite-expression-head
Rules
18×add-sqr-sqrt
14×*-un-lft-identity
10×add-log-exp
10×cube-prod
10×unpow-prod-down
associate-/r/
difference-of-squares
add-cube-cbrt
add-exp-log
add-cbrt-cube
pow1
flip--
distribute-rgt-out--
flip3--
distribute-lft-out--
div-inv
diff-log
sub-neg
difference-cubes
distribute-lft-neg-out
rem-cube-cbrt
flip-+
pow-exp
unsub-neg
unpow3
flip3-+
pow-pow
sum-log
+-commutative
pow-to-exp
cube-mult
cube-div
Counts
4 → 77
Calls
4 calls:
Slowest
13.0ms
(- (pow (/ 1 (/ (- 1 x1) x0)) 3) (pow x0 3))
10.0ms
(+ (pow (/ x0 (- 1 x1)) 3) (* (- x0) (* x0 x0)))
8.0ms
(- (pow (/ 1 (/ (- 1 x1) x0)) 3) (pow x0 3))
1.0ms
(pow (/ x0 (- 1 x1)) 3)

series188.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
57.0ms
(- (pow (/ 1 (/ (- 1 x1) x0)) 3) (pow x0 3))
50.0ms
(- (pow (/ 1 (/ (- 1 x1) x0)) 3) (pow x0 3))
47.0ms
(+ (pow (/ x0 (- 1 x1)) 3) (* (- x0) (* x0 x0)))
33.0ms
(pow (/ x0 (- 1 x1)) 3)

simplify5.6s

Counts
59 → 89
Calls
59 calls:
Slowest
348.0ms
(+ (* (/ 1 (/ (- 1 x1) x0)) (/ 1 (/ (- 1 x1) x0))) (+ (* x0 x0) (* (/ 1 (/ (- 1 x1) x0)) x0)))
339.0ms
(+ (* (/ 1 (/ (- 1 x1) x0)) (/ 1 (/ (- 1 x1) x0))) (+ (* x0 x0) (* (/ 1 (/ (- 1 x1) x0)) x0)))
267.0ms
(- (+ (/ (pow x0 3) (pow x1 3)) (+ (* 3 (/ (pow x0 3) (pow x1 4))) (pow x0 3))))
260.0ms
(- (+ (/ (pow x0 3) (pow x1 3)) (+ (* 3 (/ (pow x0 3) (pow x1 4))) (pow x0 3))))
254.0ms
(+ (* 3 (* (pow x0 3) x1)) (+ (* 6 (* (pow x0 3) (pow x1 2))) (pow x0 3)))

prune804.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 4.8b

regimes22.0ms

Accuracy

0% (0.3b remaining)

Error of 5.1b against oracle of 4.8b and baseline of 5.1b

bsearch10.0ms

end0.0ms

sample2.0ms

Algorithm
sampled