Average Error: 22.7 → 0.0
Time: 9.0s
Precision: binary64
Cost: 8073
\[1 - \frac{\left(1 - x\right) \cdot y}{y + 1} \]
\[\begin{array}{l} t_0 := \frac{1 - x}{y}\\ \mathbf{if}\;y \leq -14500 \lor \neg \left(y \leq 12500\right):\\ \;\;\;\;\left(\left(x + t_0\right) + \frac{1 - x}{{y}^{3}}\right) - \frac{t_0}{y}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x + -1}{y + 1}, y, 1\right)\\ \end{array} \]
(FPCore (x y) :precision binary64 (- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0))))
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ (- 1.0 x) y)))
   (if (or (<= y -14500.0) (not (<= y 12500.0)))
     (- (+ (+ x t_0) (/ (- 1.0 x) (pow y 3.0))) (/ t_0 y))
     (fma (/ (+ x -1.0) (+ y 1.0)) y 1.0))))
double code(double x, double y) {
	return 1.0 - (((1.0 - x) * y) / (y + 1.0));
}
double code(double x, double y) {
	double t_0 = (1.0 - x) / y;
	double tmp;
	if ((y <= -14500.0) || !(y <= 12500.0)) {
		tmp = ((x + t_0) + ((1.0 - x) / pow(y, 3.0))) - (t_0 / y);
	} else {
		tmp = fma(((x + -1.0) / (y + 1.0)), y, 1.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)
	t_0 = Float64(Float64(1.0 - x) / y)
	tmp = 0.0
	if ((y <= -14500.0) || !(y <= 12500.0))
		tmp = Float64(Float64(Float64(x + t_0) + Float64(Float64(1.0 - x) / (y ^ 3.0))) - Float64(t_0 / y));
	else
		tmp = fma(Float64(Float64(x + -1.0) / Float64(y + 1.0)), y, 1.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_] := Block[{t$95$0 = N[(N[(1.0 - x), $MachinePrecision] / y), $MachinePrecision]}, If[Or[LessEqual[y, -14500.0], N[Not[LessEqual[y, 12500.0]], $MachinePrecision]], N[(N[(N[(x + t$95$0), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / N[Power[y, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t$95$0 / y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x + -1.0), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] * y + 1.0), $MachinePrecision]]]
1 - \frac{\left(1 - x\right) \cdot y}{y + 1}
\begin{array}{l}
t_0 := \frac{1 - x}{y}\\
\mathbf{if}\;y \leq -14500 \lor \neg \left(y \leq 12500\right):\\
\;\;\;\;\left(\left(x + t_0\right) + \frac{1 - x}{{y}^{3}}\right) - \frac{t_0}{y}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x + -1}{y + 1}, y, 1\right)\\


\end{array}

Error

Target

Original22.7
Target0.2
Herbie0.0
\[\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 2 regimes
  2. if y < -14500 or 12500 < y

    1. Initial program 45.4

      \[1 - \frac{\left(1 - x\right) \cdot y}{y + 1} \]
    2. Simplified29.0

      \[\leadsto \color{blue}{1 - \frac{1 - x}{1 + y} \cdot y} \]
      Proof
      (-.f64 1 (*.f64 (/.f64 (-.f64 1 x) (+.f64 1 y)) y)): 0 points increase in error, 0 points decrease in error
      (-.f64 1 (*.f64 (/.f64 (-.f64 1 x) (Rewrite<= +-commutative_binary64 (+.f64 y 1))) y)): 10 points increase in error, 0 points decrease in error
      (-.f64 1 (*.f64 (Rewrite<= *-lft-identity_binary64 (*.f64 1 (/.f64 (-.f64 1 x) (+.f64 y 1)))) y)): 0 points increase in error, 10 points decrease in error
      (-.f64 1 (*.f64 (*.f64 (Rewrite<= metadata-eval (neg.f64 -1)) (/.f64 (-.f64 1 x) (+.f64 y 1))) y)): 3 points increase in error, 0 points decrease in error
      (-.f64 1 (*.f64 (Rewrite<= distribute-lft-neg-in_binary64 (neg.f64 (*.f64 -1 (/.f64 (-.f64 1 x) (+.f64 y 1))))) y)): 0 points increase in error, 3 points decrease in error
      (-.f64 1 (Rewrite<= distribute-lft-neg-in_binary64 (neg.f64 (*.f64 (*.f64 -1 (/.f64 (-.f64 1 x) (+.f64 y 1))) y)))): 0 points increase in error, 0 points decrease in error
      (-.f64 1 (neg.f64 (Rewrite<= associate-*r*_binary64 (*.f64 -1 (*.f64 (/.f64 (-.f64 1 x) (+.f64 y 1)) y))))): 10 points increase in error, 0 points decrease in error
      (-.f64 1 (neg.f64 (*.f64 -1 (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 (-.f64 1 x) y) (+.f64 y 1)))))): 0 points increase in error, 10 points decrease in error
      (-.f64 1 (neg.f64 (Rewrite<= neg-mul-1_binary64 (neg.f64 (/.f64 (*.f64 (-.f64 1 x) y) (+.f64 y 1)))))): 0 points increase in error, 10 points decrease in error
      (-.f64 1 (Rewrite=> remove-double-neg_binary64 (/.f64 (*.f64 (-.f64 1 x) y) (+.f64 y 1)))): 0 points increase in error, 0 points decrease in error
    3. Taylor expanded in y around -inf 0.0

      \[\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}}} \]
    4. Simplified0.0

      \[\leadsto \color{blue}{\left(\left(x - \frac{x + -1}{y}\right) + \frac{1 - x}{{y}^{3}}\right) + \frac{\frac{x + -1}{y}}{y}} \]
      Proof
      (+.f64 (+.f64 (-.f64 x (/.f64 (+.f64 x -1) y)) (/.f64 (-.f64 1 x) (pow.f64 y 3))) (/.f64 (/.f64 (+.f64 x -1) y) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (-.f64 x (/.f64 (+.f64 x (Rewrite<= metadata-eval (neg.f64 1))) y)) (/.f64 (-.f64 1 x) (pow.f64 y 3))) (/.f64 (/.f64 (+.f64 x -1) y) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (-.f64 x (/.f64 (Rewrite<= sub-neg_binary64 (-.f64 x 1)) y)) (/.f64 (-.f64 1 x) (pow.f64 y 3))) (/.f64 (/.f64 (+.f64 x -1) y) y)): 35 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (Rewrite<= unsub-neg_binary64 (+.f64 x (neg.f64 (/.f64 (-.f64 x 1) y)))) (/.f64 (-.f64 1 x) (pow.f64 y 3))) (/.f64 (/.f64 (+.f64 x -1) y) y)): 0 points increase in error, 35 points decrease in error
      (+.f64 (+.f64 (+.f64 x (Rewrite<= mul-1-neg_binary64 (*.f64 -1 (/.f64 (-.f64 x 1) y)))) (/.f64 (-.f64 1 x) (pow.f64 y 3))) (/.f64 (/.f64 (+.f64 x -1) y) y)): 35 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) x)) (/.f64 (-.f64 1 x) (pow.f64 y 3))) (/.f64 (/.f64 (+.f64 x -1) y) y)): 0 points increase in error, 35 points decrease in error
      (+.f64 (+.f64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) x) (/.f64 (Rewrite=> sub-neg_binary64 (+.f64 1 (neg.f64 x))) (pow.f64 y 3))) (/.f64 (/.f64 (+.f64 x -1) y) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) x) (/.f64 (+.f64 1 (Rewrite<= mul-1-neg_binary64 (*.f64 -1 x))) (pow.f64 y 3))) (/.f64 (/.f64 (+.f64 x -1) y) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) x) (/.f64 (Rewrite=> +-commutative_binary64 (+.f64 (*.f64 -1 x) 1)) (pow.f64 y 3))) (/.f64 (/.f64 (+.f64 x -1) y) y)): 35 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) x) (/.f64 (+.f64 (*.f64 -1 x) (Rewrite<= metadata-eval (*.f64 -1 -1))) (pow.f64 y 3))) (/.f64 (/.f64 (+.f64 x -1) y) y)): 0 points increase in error, 35 points decrease in error
      (+.f64 (+.f64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) x) (/.f64 (Rewrite<= distribute-lft-in_binary64 (*.f64 -1 (+.f64 x -1))) (pow.f64 y 3))) (/.f64 (/.f64 (+.f64 x -1) y) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) x) (/.f64 (*.f64 -1 (+.f64 x (Rewrite<= metadata-eval (neg.f64 1)))) (pow.f64 y 3))) (/.f64 (/.f64 (+.f64 x -1) y) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) x) (/.f64 (*.f64 -1 (Rewrite<= sub-neg_binary64 (-.f64 x 1))) (pow.f64 y 3))) (/.f64 (/.f64 (+.f64 x -1) y) y)): 35 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) x) (Rewrite<= associate-*r/_binary64 (*.f64 -1 (/.f64 (-.f64 x 1) (pow.f64 y 3))))) (/.f64 (/.f64 (+.f64 x -1) y) y)): 0 points increase in error, 35 points decrease in error
      (+.f64 (Rewrite<= associate-+r+_binary64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) (+.f64 x (*.f64 -1 (/.f64 (-.f64 x 1) (pow.f64 y 3)))))) (/.f64 (/.f64 (+.f64 x -1) y) y)): 35 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) (pow.f64 y 3))) x))) (/.f64 (/.f64 (+.f64 x -1) y) y)): 0 points increase in error, 35 points decrease in error
      (+.f64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) (pow.f64 y 3))) x)) (/.f64 (/.f64 (Rewrite<= +-commutative_binary64 (+.f64 -1 x)) y) y)): 0 points increase in error, 35 points decrease in error
      (+.f64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) (pow.f64 y 3))) x)) (/.f64 (/.f64 (+.f64 (Rewrite<= metadata-eval (*.f64 -1 1)) x) y) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) (pow.f64 y 3))) x)) (/.f64 (/.f64 (+.f64 (*.f64 -1 1) (Rewrite<= remove-double-neg_binary64 (neg.f64 (neg.f64 x)))) y) y)): 35 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) (pow.f64 y 3))) x)) (/.f64 (/.f64 (+.f64 (*.f64 -1 1) (Rewrite=> neg-mul-1_binary64 (*.f64 -1 (neg.f64 x)))) y) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) (pow.f64 y 3))) x)) (/.f64 (/.f64 (Rewrite<= distribute-lft-in_binary64 (*.f64 -1 (+.f64 1 (neg.f64 x)))) y) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) (pow.f64 y 3))) x)) (/.f64 (/.f64 (*.f64 -1 (+.f64 1 (Rewrite<= mul-1-neg_binary64 (*.f64 -1 x)))) y) y)): 0 points increase in error, 35 points decrease in error
      (+.f64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) (pow.f64 y 3))) x)) (Rewrite<= associate-/r*_binary64 (/.f64 (*.f64 -1 (+.f64 1 (*.f64 -1 x))) (*.f64 y y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) (pow.f64 y 3))) x)) (/.f64 (*.f64 -1 (+.f64 1 (*.f64 -1 x))) (Rewrite<= unpow2_binary64 (pow.f64 y 2)))): 35 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) (pow.f64 y 3))) x)) (/.f64 (*.f64 -1 (+.f64 1 (Rewrite=> mul-1-neg_binary64 (neg.f64 x)))) (pow.f64 y 2))): 0 points increase in error, 35 points decrease in error
      (+.f64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) (pow.f64 y 3))) x)) (/.f64 (*.f64 -1 (Rewrite<= sub-neg_binary64 (-.f64 1 x))) (pow.f64 y 2))): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) (pow.f64 y 3))) x)) (/.f64 (Rewrite=> mul-1-neg_binary64 (neg.f64 (-.f64 1 x))) (pow.f64 y 2))): 35 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) (pow.f64 y 3))) x)) (/.f64 (neg.f64 (Rewrite=> sub-neg_binary64 (+.f64 1 (neg.f64 x)))) (pow.f64 y 2))): 0 points increase in error, 35 points decrease in error
      (+.f64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) (pow.f64 y 3))) x)) (/.f64 (neg.f64 (Rewrite=> +-commutative_binary64 (+.f64 (neg.f64 x) 1))) (pow.f64 y 2))): 35 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) (pow.f64 y 3))) x)) (/.f64 (Rewrite=> distribute-neg-in_binary64 (+.f64 (neg.f64 (neg.f64 x)) (neg.f64 1))) (pow.f64 y 2))): 0 points increase in error, 35 points decrease in error
      (+.f64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) (pow.f64 y 3))) x)) (/.f64 (+.f64 (Rewrite=> remove-double-neg_binary64 x) (neg.f64 1)) (pow.f64 y 2))): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) (pow.f64 y 3))) x)) (/.f64 (Rewrite<= sub-neg_binary64 (-.f64 x 1)) (pow.f64 y 2))): 35 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) (pow.f64 y 3))) x)) (Rewrite=> div-sub_binary64 (-.f64 (/.f64 x (pow.f64 y 2)) (/.f64 1 (pow.f64 y 2))))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate--l+_binary64 (-.f64 (+.f64 (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) (pow.f64 y 3))) x)) (/.f64 x (pow.f64 y 2))) (/.f64 1 (pow.f64 y 2)))): 0 points increase in error, 35 points decrease in error
      (-.f64 (Rewrite<= +-commutative_binary64 (+.f64 (/.f64 x (pow.f64 y 2)) (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) y)) (+.f64 (*.f64 -1 (/.f64 (-.f64 x 1) (pow.f64 y 3))) x)))) (/.f64 1 (pow.f64 y 2))): 35 points increase in error, 0 points decrease in error

    if -14500 < y < 12500

    1. Initial program 0.0

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{x + -1}{1 + y}, y, 1\right)} \]
      Proof
      (-.f64 1 (*.f64 (/.f64 (-.f64 1 x) (+.f64 1 y)) y)): 0 points increase in error, 0 points decrease in error
      (-.f64 1 (*.f64 (/.f64 (-.f64 1 x) (Rewrite<= +-commutative_binary64 (+.f64 y 1))) y)): 10 points increase in error, 0 points decrease in error
      (-.f64 1 (*.f64 (Rewrite<= *-lft-identity_binary64 (*.f64 1 (/.f64 (-.f64 1 x) (+.f64 y 1)))) y)): 0 points increase in error, 10 points decrease in error
      (-.f64 1 (*.f64 (*.f64 (Rewrite<= metadata-eval (neg.f64 -1)) (/.f64 (-.f64 1 x) (+.f64 y 1))) y)): 3 points increase in error, 0 points decrease in error
      (-.f64 1 (*.f64 (Rewrite<= distribute-lft-neg-in_binary64 (neg.f64 (*.f64 -1 (/.f64 (-.f64 1 x) (+.f64 y 1))))) y)): 0 points increase in error, 3 points decrease in error
      (-.f64 1 (Rewrite<= distribute-lft-neg-in_binary64 (neg.f64 (*.f64 (*.f64 -1 (/.f64 (-.f64 1 x) (+.f64 y 1))) y)))): 0 points increase in error, 0 points decrease in error
      (-.f64 1 (neg.f64 (Rewrite<= associate-*r*_binary64 (*.f64 -1 (*.f64 (/.f64 (-.f64 1 x) (+.f64 y 1)) y))))): 10 points increase in error, 0 points decrease in error
      (-.f64 1 (neg.f64 (*.f64 -1 (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 (-.f64 1 x) y) (+.f64 y 1)))))): 0 points increase in error, 10 points decrease in error
      (-.f64 1 (neg.f64 (Rewrite<= neg-mul-1_binary64 (neg.f64 (/.f64 (*.f64 (-.f64 1 x) y) (+.f64 y 1)))))): 0 points increase in error, 10 points decrease in error
      (-.f64 1 (Rewrite=> remove-double-neg_binary64 (/.f64 (*.f64 (-.f64 1 x) y) (+.f64 y 1)))): 0 points increase in error, 0 points decrease in error
  3. Recombined 2 regimes into one program.
  4. Final simplification0.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -14500 \lor \neg \left(y \leq 12500\right):\\ \;\;\;\;\left(\left(x + \frac{1 - x}{y}\right) + \frac{1 - x}{{y}^{3}}\right) - \frac{\frac{1 - x}{y}}{y}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x + -1}{y + 1}, y, 1\right)\\ \end{array} \]

Alternatives

Alternative 1
Error0.1
Cost7241
\[\begin{array}{l} \mathbf{if}\;y \leq -54000000000 \lor \neg \left(y \leq 310000\right):\\ \;\;\;\;\left(x + \frac{x + -1}{y \cdot y}\right) + \frac{1 - x}{y}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x + -1}{y + 1}, y, 1\right)\\ \end{array} \]
Alternative 2
Error0.1
Cost1225
\[\begin{array}{l} \mathbf{if}\;y \leq -54000000000 \lor \neg \left(y \leq 300000\right):\\ \;\;\;\;\left(x + \frac{x + -1}{y \cdot y}\right) + \frac{1 - x}{y}\\ \mathbf{else}:\\ \;\;\;\;1 + y \cdot \frac{x + -1}{y + 1}\\ \end{array} \]
Alternative 3
Error0.2
Cost969
\[\begin{array}{l} \mathbf{if}\;y \leq -54000000000 \lor \neg \left(y \leq 120000000\right):\\ \;\;\;\;x + \frac{1 - x}{y}\\ \mathbf{else}:\\ \;\;\;\;1 + y \cdot \frac{x + -1}{y + 1}\\ \end{array} \]
Alternative 4
Error1.2
Cost713
\[\begin{array}{l} \mathbf{if}\;y \leq -1 \lor \neg \left(y \leq 0.79\right):\\ \;\;\;\;x + \frac{1}{y}\\ \mathbf{else}:\\ \;\;\;\;1 - y \cdot \left(1 - x\right)\\ \end{array} \]
Alternative 5
Error1.1
Cost713
\[\begin{array}{l} \mathbf{if}\;y \leq -1 \lor \neg \left(y \leq 1\right):\\ \;\;\;\;x + \frac{1 - x}{y}\\ \mathbf{else}:\\ \;\;\;\;1 - y \cdot \left(1 - x\right)\\ \end{array} \]
Alternative 6
Error19.0
Cost588
\[\begin{array}{l} \mathbf{if}\;y \leq -1:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 6.5 \cdot 10^{-159}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 1550000:\\ \;\;\;\;y \cdot x\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 7
Error18.9
Cost588
\[\begin{array}{l} \mathbf{if}\;y \leq -1:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 6.5 \cdot 10^{-159}:\\ \;\;\;\;1 - y\\ \mathbf{elif}\;y \leq 1550000:\\ \;\;\;\;y \cdot x\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 8
Error1.4
Cost585
\[\begin{array}{l} \mathbf{if}\;y \leq -1 \lor \neg \left(y \leq 1\right):\\ \;\;\;\;x + \frac{1}{y}\\ \mathbf{else}:\\ \;\;\;\;1 + y \cdot x\\ \end{array} \]
Alternative 9
Error9.1
Cost584
\[\begin{array}{l} \mathbf{if}\;y \leq -1:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 2500000000:\\ \;\;\;\;1 + y \cdot x\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 10
Error17.1
Cost328
\[\begin{array}{l} \mathbf{if}\;y \leq -1:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 2500000000:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 11
Error39.9
Cost64
\[1 \]

Error

Reproduce

herbie shell --seed 2022343 
(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))))