Average Error: 7.9 → 4.7
Time: 12.4s
Precision: 64
Internal Precision: 128
\[\frac{x0}{1 - x1} - x0\]
\[\frac{\log \left(e^{\left(\frac{1}{1 - x1} \cdot x0\right) \cdot \frac{x0}{1 - x1} - x0 \cdot x0}\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

Original7.9
Target0.3
Herbie4.7
\[\frac{x0 \cdot x1}{1 - x1}\]

Derivation

  1. Initial program 7.9

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

    \[\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 div-inv5.6

    \[\leadsto \frac{\frac{x0}{1 - x1} \cdot \color{blue}{\left(x0 \cdot \frac{1}{1 - x1}\right)} - x0 \cdot x0}{\frac{x0}{1 - x1} + x0}\]
  6. Using strategy rm
  7. Applied add-log-exp4.7

    \[\leadsto \frac{\color{blue}{\log \left(e^{\frac{x0}{1 - x1} \cdot \left(x0 \cdot \frac{1}{1 - x1}\right) - x0 \cdot x0}\right)}}{\frac{x0}{1 - x1} + x0}\]
  8. Final simplification4.7

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

Reproduce

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

sample43.0ms

Algorithm
intervals
Results
20.0ms129×pre10240exit
9.0ms256×body80valid
4.0ms127×pre80true

simplify8.0ms

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

prune8.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 7.7b

localize18.0ms

Local error

Found 2 expressions with local error:

7.3b
(- (/ x0 (- 1 x1)) x0)
0.7b
(/ x0 (- 1 x1))

rewrite9.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
7.0ms
(- (/ x0 (- 1 x1)) x0)
1.0ms
(/ x0 (- 1 x1))

series71.0ms

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

simplify658.0ms

Counts
11 → 32
Calls
11 calls:
Slowest
350.0ms
(+ (* x0 (pow x1 3)) (+ (* x0 (pow x1 2)) (* x0 x1)))
67.0ms
(- (+ x0 (+ (/ x0 x1) (/ x0 (pow x1 2)))))
61.0ms
(+ x0 (+ (* x0 x1) (* x0 (pow x1 2))))
57.0ms
(- (+ (/ x0 (pow x1 3)) (+ (/ x0 (pow x1 2)) (/ x0 x1))))
49.0ms
(- (+ (/ x0 (pow x1 3)) (+ (/ x0 (pow x1 2)) (/ x0 x1))))

prune140.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 6.8b

localize13.0ms

Local error

Found 4 expressions with local error:

6.1b
(- (* (/ x0 (- 1 x1)) (/ x0 (- 1 x1))) (* x0 x0))
0.8b
(+ (/ x0 (- 1 x1)) x0)
0.7b
(/ x0 (- 1 x1))
0.7b
(/ x0 (- 1 x1))

rewrite16.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
difference-of-squares
flip-+
diff-log
flip3-+
sub-neg
+-commutative
Counts
4 → 53
Calls
4 calls:
Slowest
8.0ms
(+ (/ x0 (- 1 x1)) x0)
6.0ms
(- (* (/ x0 (- 1 x1)) (/ x0 (- 1 x1))) (* x0 x0))
1.0ms
(/ x0 (- 1 x1))
1.0ms
(/ x0 (- 1 x1))

series102.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
39.0ms
(- (* (/ x0 (- 1 x1)) (/ x0 (- 1 x1))) (* x0 x0))
22.0ms
(+ (/ x0 (- 1 x1)) x0)
21.0ms
(/ x0 (- 1 x1))
20.0ms
(/ x0 (- 1 x1))

simplify1.6s

Counts
25 → 65
Calls
25 calls:
Slowest
440.0ms
(+ (* 2 (* (pow x0 2) x1)) (+ (* 4 (* (pow x0 2) (pow x1 3))) (* 3 (* (pow x0 2) (pow x1 2)))))
194.0ms
(- (+ (/ (pow x0 2) (pow x1 2)) (* 2 (/ (pow x0 2) (pow x1 3)))) (pow x0 2))
194.0ms
(- (+ (/ (pow x0 2) (pow x1 2)) (* 2 (/ (pow x0 2) (pow x1 3)))) (pow x0 2))
127.0ms
(/ (exp (* (/ x0 (- 1 x1)) (/ x0 (- 1 x1)))) (exp (* x0 x0)))
106.0ms
(+ (* 2 x0) (+ (* x0 x1) (* x0 (pow x1 2))))

prune325.0ms

Pruning

3 alts after pruning (3 fresh and 0 done)

Merged error: 4.8b

localize13.0ms

Local error

Found 4 expressions with local error:

6.1b
(- (* (/ x0 (- 1 x1)) (* x0 (/ 1 (- 1 x1)))) (* x0 x0))
0.8b
(+ (/ x0 (- 1 x1)) x0)
0.7b
(/ x0 (- 1 x1))
0.7b
(/ x0 (- 1 x1))

rewrite11.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
6.0ms
(- (* (/ x0 (- 1 x1)) (* x0 (/ 1 (- 1 x1)))) (* x0 x0))
3.0ms
(+ (/ x0 (- 1 x1)) x0)
0.0ms
(/ x0 (- 1 x1))
0.0ms
(/ x0 (- 1 x1))

series96.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
40.0ms
(- (* (/ x0 (- 1 x1)) (* x0 (/ 1 (- 1 x1)))) (* x0 x0))
23.0ms
(/ x0 (- 1 x1))
17.0ms
(+ (/ x0 (- 1 x1)) x0)
15.0ms
(/ x0 (- 1 x1))

simplify1.7s

Counts
23 → 64
Calls
23 calls:
Slowest
477.0ms
(+ (* 2 (* (pow x0 2) x1)) (+ (* 4 (* (pow x0 2) (pow x1 3))) (* 3 (* (pow x0 2) (pow x1 2)))))
222.0ms
(/ (exp (* (/ x0 (- 1 x1)) (* x0 (/ 1 (- 1 x1))))) (exp (* x0 x0)))
206.0ms
(- (+ (/ (pow x0 2) (pow x1 2)) (* 2 (/ (pow x0 2) (pow x1 3)))) (pow x0 2))
205.0ms
(- (+ (/ (pow x0 2) (pow x1 2)) (* 2 (/ (pow x0 2) (pow x1 3)))) (pow x0 2))
85.0ms
(+ x0 (+ (* x0 x1) (* x0 (pow x1 2))))

prune317.0ms

Pruning

3 alts after pruning (3 fresh and 0 done)

Merged error: 4.0b

localize10.0ms

Local error

Found 4 expressions with local error:

6.1b
(- (* (/ x0 (- 1 x1)) (* x0 (/ 1 (- 1 x1)))) (* x0 x0))
3.7b
(log (exp (- (* (/ x0 (- 1 x1)) (* x0 (/ 1 (- 1 x1)))) (* x0 x0))))
0.8b
(+ (/ x0 (- 1 x1)) x0)
0.7b
(/ x0 (- 1 x1))

rewrite27.0ms

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

series121.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
48.0ms
(- (* (/ x0 (- 1 x1)) (* x0 (/ 1 (- 1 x1)))) (* x0 x0))
36.0ms
(log (exp (- (* (/ x0 (- 1 x1)) (* x0 (/ 1 (- 1 x1)))) (* x0 x0))))
21.0ms
(+ (/ x0 (- 1 x1)) x0)
14.0ms
(/ x0 (- 1 x1))

simplify4.7s

Counts
28 → 67
Calls
28 calls:
Slowest
474.0ms
(- (+ (/ (pow x0 2) (pow x1 2)) (* 2 (/ (pow x0 2) (pow x1 3)))) (pow x0 2))
418.0ms
(+ (* 2 (* (pow x0 2) x1)) (+ (* 4 (* (pow x0 2) (pow x1 3))) (* 3 (* (pow x0 2) (pow x1 2)))))
406.0ms
(log (exp (* (/ x0 (- 1 x1)) (* x0 (/ 1 (- 1 x1))))))
400.0ms
(+ (* 2 (* (pow x0 2) x1)) (+ (* 4 (* (pow x0 2) (pow x1 3))) (* 3 (* (pow x0 2) (pow x1 2)))))
367.0ms
(log (exp (* (/ x0 (- 1 x1)) (* x0 (/ 1 (- 1 x1))))))

prune408.0ms

Pruning

4 alts after pruning (3 fresh and 1 done)

Merged error: 3.9b

regimes98.0ms

Accuracy

0% (0.7b remaining)

Error of 4.7b against oracle of 4.0b and baseline of 4.7b

bsearch3.0ms

end0.0ms

sample1.4s

Algorithm
intervals
Results
834.0ms3936×pre10240exit
345.0ms8000×body80valid
132.0ms4064×pre80true