Average Error: 8.4 → 5.4
Time: 7.3s
Precision: 64
Internal Precision: 128
\[\frac{x0}{1 - x1} - x0\]
\[\frac{\frac{\frac{{\left(\left(\sqrt{\frac{x0}{1 - x1}} \cdot \sqrt{\frac{x0}{1 - x1}}\right) \cdot \frac{x0}{1 - x1}\right)}^{3} \cdot {\left(\left(\sqrt{\frac{x0}{1 - x1}} \cdot \sqrt{\frac{x0}{1 - x1}}\right) \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(\left(\sqrt{\frac{x0}{1 - x1}} \cdot \sqrt{\frac{x0}{1 - x1}}\right) \cdot \frac{x0}{1 - x1}\right)}^{3}}}{\left(\left(\sqrt{\frac{x0}{1 - x1}} \cdot \sqrt{\frac{x0}{1 - x1}}\right) \cdot \frac{x0}{1 - x1}\right) \cdot \left(\left(\sqrt{\frac{x0}{1 - x1}} \cdot \sqrt{\frac{x0}{1 - x1}}\right) \cdot \frac{x0}{1 - x1}\right) + \left(\left(x0 \cdot x0\right) \cdot \left(\left(\sqrt{\frac{x0}{1 - x1}} \cdot \sqrt{\frac{x0}{1 - x1}}\right) \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 add-sqr-sqrt6.6

    \[\leadsto \frac{\frac{x0}{1 - x1} \cdot \color{blue}{\left(\sqrt{\frac{x0}{1 - x1}} \cdot \sqrt{\frac{x0}{1 - x1}}\right)} - 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 \left(\sqrt{\frac{x0}{1 - x1}} \cdot \sqrt{\frac{x0}{1 - x1}}\right)\right)}^{3} - {\left(x0 \cdot x0\right)}^{3}}{\left(\frac{x0}{1 - x1} \cdot \left(\sqrt{\frac{x0}{1 - x1}} \cdot \sqrt{\frac{x0}{1 - x1}}\right)\right) \cdot \left(\frac{x0}{1 - x1} \cdot \left(\sqrt{\frac{x0}{1 - x1}} \cdot \sqrt{\frac{x0}{1 - x1}}\right)\right) + \left(\left(x0 \cdot x0\right) \cdot \left(x0 \cdot x0\right) + \left(\frac{x0}{1 - x1} \cdot \left(\sqrt{\frac{x0}{1 - x1}} \cdot \sqrt{\frac{x0}{1 - x1}}\right)\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 \left(\sqrt{\frac{x0}{1 - x1}} \cdot \sqrt{\frac{x0}{1 - x1}}\right)\right)}^{3} \cdot {\left(\frac{x0}{1 - x1} \cdot \left(\sqrt{\frac{x0}{1 - x1}} \cdot \sqrt{\frac{x0}{1 - x1}}\right)\right)}^{3} - {\left(x0 \cdot x0\right)}^{3} \cdot {\left(x0 \cdot x0\right)}^{3}}{{\left(\frac{x0}{1 - x1} \cdot \left(\sqrt{\frac{x0}{1 - x1}} \cdot \sqrt{\frac{x0}{1 - x1}}\right)\right)}^{3} + {\left(x0 \cdot x0\right)}^{3}}}}{\left(\frac{x0}{1 - x1} \cdot \left(\sqrt{\frac{x0}{1 - x1}} \cdot \sqrt{\frac{x0}{1 - x1}}\right)\right) \cdot \left(\frac{x0}{1 - x1} \cdot \left(\sqrt{\frac{x0}{1 - x1}} \cdot \sqrt{\frac{x0}{1 - x1}}\right)\right) + \left(\left(x0 \cdot x0\right) \cdot \left(x0 \cdot x0\right) + \left(\frac{x0}{1 - x1} \cdot \left(\sqrt{\frac{x0}{1 - x1}} \cdot \sqrt{\frac{x0}{1 - x1}}\right)\right) \cdot \left(x0 \cdot x0\right)\right)}}{\frac{x0}{1 - x1} + x0}\]
  10. Final simplification5.4

    \[\leadsto \frac{\frac{\frac{{\left(\left(\sqrt{\frac{x0}{1 - x1}} \cdot \sqrt{\frac{x0}{1 - x1}}\right) \cdot \frac{x0}{1 - x1}\right)}^{3} \cdot {\left(\left(\sqrt{\frac{x0}{1 - x1}} \cdot \sqrt{\frac{x0}{1 - x1}}\right) \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(\left(\sqrt{\frac{x0}{1 - x1}} \cdot \sqrt{\frac{x0}{1 - x1}}\right) \cdot \frac{x0}{1 - x1}\right)}^{3}}}{\left(\left(\sqrt{\frac{x0}{1 - x1}} \cdot \sqrt{\frac{x0}{1 - x1}}\right) \cdot \frac{x0}{1 - x1}\right) \cdot \left(\left(\sqrt{\frac{x0}{1 - x1}} \cdot \sqrt{\frac{x0}{1 - x1}}\right) \cdot \frac{x0}{1 - x1}\right) + \left(\left(x0 \cdot x0\right) \cdot \left(\left(\sqrt{\frac{x0}{1 - x1}} \cdot \sqrt{\frac{x0}{1 - x1}}\right) \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 2019007 
(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: 7.3s)Debug log

sample2.0ms

Algorithm
sampled

simplify5.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

5.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
Counts
2 → 26
Calls

2 calls. Slowest were:

4.0ms
(- (/ x0 (- 1 x1)) x0)
0.0ms
(/ x0 (- 1 x1))

series37.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

23.0ms
(- (/ x0 (- 1 x1)) x0)
14.0ms
(/ x0 (- 1 x1))

simplify637.0ms

Counts
11 → 32
Calls

11 calls. Slowest were:

330.0ms
(+ (* x0 (pow x1 3)) (+ (* x0 (pow x1 2)) (* x0 x1)))
69.0ms
(- (+ (/ x0 (pow x1 3)) (+ (/ x0 (pow x1 2)) (/ x0 x1))))
66.0ms
(- (+ (/ x0 (pow x1 3)) (+ (/ x0 (pow x1 2)) (/ x0 x1))))

prune34.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 7.3b

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

rewrite7.0ms

Algorithm
rewrite-expression-head
Counts
4 → 58
Calls

4 calls. Slowest were:

5.0ms
(- (* (/ x0 (- 1 x1)) (/ x0 (- 1 x1))) (* x0 x0))
0.0ms
(/ x0 (- 1 x1))
0.0ms
(/ x0 (- 1 x1))

series97.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

34.0ms
(- (* (/ x0 (- 1 x1)) (/ x0 (- 1 x1))) (* x0 x0))
24.0ms
(/ x0 (- 1 x1))
23.0ms
(/ x0 (- 1 x1))
15.0ms
(/ x0 (- 1 x1))

simplify1.5s

Counts
30 → 70
Calls

30 calls. Slowest were:

384.0ms
(+ (* 2 (* (pow x0 2) x1)) (+ (* 4 (* (pow x0 2) (pow x1 3))) (* 3 (* (pow x0 2) (pow x1 2)))))
190.0ms
(- (+ (/ (pow x0 2) (pow x1 2)) (* 2 (/ (pow x0 2) (pow x1 3)))) (pow x0 2))
187.0ms
(- (+ (/ (pow x0 2) (pow x1 2)) (* 2 (/ (pow x0 2) (pow x1 3)))) (pow x0 2))

prune110.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 6.4b

localize0.0ms

Local error

Found 4 expressions with local error:

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

rewrite20.0ms

Algorithm
rewrite-expression-head
Counts
4 → 57
Calls

4 calls. Slowest were:

18.0ms
(- (* (/ x0 (- 1 x1)) (* (sqrt (/ x0 (- 1 x1))) (sqrt (/ x0 (- 1 x1))))) (* x0 x0))
0.0ms
(/ x0 (- 1 x1))
0.0ms
(/ x0 (- 1 x1))

series109.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

62.0ms
(- (* (/ x0 (- 1 x1)) (* (sqrt (/ x0 (- 1 x1))) (sqrt (/ x0 (- 1 x1))))) (* x0 x0))
17.0ms
(/ x0 (- 1 x1))
15.0ms
(/ x0 (- 1 x1))
15.0ms
(/ x0 (- 1 x1))

simplify1.4s

Counts
28 → 69
Calls

28 calls. Slowest were:

395.0ms
(+ (* 2 (* (pow x0 2) x1)) (+ (* 4 (* (pow x0 2) (pow x1 3))) (* 3 (* (pow x0 2) (pow x1 2)))))
190.0ms
(- (+ (/ (pow x0 2) (pow x1 2)) (* 2 (/ (pow x0 2) (pow x1 3)))) (pow x0 2))
157.0ms
(/ (exp (* (/ x0 (- 1 x1)) (* (sqrt (/ x0 (- 1 x1))) (sqrt (/ x0 (- 1 x1)))))) (exp (* x0 x0)))

prune127.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 6.0b

localize1.0ms

Local error

Found 4 expressions with local error:

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

rewrite17.0ms

Algorithm
rewrite-expression-head
Counts
4 → 63
Calls

4 calls. Slowest were:

13.0ms
(- (pow (* (/ x0 (- 1 x1)) (* (sqrt (/ x0 (- 1 x1))) (sqrt (/ x0 (- 1 x1))))) 3) (pow (* x0 x0) 3))
1.0ms
(pow (* x0 x0) 3)
1.0ms
(/ x0 (- 1 x1))

series129.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

73.0ms
(- (pow (* (/ x0 (- 1 x1)) (* (sqrt (/ x0 (- 1 x1))) (sqrt (/ x0 (- 1 x1))))) 3) (pow (* x0 x0) 3))
25.0ms
(pow (* x0 x0) 3)
17.0ms
(/ x0 (- 1 x1))
14.0ms
(/ x0 (- 1 x1))

simplify2.7s

Counts
37 → 75
Calls

37 calls. Slowest were:

233.0ms
(- (pow (* (/ x0 (- 1 x1)) (* (sqrt (/ x0 (- 1 x1))) (sqrt (/ x0 (- 1 x1))))) 3) (pow (* x0 x0) 3))
227.0ms
(+ (sqrt (pow (* (/ x0 (- 1 x1)) (* (sqrt (/ x0 (- 1 x1))) (sqrt (/ x0 (- 1 x1))))) 3)) (pow x0 3))
221.0ms
(- (sqrt (pow (* (/ x0 (- 1 x1)) (* (sqrt (/ x0 (- 1 x1))) (sqrt (/ x0 (- 1 x1))))) 3)) (pow x0 3))

prune296.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 5.3b

regimes40.0ms

Accuracy

0% (0.1b remaining)

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

bsearch7.0ms

end0.0ms

sample2.0ms

Algorithm
sampled