?

Average Accuracy: 65.4% → 99.3%
Time: 9.9s
Precision: binary64
Cost: 968

?

\[1 - \frac{\left(1 - x\right) \cdot y}{y + 1} \]
\[\begin{array}{l} \mathbf{if}\;y \leq -6.6 \cdot 10^{+24}:\\ \;\;\;\;x - \frac{-1}{y}\\ \mathbf{elif}\;y \leq 120000000:\\ \;\;\;\;1 + y \cdot \frac{x + -1}{y + 1}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{1 - x}{y}\\ \end{array} \]
(FPCore (x y) :precision binary64 (- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0))))
(FPCore (x y)
 :precision binary64
 (if (<= y -6.6e+24)
   (- x (/ -1.0 y))
   (if (<= y 120000000.0)
     (+ 1.0 (* y (/ (+ x -1.0) (+ y 1.0))))
     (+ x (/ (- 1.0 x) y)))))
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 <= -6.6e+24) {
		tmp = x - (-1.0 / y);
	} else if (y <= 120000000.0) {
		tmp = 1.0 + (y * ((x + -1.0) / (y + 1.0)));
	} else {
		tmp = x + ((1.0 - x) / y);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = 1.0d0 - (((1.0d0 - x) * y) / (y + 1.0d0))
end function
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= (-6.6d+24)) then
        tmp = x - ((-1.0d0) / y)
    else if (y <= 120000000.0d0) then
        tmp = 1.0d0 + (y * ((x + (-1.0d0)) / (y + 1.0d0)))
    else
        tmp = x + ((1.0d0 - x) / y)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	return 1.0 - (((1.0 - x) * y) / (y + 1.0));
}
public static double code(double x, double y) {
	double tmp;
	if (y <= -6.6e+24) {
		tmp = x - (-1.0 / y);
	} else if (y <= 120000000.0) {
		tmp = 1.0 + (y * ((x + -1.0) / (y + 1.0)));
	} else {
		tmp = x + ((1.0 - x) / y);
	}
	return tmp;
}
def code(x, y):
	return 1.0 - (((1.0 - x) * y) / (y + 1.0))
def code(x, y):
	tmp = 0
	if y <= -6.6e+24:
		tmp = x - (-1.0 / y)
	elif y <= 120000000.0:
		tmp = 1.0 + (y * ((x + -1.0) / (y + 1.0)))
	else:
		tmp = x + ((1.0 - x) / y)
	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 <= -6.6e+24)
		tmp = Float64(x - Float64(-1.0 / y));
	elseif (y <= 120000000.0)
		tmp = Float64(1.0 + Float64(y * Float64(Float64(x + -1.0) / Float64(y + 1.0))));
	else
		tmp = Float64(x + Float64(Float64(1.0 - x) / y));
	end
	return tmp
end
function tmp = code(x, y)
	tmp = 1.0 - (((1.0 - x) * y) / (y + 1.0));
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= -6.6e+24)
		tmp = x - (-1.0 / y);
	elseif (y <= 120000000.0)
		tmp = 1.0 + (y * ((x + -1.0) / (y + 1.0)));
	else
		tmp = x + ((1.0 - x) / y);
	end
	tmp_2 = 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, -6.6e+24], N[(x - N[(-1.0 / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 120000000.0], N[(1.0 + N[(y * N[(N[(x + -1.0), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(1.0 - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
1 - \frac{\left(1 - x\right) \cdot y}{y + 1}
\begin{array}{l}
\mathbf{if}\;y \leq -6.6 \cdot 10^{+24}:\\
\;\;\;\;x - \frac{-1}{y}\\

\mathbf{elif}\;y \leq 120000000:\\
\;\;\;\;1 + y \cdot \frac{x + -1}{y + 1}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{1 - x}{y}\\


\end{array}

Error?

Bogosity?

Bogosity

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original65.4%
Target99.6%
Herbie99.3%
\[\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 < -6.5999999999999998e24

    1. Initial program 32.5%

      \[1 - \frac{\left(1 - x\right) \cdot y}{y + 1} \]
    2. Simplified59.4%

      \[\leadsto \color{blue}{1 - \frac{1 - x}{1 + y} \cdot y} \]
      Proof

      [Start]32.5

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

      sub-neg [=>]32.5

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

      distribute-neg-frac [=>]32.5

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

      neg-mul-1 [=>]32.5

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

      associate-*l/ [<=]32.6

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

      metadata-eval [<=]32.6

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

      associate-*l/ [<=]32.6

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

      associate-/r/ [<=]32.6

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

      metadata-eval [<=]32.6

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

      distribute-neg-frac [<=]32.6

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

      cancel-sign-sub-inv [<=]32.6

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

      associate-/r/ [<=]32.4

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

      associate-/r* [<=]32.4

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

      neg-mul-1 [<=]32.4

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

      associate-/r/ [=>]32.6

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

      distribute-rgt-neg-in [<=]32.6

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

      associate-/r/ [<=]32.4

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

      distribute-neg-frac [=>]32.4

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

      metadata-eval [=>]32.4

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

      associate-/r/ [=>]32.6

      \[ 1 - \color{blue}{\frac{1}{y + 1} \cdot \left(\left(1 - x\right) \cdot y\right)} \]
    3. Taylor expanded in y around inf 100.0%

      \[\leadsto \color{blue}{\left(\frac{1}{y} + x\right) - \frac{x}{y}} \]
    4. Simplified100.0%

      \[\leadsto \color{blue}{x - \frac{x + -1}{y}} \]
      Proof

      [Start]100.0

      \[ \left(\frac{1}{y} + x\right) - \frac{x}{y} \]

      +-commutative [=>]100.0

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

      associate--l+ [=>]100.0

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

      div-sub [<=]100.0

      \[ x + \color{blue}{\frac{1 - x}{y}} \]

      sub-neg [=>]100.0

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

      +-commutative [=>]100.0

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

      neg-sub0 [=>]100.0

      \[ x + \frac{\color{blue}{\left(0 - x\right)} + 1}{y} \]

      associate-+l- [=>]100.0

      \[ x + \frac{\color{blue}{0 - \left(x - 1\right)}}{y} \]

      neg-sub0 [<=]100.0

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

      mul-1-neg [<=]100.0

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

      associate-*r/ [<=]100.0

      \[ x + \color{blue}{-1 \cdot \frac{x - 1}{y}} \]

      mul-1-neg [=>]100.0

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

      unsub-neg [=>]100.0

      \[ \color{blue}{x - \frac{x - 1}{y}} \]

      sub-neg [=>]100.0

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

      metadata-eval [=>]100.0

      \[ x - \frac{x + \color{blue}{-1}}{y} \]
    5. Taylor expanded in x around 0 100.0%

      \[\leadsto x - \color{blue}{\frac{-1}{y}} \]

    if -6.5999999999999998e24 < y < 1.2e8

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{1 - \frac{1 - x}{1 + y} \cdot y} \]
      Proof

      [Start]99.9

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

      sub-neg [=>]99.9

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

      distribute-neg-frac [=>]99.9

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

      neg-mul-1 [=>]99.9

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

      associate-*l/ [<=]99.9

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

      metadata-eval [<=]99.9

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

      associate-*l/ [<=]99.9

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

      associate-/r/ [<=]99.9

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

      metadata-eval [<=]99.9

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

      distribute-neg-frac [<=]99.9

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

      cancel-sign-sub-inv [<=]99.9

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

      associate-/r/ [<=]99.9

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

      associate-/r* [<=]99.9

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

      neg-mul-1 [<=]99.9

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

      associate-/r/ [=>]99.9

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

      distribute-rgt-neg-in [<=]99.9

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

      associate-/r/ [<=]99.9

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

      distribute-neg-frac [=>]99.9

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

      metadata-eval [=>]99.9

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

      associate-/r/ [=>]99.9

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

    if 1.2e8 < y

    1. Initial program 27.3%

      \[1 - \frac{\left(1 - x\right) \cdot y}{y + 1} \]
    2. Simplified56.6%

      \[\leadsto \color{blue}{1 - \frac{1 - x}{1 + y} \cdot y} \]
      Proof

      [Start]27.3

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

      sub-neg [=>]27.3

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

      distribute-neg-frac [=>]27.3

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

      neg-mul-1 [=>]27.3

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

      associate-*l/ [<=]27.3

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

      metadata-eval [<=]27.3

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

      associate-*l/ [<=]27.3

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

      associate-/r/ [<=]27.3

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

      metadata-eval [<=]27.3

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

      distribute-neg-frac [<=]27.3

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

      cancel-sign-sub-inv [<=]27.3

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

      associate-/r/ [<=]27.2

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

      associate-/r* [<=]27.2

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

      neg-mul-1 [<=]27.2

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

      associate-/r/ [=>]27.3

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

      distribute-rgt-neg-in [<=]27.3

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

      associate-/r/ [<=]27.2

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

      distribute-neg-frac [=>]27.2

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

      metadata-eval [=>]27.2

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

      associate-/r/ [=>]27.3

      \[ 1 - \color{blue}{\frac{1}{y + 1} \cdot \left(\left(1 - x\right) \cdot y\right)} \]
    3. Taylor expanded in y around inf 100.0%

      \[\leadsto \color{blue}{\left(\frac{1}{y} + x\right) - \frac{x}{y}} \]
    4. Simplified100.0%

      \[\leadsto \color{blue}{x - \frac{x + -1}{y}} \]
      Proof

      [Start]100.0

      \[ \left(\frac{1}{y} + x\right) - \frac{x}{y} \]

      +-commutative [=>]100.0

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

      associate--l+ [=>]100.0

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

      div-sub [<=]100.0

      \[ x + \color{blue}{\frac{1 - x}{y}} \]

      sub-neg [=>]100.0

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

      +-commutative [=>]100.0

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

      neg-sub0 [=>]100.0

      \[ x + \frac{\color{blue}{\left(0 - x\right)} + 1}{y} \]

      associate-+l- [=>]100.0

      \[ x + \frac{\color{blue}{0 - \left(x - 1\right)}}{y} \]

      neg-sub0 [<=]100.0

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

      mul-1-neg [<=]100.0

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

      associate-*r/ [<=]100.0

      \[ x + \color{blue}{-1 \cdot \frac{x - 1}{y}} \]

      mul-1-neg [=>]100.0

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

      unsub-neg [=>]100.0

      \[ \color{blue}{x - \frac{x - 1}{y}} \]

      sub-neg [=>]100.0

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

      metadata-eval [=>]100.0

      \[ x - \frac{x + \color{blue}{-1}}{y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification100.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.6 \cdot 10^{+24}:\\ \;\;\;\;x - \frac{-1}{y}\\ \mathbf{elif}\;y \leq 120000000:\\ \;\;\;\;1 + y \cdot \frac{x + -1}{y + 1}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{1 - x}{y}\\ \end{array} \]

Alternatives

Alternative 1
Accuracy86.2%
Cost848
\[\begin{array}{l} t_0 := x - \frac{-1}{y}\\ \mathbf{if}\;y \leq -1:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{-80}:\\ \;\;\;\;1 - y\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{-73}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;y \leq 0.01:\\ \;\;\;\;1 - y\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Accuracy98.3%
Cost840
\[\begin{array}{l} \mathbf{if}\;y \leq -6.6 \cdot 10^{+24}:\\ \;\;\;\;x - \frac{-1}{y}\\ \mathbf{elif}\;y \leq 30000:\\ \;\;\;\;1 - y \cdot \frac{x}{-1 - y}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{1 - x}{y}\\ \end{array} \]
Alternative 3
Accuracy73.8%
Cost720
\[\begin{array}{l} \mathbf{if}\;y \leq -1:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{-98}:\\ \;\;\;\;1 - y\\ \mathbf{elif}\;y \leq 3.8 \cdot 10^{-73}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;y \leq 0.39:\\ \;\;\;\;1 - y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 4
Accuracy98.3%
Cost713
\[\begin{array}{l} \mathbf{if}\;y \leq -1 \lor \neg \left(y \leq 0.85\right):\\ \;\;\;\;x - \frac{-1}{y}\\ \mathbf{else}:\\ \;\;\;\;1 + \left(y \cdot x - y\right)\\ \end{array} \]
Alternative 5
Accuracy98.6%
Cost713
\[\begin{array}{l} \mathbf{if}\;y \leq -1 \lor \neg \left(y \leq 1\right):\\ \;\;\;\;x + \frac{1 - x}{y}\\ \mathbf{else}:\\ \;\;\;\;1 + \left(y \cdot x - y\right)\\ \end{array} \]
Alternative 6
Accuracy74.1%
Cost592
\[\begin{array}{l} \mathbf{if}\;y \leq -1:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 4.6 \cdot 10^{-79}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 3.9 \cdot 10^{-73}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;y \leq 62:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 7
Accuracy98.1%
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 8
Accuracy74.2%
Cost328
\[\begin{array}{l} \mathbf{if}\;y \leq -1:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 0.017:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 9
Accuracy38.7%
Cost64
\[1 \]

Error

Reproduce?

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