Average Error: 21.9 → 0.4
Time: 14.9s
Precision: binary64
Cost: 21000
\[1 - \frac{\left(1 - x\right) \cdot y}{y + 1} \]
\[\begin{array}{l} \mathbf{if}\;y \leq -53455814794.271835:\\ \;\;\;\;x + \frac{{y}^{-2} + -1}{\frac{y}{x + -1} \cdot \left(1 + \frac{1}{y}\right)}\\ \mathbf{elif}\;y \leq 1.0120801136950827 \cdot 10^{-5}:\\ \;\;\;\;\mathsf{fma}\left(\frac{1 - x}{y + 1}, -y, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{x}{{y}^{2}} + \left(\frac{1 - x}{y} + \left(x + \frac{1 - x}{{y}^{3}}\right)\right)\right) + \frac{-1}{{y}^{2}}\\ \end{array} \]
(FPCore (x y) :precision binary64 (- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0))))
(FPCore (x y)
 :precision binary64
 (if (<= y -53455814794.271835)
   (+ x (/ (+ (pow y -2.0) -1.0) (* (/ y (+ x -1.0)) (+ 1.0 (/ 1.0 y)))))
   (if (<= y 1.0120801136950827e-5)
     (fma (/ (- 1.0 x) (+ y 1.0)) (- y) 1.0)
     (+
      (+ (/ x (pow y 2.0)) (+ (/ (- 1.0 x) y) (+ x (/ (- 1.0 x) (pow y 3.0)))))
      (/ -1.0 (pow y 2.0))))))
double code(double x, double y) {
	return 1.0 - (((1.0 - x) * y) / (y + 1.0));
}
double code(double x, double y) {
	double tmp;
	if (y <= -53455814794.271835) {
		tmp = x + ((pow(y, -2.0) + -1.0) / ((y / (x + -1.0)) * (1.0 + (1.0 / y))));
	} else if (y <= 1.0120801136950827e-5) {
		tmp = fma(((1.0 - x) / (y + 1.0)), -y, 1.0);
	} else {
		tmp = ((x / pow(y, 2.0)) + (((1.0 - x) / y) + (x + ((1.0 - x) / pow(y, 3.0))))) + (-1.0 / pow(y, 2.0));
	}
	return tmp;
}
function code(x, y)
	return Float64(1.0 - Float64(Float64(Float64(1.0 - x) * y) / Float64(y + 1.0)))
end
function code(x, y)
	tmp = 0.0
	if (y <= -53455814794.271835)
		tmp = Float64(x + Float64(Float64((y ^ -2.0) + -1.0) / Float64(Float64(y / Float64(x + -1.0)) * Float64(1.0 + Float64(1.0 / y)))));
	elseif (y <= 1.0120801136950827e-5)
		tmp = fma(Float64(Float64(1.0 - x) / Float64(y + 1.0)), Float64(-y), 1.0);
	else
		tmp = Float64(Float64(Float64(x / (y ^ 2.0)) + Float64(Float64(Float64(1.0 - x) / y) + Float64(x + Float64(Float64(1.0 - x) / (y ^ 3.0))))) + Float64(-1.0 / (y ^ 2.0)));
	end
	return tmp
end
code[x_, y_] := N[(1.0 - N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_] := If[LessEqual[y, -53455814794.271835], N[(x + N[(N[(N[Power[y, -2.0], $MachinePrecision] + -1.0), $MachinePrecision] / N[(N[(y / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(1.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.0120801136950827e-5], N[(N[(N[(1.0 - x), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] * (-y) + 1.0), $MachinePrecision], N[(N[(N[(x / N[Power[y, 2.0], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(1.0 - x), $MachinePrecision] / y), $MachinePrecision] + N[(x + N[(N[(1.0 - x), $MachinePrecision] / N[Power[y, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Power[y, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
1 - \frac{\left(1 - x\right) \cdot y}{y + 1}
\begin{array}{l}
\mathbf{if}\;y \leq -53455814794.271835:\\
\;\;\;\;x + \frac{{y}^{-2} + -1}{\frac{y}{x + -1} \cdot \left(1 + \frac{1}{y}\right)}\\

\mathbf{elif}\;y \leq 1.0120801136950827 \cdot 10^{-5}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1 - x}{y + 1}, -y, 1\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\frac{x}{{y}^{2}} + \left(\frac{1 - x}{y} + \left(x + \frac{1 - x}{{y}^{3}}\right)\right)\right) + \frac{-1}{{y}^{2}}\\


\end{array}

Error

Target

Original21.9
Target0.2
Herbie0.4
\[\begin{array}{l} \mathbf{if}\;y < -3693.8482788297247:\\ \;\;\;\;\frac{1}{y} - \left(\frac{x}{y} - x\right)\\ \mathbf{elif}\;y < 6799310503.41891:\\ \;\;\;\;1 - \frac{\left(1 - x\right) \cdot y}{y + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y} - \left(\frac{x}{y} - x\right)\\ \end{array} \]

Derivation

  1. Split input into 3 regimes
  2. if y < -53455814794.271835

    1. Initial program 46.2

      \[1 - \frac{\left(1 - x\right) \cdot y}{y + 1} \]
    2. Taylor expanded in y around inf 0.0

      \[\leadsto \color{blue}{\left(\frac{1}{y} + \left(-1 \cdot \frac{1 + -1 \cdot x}{{y}^{2}} + x\right)\right) - \frac{x}{y}} \]
    3. Simplified0.0

      \[\leadsto \color{blue}{x + \frac{-1 + x}{y} \cdot \left(\frac{1}{y} + -1\right)} \]
      Proof
      (+.f64 x (*.f64 (/.f64 (+.f64 -1 x) y) (+.f64 (/.f64 1 y) -1))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (*.f64 (/.f64 (Rewrite<= +-commutative_binary64 (+.f64 x -1)) y) (+.f64 (/.f64 1 y) -1))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (*.f64 (/.f64 (+.f64 x (Rewrite<= metadata-eval (neg.f64 1))) y) (+.f64 (/.f64 1 y) -1))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (*.f64 (/.f64 (Rewrite<= sub-neg_binary64 (-.f64 x 1)) y) (+.f64 (/.f64 1 y) -1))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (Rewrite<= distribute-rgt-out_binary64 (+.f64 (*.f64 (/.f64 1 y) (/.f64 (-.f64 x 1) y)) (*.f64 -1 (/.f64 (-.f64 x 1) y))))): 3 points increase in error, 1 points decrease in error
      (+.f64 x (+.f64 (Rewrite<= times-frac_binary64 (/.f64 (*.f64 1 (-.f64 x 1)) (*.f64 y y))) (*.f64 -1 (/.f64 (-.f64 x 1) y)))): 17 points increase in error, 15 points decrease in error
      (+.f64 x (+.f64 (/.f64 (*.f64 1 (-.f64 x 1)) (Rewrite<= unpow2_binary64 (pow.f64 y 2))) (*.f64 -1 (/.f64 (-.f64 x 1) y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (+.f64 (/.f64 (*.f64 1 (-.f64 x 1)) (Rewrite<= *-lft-identity_binary64 (*.f64 1 (pow.f64 y 2)))) (*.f64 -1 (/.f64 (-.f64 x 1) y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (+.f64 (Rewrite=> times-frac_binary64 (*.f64 (/.f64 1 1) (/.f64 (-.f64 x 1) (pow.f64 y 2)))) (*.f64 -1 (/.f64 (-.f64 x 1) y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (+.f64 (*.f64 (Rewrite=> metadata-eval 1) (/.f64 (-.f64 x 1) (pow.f64 y 2))) (*.f64 -1 (/.f64 (-.f64 x 1) y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (+.f64 (Rewrite=> *-lft-identity_binary64 (/.f64 (-.f64 x 1) (pow.f64 y 2))) (*.f64 -1 (/.f64 (-.f64 x 1) y)))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-+l+_binary64 (+.f64 (+.f64 x (/.f64 (-.f64 x 1) (pow.f64 y 2))) (*.f64 -1 (/.f64 (-.f64 x 1) y)))): 0 points increase in error, 1 points decrease in error
      (+.f64 (Rewrite=> +-commutative_binary64 (+.f64 (/.f64 (-.f64 x 1) (pow.f64 y 2)) x)) (*.f64 -1 (/.f64 (-.f64 x 1) y))): 0 points increase in error, 0 points decrease in error
      (Rewrite=> associate-+l+_binary64 (+.f64 (/.f64 (-.f64 x 1) (pow.f64 y 2)) (+.f64 x (*.f64 -1 (/.f64 (-.f64 x 1) y))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (-.f64 x 1) (pow.f64 y 2)) (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) x))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= +-commutative_binary64 (+.f64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) x) (/.f64 (-.f64 x 1) (pow.f64 y 2)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) x) (Rewrite=> div-sub_binary64 (-.f64 (/.f64 x (pow.f64 y 2)) (/.f64 1 (pow.f64 y 2))))): 1 points increase in error, 0 points decrease in error
      (Rewrite<= associate--l+_binary64 (-.f64 (+.f64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) x) (/.f64 x (pow.f64 y 2))) (/.f64 1 (pow.f64 y 2)))): 0 points increase in error, 0 points decrease in error
      (-.f64 (Rewrite<= +-commutative_binary64 (+.f64 (/.f64 x (pow.f64 y 2)) (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) x))) (/.f64 1 (pow.f64 y 2))): 0 points increase in error, 0 points decrease in error
      (Rewrite=> associate--l+_binary64 (+.f64 (/.f64 x (pow.f64 y 2)) (-.f64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) x) (/.f64 1 (pow.f64 y 2))))): 0 points increase in error, 0 points decrease in error
      (Rewrite=> +-commutative_binary64 (+.f64 (-.f64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) x) (/.f64 1 (pow.f64 y 2))) (/.f64 x (pow.f64 y 2)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite=> associate--l+_binary64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) (-.f64 x (/.f64 1 (pow.f64 y 2))))) (/.f64 x (pow.f64 y 2))): 0 points increase in error, 0 points decrease in error
      (Rewrite=> associate-+l+_binary64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) (+.f64 (-.f64 x (/.f64 1 (pow.f64 y 2))) (/.f64 x (pow.f64 y 2))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) (Rewrite<= associate--r-_binary64 (-.f64 x (-.f64 (/.f64 1 (pow.f64 y 2)) (/.f64 x (pow.f64 y 2)))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) (-.f64 x (Rewrite<= div-sub_binary64 (/.f64 (-.f64 1 x) (pow.f64 y 2))))): 0 points increase in error, 1 points decrease in error
      (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) (-.f64 x (/.f64 (Rewrite=> sub-neg_binary64 (+.f64 1 (neg.f64 x))) (pow.f64 y 2)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) (-.f64 x (/.f64 (+.f64 1 (Rewrite<= mul-1-neg_binary64 (*.f64 -1 x))) (pow.f64 y 2)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) (Rewrite<= unsub-neg_binary64 (+.f64 x (neg.f64 (/.f64 (+.f64 1 (*.f64 -1 x)) (pow.f64 y 2)))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) (+.f64 x (Rewrite<= mul-1-neg_binary64 (*.f64 -1 (/.f64 (+.f64 1 (*.f64 -1 x)) (pow.f64 y 2)))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 -1 (/.f64 (+.f64 1 (*.f64 -1 x)) (pow.f64 y 2))) x))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= +-commutative_binary64 (+.f64 (+.f64 (*.f64 -1 (/.f64 (+.f64 1 (*.f64 -1 x)) (pow.f64 y 2))) x) (*.f64 -1 (/.f64 (-.f64 x 1) y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (*.f64 -1 (/.f64 (+.f64 1 (*.f64 -1 x)) (pow.f64 y 2))) x) (Rewrite=> mul-1-neg_binary64 (neg.f64 (/.f64 (-.f64 x 1) y)))): 0 points increase in error, 0 points decrease in error
      (Rewrite=> unsub-neg_binary64 (-.f64 (+.f64 (*.f64 -1 (/.f64 (+.f64 1 (*.f64 -1 x)) (pow.f64 y 2))) x) (/.f64 (-.f64 x 1) y))): 0 points increase in error, 0 points decrease in error
      (-.f64 (+.f64 (*.f64 -1 (/.f64 (+.f64 1 (*.f64 -1 x)) (pow.f64 y 2))) x) (Rewrite=> div-sub_binary64 (-.f64 (/.f64 x y) (/.f64 1 y)))): 1 points increase in error, 0 points decrease in error
      (Rewrite<= associate-+l-_binary64 (+.f64 (-.f64 (+.f64 (*.f64 -1 (/.f64 (+.f64 1 (*.f64 -1 x)) (pow.f64 y 2))) x) (/.f64 x y)) (/.f64 1 y))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= +-commutative_binary64 (+.f64 (/.f64 1 y) (-.f64 (+.f64 (*.f64 -1 (/.f64 (+.f64 1 (*.f64 -1 x)) (pow.f64 y 2))) x) (/.f64 x y)))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate--l+_binary64 (-.f64 (+.f64 (/.f64 1 y) (+.f64 (*.f64 -1 (/.f64 (+.f64 1 (*.f64 -1 x)) (pow.f64 y 2))) x)) (/.f64 x y))): 0 points increase in error, 0 points decrease in error
    4. Applied egg-rr0.0

      \[\leadsto x + \color{blue}{\frac{{y}^{-2} + -1}{\frac{y}{-1 + x} \cdot \left(\frac{1}{y} + 1\right)}} \]

    if -53455814794.271835 < y < 1.0120801136950827e-5

    1. Initial program 0.1

      \[1 - \frac{\left(1 - x\right) \cdot y}{y + 1} \]
    2. Applied egg-rr0.1

      \[\leadsto 1 - \color{blue}{\frac{1}{1 + y} \cdot \left(\left(1 - x\right) \cdot y\right)} \]
    3. Applied egg-rr0.1

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1 - x}{1 + y}, -y, 1\right)} \]

    if 1.0120801136950827e-5 < y

    1. Initial program 43.4

      \[1 - \frac{\left(1 - x\right) \cdot y}{y + 1} \]
    2. Taylor expanded in y around -inf 1.5

      \[\leadsto \color{blue}{\left(\frac{x}{{y}^{2}} + \left(-1 \cdot \frac{x - 1}{y} + \left(-1 \cdot \frac{x - 1}{{y}^{3}} + x\right)\right)\right) - \frac{1}{{y}^{2}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -53455814794.271835:\\ \;\;\;\;x + \frac{{y}^{-2} + -1}{\frac{y}{x + -1} \cdot \left(1 + \frac{1}{y}\right)}\\ \mathbf{elif}\;y \leq 1.0120801136950827 \cdot 10^{-5}:\\ \;\;\;\;\mathsf{fma}\left(\frac{1 - x}{y + 1}, -y, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{x}{{y}^{2}} + \left(\frac{1 - x}{y} + \left(x + \frac{1 - x}{{y}^{3}}\right)\right)\right) + \frac{-1}{{y}^{2}}\\ \end{array} \]

Alternatives

Alternative 1
Error0.3
Cost8264
\[\begin{array}{l} t_0 := \frac{y \cdot \left(1 - x\right)}{y + 1}\\ t_1 := \mathsf{fma}\left(1 - x, \frac{y}{-1 - y}, 1\right)\\ \mathbf{if}\;t_0 \leq 2 \cdot 10^{-5}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_0 \leq 1.02:\\ \;\;\;\;\left(x - \frac{x + -1}{y}\right) + \frac{x + -1}{y \cdot y} \cdot \left(1 + \frac{-1}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Error0.4
Cost7684
\[\begin{array}{l} \mathbf{if}\;y \leq -53455814794.271835:\\ \;\;\;\;x + \frac{{y}^{-2} + -1}{\frac{y}{x + -1} \cdot \left(1 + \frac{1}{y}\right)}\\ \mathbf{elif}\;y \leq 1.0120801136950827 \cdot 10^{-5}:\\ \;\;\;\;\mathsf{fma}\left(\frac{1 - x}{y + 1}, -y, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x - \frac{x + -1}{y}\right) + \frac{x + -1}{y \cdot y} \cdot \left(1 + \frac{-1}{y}\right)\\ \end{array} \]
Alternative 3
Error0.5
Cost7304
\[\begin{array}{l} \mathbf{if}\;y \leq -53455814794.271835:\\ \;\;\;\;x + \frac{1 + \frac{-1}{y \cdot y}}{y + 1}\\ \mathbf{elif}\;y \leq 1.0120801136950827 \cdot 10^{-5}:\\ \;\;\;\;\mathsf{fma}\left(\frac{1 - x}{y + 1}, -y, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x - \frac{x + -1}{y}\right) + \frac{x + -1}{y \cdot y} \cdot \left(1 + \frac{-1}{y}\right)\\ \end{array} \]
Alternative 4
Error0.1
Cost2248
\[\begin{array}{l} t_0 := 1 - \frac{y \cdot \left(1 - x\right)}{y + 1}\\ t_1 := 1 + \frac{x + -1}{\frac{y + 1}{y}}\\ \mathbf{if}\;t_0 \leq -0.02:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_0 \leq 0.0004:\\ \;\;\;\;x + \frac{1 + \frac{-1}{y}}{y}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error0.4
Cost2120
\[\begin{array}{l} t_0 := \frac{y \cdot \left(1 - x\right)}{y + 1}\\ t_1 := 1 + \frac{x + -1}{\frac{y + 1}{y}}\\ \mathbf{if}\;t_0 \leq 2 \cdot 10^{-5}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_0 \leq 1.02:\\ \;\;\;\;x + \frac{1 + \frac{-1}{y \cdot y}}{y + 1}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 6
Error0.4
Cost1608
\[\begin{array}{l} t_0 := \frac{x + -1}{y}\\ t_1 := 1 + \frac{-1}{y}\\ \mathbf{if}\;y \leq -13802698092.886793:\\ \;\;\;\;x - t_0 \cdot t_1\\ \mathbf{elif}\;y \leq 1.0120801136950827 \cdot 10^{-5}:\\ \;\;\;\;1 + \frac{y \cdot x - y}{y + 1}\\ \mathbf{else}:\\ \;\;\;\;\left(x - t_0\right) + \frac{x + -1}{y \cdot y} \cdot t_1\\ \end{array} \]
Alternative 7
Error0.5
Cost1096
\[\begin{array}{l} t_0 := x - \frac{x + -1}{y} \cdot \left(1 + \frac{-1}{y}\right)\\ \mathbf{if}\;y \leq -13802698092.886793:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.0120801136950827 \cdot 10^{-5}:\\ \;\;\;\;1 + \frac{y \cdot x - y}{y + 1}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 8
Error1.1
Cost840
\[\begin{array}{l} t_0 := x + \frac{1 + \frac{-1}{y}}{y}\\ \mathbf{if}\;y \leq -48.789773808953534:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.0120801136950827 \cdot 10^{-5}:\\ \;\;\;\;1 + \left(y \cdot x - y\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 9
Error9.2
Cost712
\[\begin{array}{l} t_0 := x + \frac{1}{y}\\ \mathbf{if}\;y \leq -13802698092.886793:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.0120801136950827 \cdot 10^{-5}:\\ \;\;\;\;1 - \frac{y}{y + 1}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 10
Error1.2
Cost712
\[\begin{array}{l} t_0 := x + \frac{1}{y}\\ \mathbf{if}\;y \leq -48.789773808953534:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.0120801136950827 \cdot 10^{-5}:\\ \;\;\;\;1 + \left(y \cdot x - y\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 11
Error1.1
Cost712
\[\begin{array}{l} t_0 := x - \frac{x + -1}{y}\\ \mathbf{if}\;y \leq -48.789773808953534:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.0120801136950827 \cdot 10^{-5}:\\ \;\;\;\;1 + \left(y \cdot x - y\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 12
Error9.3
Cost584
\[\begin{array}{l} t_0 := x + \frac{1}{y}\\ \mathbf{if}\;y \leq -48.789773808953534:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.0120801136950827 \cdot 10^{-5}:\\ \;\;\;\;1 - y\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 13
Error16.9
Cost456
\[\begin{array}{l} \mathbf{if}\;y \leq -48.789773808953534:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.0120801136950827 \cdot 10^{-5}:\\ \;\;\;\;1 - y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 14
Error17.1
Cost328
\[\begin{array}{l} \mathbf{if}\;y \leq -48.789773808953534:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 44690398.39284847:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 15
Error39.6
Cost64
\[x \]

Error

Reproduce

herbie shell --seed 2022313 
(FPCore (x y)
  :name "Diagrams.Trail:splitAtParam  from diagrams-lib-1.3.0.3, D"
  :precision binary64

  :herbie-target
  (if (< y -3693.8482788297247) (- (/ 1.0 y) (- (/ x y) x)) (if (< y 6799310503.41891) (- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0))) (- (/ 1.0 y) (- (/ x y) x))))

  (- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0))))