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

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.4
\[\frac{x0 \cdot x1}{1 - x1}\]

Derivation

  1. Initial program 8.4

    \[\frac{x0}{1 - x1} - x0\]
  2. Using strategy rm
  3. Applied flip--7.7

    \[\leadsto \color{blue}{\frac{\frac{x0}{1 - x1} \cdot \frac{x0}{1 - x1} - x0 \cdot x0}{\frac{x0}{1 - x1} + x0}}\]
  4. Using strategy rm
  5. Applied clear-num6.6

    \[\leadsto \frac{\frac{x0}{1 - x1} \cdot \color{blue}{\frac{1}{\frac{1 - x1}{x0}}} - x0 \cdot x0}{\frac{x0}{1 - x1} + x0}\]
  6. Using strategy rm
  7. Applied flip3--6.0

    \[\leadsto \frac{\color{blue}{\frac{{\left(\frac{x0}{1 - x1} \cdot \frac{1}{\frac{1 - x1}{x0}}\right)}^{3} - {\left(x0 \cdot x0\right)}^{3}}{\left(\frac{x0}{1 - x1} \cdot \frac{1}{\frac{1 - x1}{x0}}\right) \cdot \left(\frac{x0}{1 - x1} \cdot \frac{1}{\frac{1 - x1}{x0}}\right) + \left(\left(x0 \cdot x0\right) \cdot \left(x0 \cdot x0\right) + \left(\frac{x0}{1 - x1} \cdot \frac{1}{\frac{1 - x1}{x0}}\right) \cdot \left(x0 \cdot x0\right)\right)}}}{\frac{x0}{1 - x1} + x0}\]
  8. Using strategy rm
  9. Applied flip--5.4

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

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

Reproduce

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

sample2.0ms

Algorithm
sampled
Results
presampled
(pre true 80)
(body real 80)

simplify5.0ms

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

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

series42.0ms

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

simplify713.0ms

Counts
11 → 32
Calls
11 calls:
Slowest
377.0ms
(+ (* x0 (pow x1 3)) (+ (* x0 (pow x1 2)) (* x0 x1)))
81.0ms
(- (+ (/ x0 (pow x1 3)) (+ (/ x0 (pow x1 2)) (/ x0 x1))))
77.0ms
(- (+ (/ x0 (pow x1 3)) (+ (/ x0 (pow x1 2)) (/ x0 x1))))
66.0ms
(- (+ x0 (+ (/ x0 x1) (/ x0 (pow x1 2)))))
45.0ms
(+ x0 (+ (* x0 x1) (* x0 (pow x1 2))))

prune50.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 7.3b

localize1.0ms

Local error

Found 4 expressions with local error:

6.7b
(- (* (/ x0 (- 1 x1)) (/ x0 (- 1 x1))) (* x0 x0))
1.0b
(/ x0 (- 1 x1))
1.0b
(/ x0 (- 1 x1))
1.0b
(/ x0 (- 1 x1))

rewrite12.0ms

Algorithm
rewrite-expression-head
Rules
associate-/r*
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
add-log-exp
associate-/r/
flip--
add-exp-log
add-cbrt-cube
flip3--
pow1
div-inv
frac-2neg
clear-num
difference-of-squares
diff-log
sub-neg
Counts
4 → 58
Calls
4 calls:
Slowest
8.0ms
(- (* (/ x0 (- 1 x1)) (/ x0 (- 1 x1))) (* x0 x0))
1.0ms
(/ x0 (- 1 x1))
1.0ms
(/ x0 (- 1 x1))
1.0ms
(/ x0 (- 1 x1))

series91.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
37.0ms
(- (* (/ x0 (- 1 x1)) (/ x0 (- 1 x1))) (* x0 x0))
21.0ms
(/ x0 (- 1 x1))
17.0ms
(/ x0 (- 1 x1))
15.0ms
(/ x0 (- 1 x1))

simplify1.7s

Counts
30 → 70
Calls
30 calls:
Slowest
464.0ms
(+ (* 2 (* (pow x0 2) x1)) (+ (* 4 (* (pow x0 2) (pow x1 3))) (* 3 (* (pow x0 2) (pow x1 2)))))
212.0ms
(- (+ (/ (pow x0 2) (pow x1 2)) (* 2 (/ (pow x0 2) (pow x1 3)))) (pow x0 2))
208.0ms
(- (+ (/ (pow x0 2) (pow x1 2)) (* 2 (/ (pow x0 2) (pow x1 3)))) (pow x0 2))
114.0ms
(/ (exp (* (/ x0 (- 1 x1)) (/ x0 (- 1 x1)))) (exp (* x0 x0)))
86.0ms
(+ x0 (+ (* x0 x1) (* x0 (pow x1 2))))

prune149.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 6.4b

localize1.0ms

Local error

Found 4 expressions with local error:

6.7b
(- (* (/ x0 (- 1 x1)) (/ 1 (/ (- 1 x1) x0))) (* x0 x0))
1.0b
(/ x0 (- 1 x1))
1.0b
(/ x0 (- 1 x1))
0.5b
(+ (/ x0 (- 1 x1)) x0)

rewrite15.0ms

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

series99.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
45.0ms
(- (* (/ x0 (- 1 x1)) (/ 1 (/ (- 1 x1) x0))) (* x0 x0))
21.0ms
(/ x0 (- 1 x1))
18.0ms
(+ (/ x0 (- 1 x1)) x0)
15.0ms
(/ x0 (- 1 x1))

simplify1.6s

Counts
23 → 64
Calls
23 calls:
Slowest
410.0ms
(+ (* 2 (* (pow x0 2) x1)) (+ (* 4 (* (pow x0 2) (pow x1 3))) (* 3 (* (pow x0 2) (pow x1 2)))))
192.0ms
(- (+ (/ (pow x0 2) (pow x1 2)) (* 2 (/ (pow x0 2) (pow x1 3)))) (pow x0 2))
173.0ms
(- (+ (/ (pow x0 2) (pow x1 2)) (* 2 (/ (pow x0 2) (pow x1 3)))) (pow x0 2))
150.0ms
(/ (exp (* (/ x0 (- 1 x1)) (/ 1 (/ (- 1 x1) x0)))) (exp (* x0 x0)))
108.0ms
(+ (* 2 x0) (+ (* x0 x1) (* x0 (pow x1 2))))

prune158.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 5.8b

localize2.0ms

Local error

Found 4 expressions with local error:

6.1b
(- (pow (* (/ x0 (- 1 x1)) (/ 1 (/ (- 1 x1) x0))) 3) (pow (* x0 x0) 3))
1.0b
(pow (* x0 x0) 3)
1.0b
(/ x0 (- 1 x1))
1.0b
(/ x0 (- 1 x1))

rewrite14.0ms

Algorithm
rewrite-expression-head
Rules
10×add-sqr-sqrt
*-un-lft-identity
add-log-exp
add-cube-cbrt
associate-/r*
add-exp-log
add-cbrt-cube
pow1
associate-/r/
difference-of-squares
flip--
flip3--
div-inv
cube-prod
frac-2neg
pow-pow
unpow-prod-down
clear-num
rem-cube-cbrt
distribute-lft-out--
pow-exp
unpow3
diff-log
sub-neg
difference-cubes
pow-to-exp
cube-mult
pow2
Counts
4 → 63
Calls
4 calls:
Slowest
10.0ms
(- (pow (* (/ x0 (- 1 x1)) (/ 1 (/ (- 1 x1) x0))) 3) (pow (* x0 x0) 3))
1.0ms
(pow (* x0 x0) 3)
1.0ms
(/ x0 (- 1 x1))
1.0ms
(/ x0 (- 1 x1))

series157.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
76.0ms
(- (pow (* (/ x0 (- 1 x1)) (/ 1 (/ (- 1 x1) x0))) 3) (pow (* x0 x0) 3))
32.0ms
(pow (* x0 x0) 3)
25.0ms
(/ x0 (- 1 x1))
24.0ms
(/ x0 (- 1 x1))

simplify4.8s

Counts
37 → 75
Calls
37 calls:
Slowest
669.0ms
(+ (sqrt (pow (* (/ x0 (- 1 x1)) (/ 1 (/ (- 1 x1) x0))) 3)) (pow x0 3))
652.0ms
(+ (* (* (/ x0 (- 1 x1)) (/ 1 (/ (- 1 x1) x0))) (* (/ x0 (- 1 x1)) (/ 1 (/ (- 1 x1) x0)))) (+ (* (* x0 x0) (* x0 x0)) (* (* (/ x0 (- 1 x1)) (/ 1 (/ (- 1 x1) x0))) (* x0 x0))))
478.0ms
(- (pow (* (/ x0 (- 1 x1)) (/ 1 (/ (- 1 x1) x0))) 3) (pow (* x0 x0) 3))
415.0ms
(- (sqrt (pow (* (/ x0 (- 1 x1)) (/ 1 (/ (- 1 x1) x0))) 3)) (pow x0 3))
404.0ms
(- (sqrt (pow (* (/ x0 (- 1 x1)) (/ 1 (/ (- 1 x1) x0))) 3)) (pow x0 3))

prune318.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 5.3b

regimes23.0ms

Accuracy

0% (0.1b remaining)

Error of 5.4b against oracle of 5.3b and baseline of 5.4b

bsearch3.0ms

end0.0ms

sample1.0ms

Algorithm
sampled
Results
presampled
(pre true 80)
(body real 80)