Average Error: 7.9 → 4.7
Time: 10.2s
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 +o rules:numerics
(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: 9.8s)Debug log

sample53.0ms

Algorithm
intervals
Results
24.0ms129×pre10240exit
11.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

localize15.0ms

Local error

Found 2 expressions with local error:

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

rewrite6.0ms

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

series49.0ms

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

simplify1.3s

Counts
15 → 42
Calls
15 calls:
Slowest
883.0ms
(+ (* x0 (pow x1 3)) (+ (* x0 (pow x1 2)) (* x0 x1)))
151.0ms
(+ x0 (+ (* x0 x1) (* x0 (pow x1 2))))
81.0ms
(- (+ (/ x0 (pow x1 3)) (+ (/ x0 (pow x1 2)) (/ x0 x1))))
64.0ms
(- (+ (/ x0 (pow x1 3)) (+ (/ x0 (pow x1 2)) (/ x0 x1))))
50.0ms
(- (+ x0 (+ (/ x0 x1) (/ x0 (pow x1 2)))))

prune179.0ms

Pruning

3 alts after pruning (3 fresh and 0 done)

Merged error: 6.4b

localize15.0ms

Local error

Found 1 expressions with local error:

7.1b
(fma x0 (/ 1 (- 1 x1)) (- x0))

rewrite1.0ms

Algorithm
rewrite-expression-head
Rules
add-log-exp
log1p-expm1-u
fma-udef
add-cube-cbrt
add-exp-log
add-cbrt-cube
*-un-lft-identity
pow1
expm1-log1p-u
add-sqr-sqrt
Counts
1 → 10
Calls
1 calls:
Slowest
0.0ms
(fma x0 (/ 1 (- 1 x1)) (- x0))

series36.0ms

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

simplify986.0ms

Counts
3 → 13
Calls
3 calls:
Slowest
903.0ms
(+ (* x0 (pow x1 3)) (+ (* x0 (pow x1 2)) (* x0 x1)))
46.0ms
(- (+ x0 (+ (/ x0 x1) (/ x0 (pow x1 2)))))
37.0ms
(- (+ x0 (+ (/ x0 x1) (/ x0 (pow x1 2)))))

prune102.0ms

Pruning

3 alts after pruning (3 fresh and 0 done)

Merged error: 6.3b

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

rewrite19.0ms

Algorithm
rewrite-expression-head
Rules
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
add-log-exp
associate-/r/
fma-def
associate-/r*
flip--
log1p-expm1-u
add-exp-log
add-cbrt-cube
flip3--
pow1
expm1-log1p-u
div-inv
frac-2neg
clear-num
difference-of-squares
flip-+
prod-diff
diff-log
fma-neg
flip3-+
sub-neg
+-commutative
Counts
4 → 69
Calls
4 calls:
Slowest
10.0ms
(- (* (/ x0 (- 1 x1)) (/ x0 (- 1 x1))) (* x0 x0))
6.0ms
(+ (/ x0 (- 1 x1)) x0)
1.0ms
(/ x0 (- 1 x1))
1.0ms
(/ x0 (- 1 x1))

series112.0ms

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

simplify1.8s

Counts
32 → 81
Calls
32 calls:
Slowest
205.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))
187.0ms
(/ (exp (* (/ x0 (- 1 x1)) (/ x0 (- 1 x1)))) (exp (* x0 x0)))
180.0ms
(+ (* 2 x0) (+ (* x0 x1) (* x0 (pow x1 2))))
167.0ms
(+ x0 (+ (* x0 x1) (* x0 (pow x1 2))))

prune371.0ms

Pruning

3 alts after pruning (3 fresh and 0 done)

Merged error: 4.7b

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

rewrite26.0ms

Algorithm
rewrite-expression-head
Rules
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
add-log-exp
associate-/r/
fma-def
associate-/r*
flip--
log1p-expm1-u
add-exp-log
add-cbrt-cube
flip3--
pow1
expm1-log1p-u
div-inv
frac-2neg
clear-num
flip-+
prod-diff
diff-log
fma-neg
flip3-+
sub-neg
+-commutative
Counts
4 → 68
Calls
4 calls:
Slowest
14.0ms
(- (* (/ x0 (- 1 x1)) (* x0 (/ 1 (- 1 x1)))) (* x0 x0))
7.0ms
(+ (/ x0 (- 1 x1)) x0)
1.0ms
(/ x0 (- 1 x1))
1.0ms
(/ x0 (- 1 x1))

series112.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
50.0ms
(- (* (/ x0 (- 1 x1)) (* x0 (/ 1 (- 1 x1)))) (* x0 x0))
28.0ms
(+ (/ x0 (- 1 x1)) x0)
19.0ms
(/ x0 (- 1 x1))
15.0ms
(/ x0 (- 1 x1))

simplify2.1s

Counts
30 → 80
Calls
30 calls:
Slowest
343.0ms
(/ (exp (* (/ x0 (- 1 x1)) (* x0 (/ 1 (- 1 x1))))) (exp (* x0 x0)))
274.0ms
(fma (/ x0 (- 1 x1)) (* x0 (/ 1 (- 1 x1))) (- (* x0 x0)))
265.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))
180.0ms
(+ (* 2 (* (pow x0 2) x1)) (+ (* 4 (* (pow x0 2) (pow x1 3))) (* 3 (* (pow x0 2) (pow x1 2)))))

prune325.0ms

Pruning

3 alts after pruning (3 fresh and 0 done)

Merged error: 3.9b

regimes77.0ms

Accuracy

0% (0.7b remaining)

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

bsearch2.0ms

end0.0ms

sample2.1s

Algorithm
intervals
Results
1.0s3936×pre10240exit
776.0ms8000×body80valid
145.0ms4064×pre80true