Average Error: 8.3 → 3.3
Time: 4.5s
Precision: binary64
\[x0 = 1.855 \land x1 = 0.000209 \lor x0 = 2.985 \land x1 = 0.0186\]
\[\frac{x0}{1 - x1} - x0\]
\[\begin{array}{l} \mathbf{if}\;1 - x1 \leq 0.9814:\\ \;\;\;\;\frac{x0 \cdot \log \left(e^{\frac{x0}{1 + x1 \cdot \left(x1 + -2\right)} - x0}\right)}{x0 + \sqrt{\frac{x0}{1 - x1}} \cdot \sqrt{\frac{x0}{1 - x1}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x0 \cdot \left(\log \left(\sqrt[3]{e^{\frac{x0}{1 + x1 \cdot \left(x1 + -2\right)} - x0}}\right) + \log \left(\sqrt[3]{e^{\frac{x0}{1 + x1 \cdot \left(x1 + -2\right)} - x0}}\right) \cdot 2\right)}{x0 + \frac{x0}{1 - x1}}\\ \end{array}\]
\frac{x0}{1 - x1} - x0
\begin{array}{l}
\mathbf{if}\;1 - x1 \leq 0.9814:\\
\;\;\;\;\frac{x0 \cdot \log \left(e^{\frac{x0}{1 + x1 \cdot \left(x1 + -2\right)} - x0}\right)}{x0 + \sqrt{\frac{x0}{1 - x1}} \cdot \sqrt{\frac{x0}{1 - x1}}}\\

\mathbf{else}:\\
\;\;\;\;\frac{x0 \cdot \left(\log \left(\sqrt[3]{e^{\frac{x0}{1 + x1 \cdot \left(x1 + -2\right)} - x0}}\right) + \log \left(\sqrt[3]{e^{\frac{x0}{1 + x1 \cdot \left(x1 + -2\right)} - x0}}\right) \cdot 2\right)}{x0 + \frac{x0}{1 - x1}}\\

\end{array}
(FPCore (x0 x1) :precision binary64 (- (/ x0 (- 1.0 x1)) x0))
(FPCore (x0 x1)
 :precision binary64
 (if (<= (- 1.0 x1) 0.9814)
   (/
    (* x0 (log (exp (- (/ x0 (+ 1.0 (* x1 (+ x1 -2.0)))) x0))))
    (+ x0 (* (sqrt (/ x0 (- 1.0 x1))) (sqrt (/ x0 (- 1.0 x1))))))
   (/
    (*
     x0
     (+
      (log (cbrt (exp (- (/ x0 (+ 1.0 (* x1 (+ x1 -2.0)))) x0))))
      (* (log (cbrt (exp (- (/ x0 (+ 1.0 (* x1 (+ x1 -2.0)))) x0)))) 2.0)))
    (+ x0 (/ x0 (- 1.0 x1))))))
double code(double x0, double x1) {
	return (x0 / (1.0 - x1)) - x0;
}
double code(double x0, double x1) {
	double tmp;
	if ((1.0 - x1) <= 0.9814) {
		tmp = (x0 * log(exp((x0 / (1.0 + (x1 * (x1 + -2.0)))) - x0))) / (x0 + (sqrt(x0 / (1.0 - x1)) * sqrt(x0 / (1.0 - x1))));
	} else {
		tmp = (x0 * (log(cbrt(exp((x0 / (1.0 + (x1 * (x1 + -2.0)))) - x0))) + (log(cbrt(exp((x0 / (1.0 + (x1 * (x1 + -2.0)))) - x0))) * 2.0))) / (x0 + (x0 / (1.0 - x1)));
	}
	return tmp;
}

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.3
Target0.5
Herbie3.3
\[\frac{x0 \cdot x1}{1 - x1}\]

Derivation

  1. Split input into 2 regimes
  2. if (-.f64 1 x1) < 0.98140000000000005

    1. Initial program 5.5

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

      \[\leadsto \color{blue}{\frac{\frac{x0}{1 - x1} \cdot \frac{x0}{1 - x1} - x0 \cdot x0}{\frac{x0}{1 - x1} + x0}}\]
    4. Simplified4.7

      \[\leadsto \frac{\color{blue}{x0 \cdot \left(\frac{x0}{\left(1 - x1\right) \cdot \left(1 - x1\right)} - x0\right)}}{\frac{x0}{1 - x1} + x0}\]
    5. Simplified4.7

      \[\leadsto \frac{x0 \cdot \left(\frac{x0}{\left(1 - x1\right) \cdot \left(1 - x1\right)} - x0\right)}{\color{blue}{x0 + \frac{x0}{1 - x1}}}\]
    6. Taylor expanded around 0 2.8

      \[\leadsto \frac{x0 \cdot \left(\frac{x0}{\color{blue}{\left(1 + {x1}^{2}\right) - 2 \cdot x1}} - x0\right)}{x0 + \frac{x0}{1 - x1}}\]
    7. Simplified2.8

      \[\leadsto \frac{x0 \cdot \left(\frac{x0}{\color{blue}{1 + x1 \cdot \left(x1 + -2\right)}} - x0\right)}{x0 + \frac{x0}{1 - x1}}\]
    8. Using strategy rm
    9. Applied add-log-exp_binary64_42092.8

      \[\leadsto \frac{x0 \cdot \left(\frac{x0}{1 + x1 \cdot \left(x1 + -2\right)} - \color{blue}{\log \left(e^{x0}\right)}\right)}{x0 + \frac{x0}{1 - x1}}\]
    10. Applied add-log-exp_binary64_42092.8

      \[\leadsto \frac{x0 \cdot \left(\color{blue}{\log \left(e^{\frac{x0}{1 + x1 \cdot \left(x1 + -2\right)}}\right)} - \log \left(e^{x0}\right)\right)}{x0 + \frac{x0}{1 - x1}}\]
    11. Applied diff-log_binary64_42623.9

      \[\leadsto \frac{x0 \cdot \color{blue}{\log \left(\frac{e^{\frac{x0}{1 + x1 \cdot \left(x1 + -2\right)}}}{e^{x0}}\right)}}{x0 + \frac{x0}{1 - x1}}\]
    12. Simplified1.0

      \[\leadsto \frac{x0 \cdot \log \color{blue}{\left(e^{\frac{x0}{1 + x1 \cdot \left(x1 + -2\right)} - x0}\right)}}{x0 + \frac{x0}{1 - x1}}\]
    13. Using strategy rm
    14. Applied add-sqr-sqrt_binary64_41920

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

    if 0.98140000000000005 < (-.f64 1 x1)

    1. Initial program 11.3

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

      \[\leadsto \color{blue}{\frac{\frac{x0}{1 - x1} \cdot \frac{x0}{1 - x1} - x0 \cdot x0}{\frac{x0}{1 - x1} + x0}}\]
    4. Simplified9.1

      \[\leadsto \frac{\color{blue}{x0 \cdot \left(\frac{x0}{\left(1 - x1\right) \cdot \left(1 - x1\right)} - x0\right)}}{\frac{x0}{1 - x1} + x0}\]
    5. Simplified9.1

      \[\leadsto \frac{x0 \cdot \left(\frac{x0}{\left(1 - x1\right) \cdot \left(1 - x1\right)} - x0\right)}{\color{blue}{x0 + \frac{x0}{1 - x1}}}\]
    6. Taylor expanded around 0 11.3

      \[\leadsto \frac{x0 \cdot \left(\frac{x0}{\color{blue}{\left(1 + {x1}^{2}\right) - 2 \cdot x1}} - x0\right)}{x0 + \frac{x0}{1 - x1}}\]
    7. Simplified9.1

      \[\leadsto \frac{x0 \cdot \left(\frac{x0}{\color{blue}{1 + x1 \cdot \left(x1 + -2\right)}} - x0\right)}{x0 + \frac{x0}{1 - x1}}\]
    8. Using strategy rm
    9. Applied add-log-exp_binary64_42099.1

      \[\leadsto \frac{x0 \cdot \left(\frac{x0}{1 + x1 \cdot \left(x1 + -2\right)} - \color{blue}{\log \left(e^{x0}\right)}\right)}{x0 + \frac{x0}{1 - x1}}\]
    10. Applied add-log-exp_binary64_42099.1

      \[\leadsto \frac{x0 \cdot \left(\color{blue}{\log \left(e^{\frac{x0}{1 + x1 \cdot \left(x1 + -2\right)}}\right)} - \log \left(e^{x0}\right)\right)}{x0 + \frac{x0}{1 - x1}}\]
    11. Applied diff-log_binary64_42628.9

      \[\leadsto \frac{x0 \cdot \color{blue}{\log \left(\frac{e^{\frac{x0}{1 + x1 \cdot \left(x1 + -2\right)}}}{e^{x0}}\right)}}{x0 + \frac{x0}{1 - x1}}\]
    12. Simplified8.9

      \[\leadsto \frac{x0 \cdot \log \color{blue}{\left(e^{\frac{x0}{1 + x1 \cdot \left(x1 + -2\right)} - x0}\right)}}{x0 + \frac{x0}{1 - x1}}\]
    13. Using strategy rm
    14. Applied add-cube-cbrt_binary64_420510.6

      \[\leadsto \frac{x0 \cdot \log \color{blue}{\left(\left(\sqrt[3]{e^{\frac{x0}{1 + x1 \cdot \left(x1 + -2\right)} - x0}} \cdot \sqrt[3]{e^{\frac{x0}{1 + x1 \cdot \left(x1 + -2\right)} - x0}}\right) \cdot \sqrt[3]{e^{\frac{x0}{1 + x1 \cdot \left(x1 + -2\right)} - x0}}\right)}}{x0 + \frac{x0}{1 - x1}}\]
    15. Applied log-prod_binary64_42569.9

      \[\leadsto \frac{x0 \cdot \color{blue}{\left(\log \left(\sqrt[3]{e^{\frac{x0}{1 + x1 \cdot \left(x1 + -2\right)} - x0}} \cdot \sqrt[3]{e^{\frac{x0}{1 + x1 \cdot \left(x1 + -2\right)} - x0}}\right) + \log \left(\sqrt[3]{e^{\frac{x0}{1 + x1 \cdot \left(x1 + -2\right)} - x0}}\right)\right)}}{x0 + \frac{x0}{1 - x1}}\]
    16. Simplified6.6

      \[\leadsto \frac{x0 \cdot \left(\color{blue}{\log \left(\sqrt[3]{e^{\frac{x0}{1 + x1 \cdot \left(x1 + -2\right)} - x0}}\right) \cdot 2} + \log \left(\sqrt[3]{e^{\frac{x0}{1 + x1 \cdot \left(x1 + -2\right)} - x0}}\right)\right)}{x0 + \frac{x0}{1 - x1}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification3.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;1 - x1 \leq 0.9814:\\ \;\;\;\;\frac{x0 \cdot \log \left(e^{\frac{x0}{1 + x1 \cdot \left(x1 + -2\right)} - x0}\right)}{x0 + \sqrt{\frac{x0}{1 - x1}} \cdot \sqrt{\frac{x0}{1 - x1}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x0 \cdot \left(\log \left(\sqrt[3]{e^{\frac{x0}{1 + x1 \cdot \left(x1 + -2\right)} - x0}}\right) + \log \left(\sqrt[3]{e^{\frac{x0}{1 + x1 \cdot \left(x1 + -2\right)} - x0}}\right) \cdot 2\right)}{x0 + \frac{x0}{1 - x1}}\\ \end{array}\]

Reproduce

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

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

  (- (/ x0 (- 1.0 x1)) x0))