Linear.Projection:perspective from linear-1.19.1.3, B

Percentage Accurate: 77.4% → 99.7%
Time: 6.3s
Alternatives: 7
Speedup: 0.7×

Specification

?
\[\begin{array}{l} \\ \frac{\left(x \cdot 2\right) \cdot y}{x - y} \end{array} \]
(FPCore (x y) :precision binary64 (/ (* (* x 2.0) y) (- x y)))
double code(double x, double y) {
	return ((x * 2.0) * y) / (x - y);
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = ((x * 2.0d0) * y) / (x - y)
end function
public static double code(double x, double y) {
	return ((x * 2.0) * y) / (x - y);
}
def code(x, y):
	return ((x * 2.0) * y) / (x - y)
function code(x, y)
	return Float64(Float64(Float64(x * 2.0) * y) / Float64(x - y))
end
function tmp = code(x, y)
	tmp = ((x * 2.0) * y) / (x - y);
end
code[x_, y_] := N[(N[(N[(x * 2.0), $MachinePrecision] * y), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(x \cdot 2\right) \cdot y}{x - y}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 7 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 77.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\left(x \cdot 2\right) \cdot y}{x - y} \end{array} \]
(FPCore (x y) :precision binary64 (/ (* (* x 2.0) y) (- x y)))
double code(double x, double y) {
	return ((x * 2.0) * y) / (x - y);
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = ((x * 2.0d0) * y) / (x - y)
end function
public static double code(double x, double y) {
	return ((x * 2.0) * y) / (x - y);
}
def code(x, y):
	return ((x * 2.0) * y) / (x - y)
function code(x, y)
	return Float64(Float64(Float64(x * 2.0) * y) / Float64(x - y))
end
function tmp = code(x, y)
	tmp = ((x * 2.0) * y) / (x - y);
end
code[x_, y_] := N[(N[(N[(x * 2.0), $MachinePrecision] * y), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(x \cdot 2\right) \cdot y}{x - y}
\end{array}

Alternative 1: 99.7% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.05 \cdot 10^{-15} \lor \neg \left(x \leq 4.2 \cdot 10^{-50}\right):\\ \;\;\;\;\left(2 \cdot \frac{x}{x - y}\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\frac{2}{x - y} \cdot y\right)\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (or (<= x -1.05e-15) (not (<= x 4.2e-50)))
   (* (* 2.0 (/ x (- x y))) y)
   (* x (* (/ 2.0 (- x y)) y))))
double code(double x, double y) {
	double tmp;
	if ((x <= -1.05e-15) || !(x <= 4.2e-50)) {
		tmp = (2.0 * (x / (x - y))) * y;
	} else {
		tmp = x * ((2.0 / (x - y)) * y);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if ((x <= (-1.05d-15)) .or. (.not. (x <= 4.2d-50))) then
        tmp = (2.0d0 * (x / (x - y))) * y
    else
        tmp = x * ((2.0d0 / (x - y)) * y)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if ((x <= -1.05e-15) || !(x <= 4.2e-50)) {
		tmp = (2.0 * (x / (x - y))) * y;
	} else {
		tmp = x * ((2.0 / (x - y)) * y);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if (x <= -1.05e-15) or not (x <= 4.2e-50):
		tmp = (2.0 * (x / (x - y))) * y
	else:
		tmp = x * ((2.0 / (x - y)) * y)
	return tmp
function code(x, y)
	tmp = 0.0
	if ((x <= -1.05e-15) || !(x <= 4.2e-50))
		tmp = Float64(Float64(2.0 * Float64(x / Float64(x - y))) * y);
	else
		tmp = Float64(x * Float64(Float64(2.0 / Float64(x - y)) * y));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if ((x <= -1.05e-15) || ~((x <= 4.2e-50)))
		tmp = (2.0 * (x / (x - y))) * y;
	else
		tmp = x * ((2.0 / (x - y)) * y);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[Or[LessEqual[x, -1.05e-15], N[Not[LessEqual[x, 4.2e-50]], $MachinePrecision]], N[(N[(2.0 * N[(x / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], N[(x * N[(N[(2.0 / N[(x - y), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{-15} \lor \neg \left(x \leq 4.2 \cdot 10^{-50}\right):\\
\;\;\;\;\left(2 \cdot \frac{x}{x - y}\right) \cdot y\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{2}{x - y} \cdot y\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.0499999999999999e-15 or 4.2000000000000002e-50 < x

    1. Initial program 77.6%

      \[\frac{\left(x \cdot 2\right) \cdot y}{x - y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\left(x \cdot 2\right) \cdot y}{x - y}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(x \cdot 2\right) \cdot y}}{x - y} \]
      3. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{y \cdot \left(x \cdot 2\right)}}{x - y} \]
      4. associate-/l*N/A

        \[\leadsto \color{blue}{y \cdot \frac{x \cdot 2}{x - y}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{x \cdot 2}{x - y} \cdot y} \]
      6. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot 2}{x - y} \cdot y} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot 2}}{x - y} \cdot y \]
      8. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{2 \cdot x}}{x - y} \cdot y \]
      9. associate-/l*N/A

        \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right)} \cdot y \]
      10. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right)} \cdot y \]
      11. lower-/.f64100.0

        \[\leadsto \left(2 \cdot \color{blue}{\frac{x}{x - y}}\right) \cdot y \]
    4. Applied rewrites100.0%

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

    if -1.0499999999999999e-15 < x < 4.2000000000000002e-50

    1. Initial program 77.7%

      \[\frac{\left(x \cdot 2\right) \cdot y}{x - y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\left(x \cdot 2\right) \cdot y}{x - y}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(x \cdot 2\right) \cdot y}}{x - y} \]
      3. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{y \cdot \left(x \cdot 2\right)}}{x - y} \]
      4. associate-/l*N/A

        \[\leadsto \color{blue}{y \cdot \frac{x \cdot 2}{x - y}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{x \cdot 2}{x - y} \cdot y} \]
      6. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot 2}{x - y} \cdot y} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot 2}}{x - y} \cdot y \]
      8. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{2 \cdot x}}{x - y} \cdot y \]
      9. associate-/l*N/A

        \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right)} \cdot y \]
      10. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right)} \cdot y \]
      11. lower-/.f6472.0

        \[\leadsto \left(2 \cdot \color{blue}{\frac{x}{x - y}}\right) \cdot y \]
    4. Applied rewrites72.0%

      \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right) \cdot y} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right) \cdot y} \]
      2. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right)} \cdot y \]
      3. lift-/.f64N/A

        \[\leadsto \left(2 \cdot \color{blue}{\frac{x}{x - y}}\right) \cdot y \]
      4. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{2 \cdot x}{x - y}} \cdot y \]
      5. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{x \cdot 2}}{x - y} \cdot y \]
      6. associate-/l*N/A

        \[\leadsto \color{blue}{\left(x \cdot \frac{2}{x - y}\right)} \cdot y \]
      7. associate-*l*N/A

        \[\leadsto \color{blue}{x \cdot \left(\frac{2}{x - y} \cdot y\right)} \]
      8. lower-*.f64N/A

        \[\leadsto \color{blue}{x \cdot \left(\frac{2}{x - y} \cdot y\right)} \]
      9. lower-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(\frac{2}{x - y} \cdot y\right)} \]
      10. lower-/.f6499.7

        \[\leadsto x \cdot \left(\color{blue}{\frac{2}{x - y}} \cdot y\right) \]
    6. Applied rewrites99.7%

      \[\leadsto \color{blue}{x \cdot \left(\frac{2}{x - y} \cdot y\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.05 \cdot 10^{-15} \lor \neg \left(x \leq 4.2 \cdot 10^{-50}\right):\\ \;\;\;\;\left(2 \cdot \frac{x}{x - y}\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\frac{2}{x - y} \cdot y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 87.5% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\left(x + x\right) \cdot y}{x - y}\\ t_1 := \frac{\left(x \cdot 2\right) \cdot y}{x - y}\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;-2 \cdot x\\ \mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-304}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{y}{x}, y\right) \cdot 2\\ \mathbf{elif}\;t\_1 \leq 10^{+121}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;y + y\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ (* (+ x x) y) (- x y))) (t_1 (/ (* (* x 2.0) y) (- x y))))
   (if (<= t_1 (- INFINITY))
     (* -2.0 x)
     (if (<= t_1 -5e-304)
       t_0
       (if (<= t_1 0.0)
         (* (fma y (/ y x) y) 2.0)
         (if (<= t_1 1e+121) t_0 (+ y y)))))))
double code(double x, double y) {
	double t_0 = ((x + x) * y) / (x - y);
	double t_1 = ((x * 2.0) * y) / (x - y);
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = -2.0 * x;
	} else if (t_1 <= -5e-304) {
		tmp = t_0;
	} else if (t_1 <= 0.0) {
		tmp = fma(y, (y / x), y) * 2.0;
	} else if (t_1 <= 1e+121) {
		tmp = t_0;
	} else {
		tmp = y + y;
	}
	return tmp;
}
function code(x, y)
	t_0 = Float64(Float64(Float64(x + x) * y) / Float64(x - y))
	t_1 = Float64(Float64(Float64(x * 2.0) * y) / Float64(x - y))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(-2.0 * x);
	elseif (t_1 <= -5e-304)
		tmp = t_0;
	elseif (t_1 <= 0.0)
		tmp = Float64(fma(y, Float64(y / x), y) * 2.0);
	elseif (t_1 <= 1e+121)
		tmp = t_0;
	else
		tmp = Float64(y + y);
	end
	return tmp
end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[(x + x), $MachinePrecision] * y), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(x * 2.0), $MachinePrecision] * y), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(-2.0 * x), $MachinePrecision], If[LessEqual[t$95$1, -5e-304], t$95$0, If[LessEqual[t$95$1, 0.0], N[(N[(y * N[(y / x), $MachinePrecision] + y), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[t$95$1, 1e+121], t$95$0, N[(y + y), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\left(x + x\right) \cdot y}{x - y}\\
t_1 := \frac{\left(x \cdot 2\right) \cdot y}{x - y}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;-2 \cdot x\\

\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-304}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{y}{x}, y\right) \cdot 2\\

\mathbf{elif}\;t\_1 \leq 10^{+121}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;y + y\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (*.f64 (*.f64 x #s(literal 2 binary64)) y) (-.f64 x y)) < -inf.0

    1. Initial program 4.9%

      \[\frac{\left(x \cdot 2\right) \cdot y}{x - y} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{-2 \cdot x} \]
    4. Step-by-step derivation
      1. lower-*.f6460.1

        \[\leadsto \color{blue}{-2 \cdot x} \]
    5. Applied rewrites60.1%

      \[\leadsto \color{blue}{-2 \cdot x} \]

    if -inf.0 < (/.f64 (*.f64 (*.f64 x #s(literal 2 binary64)) y) (-.f64 x y)) < -4.99999999999999965e-304 or -0.0 < (/.f64 (*.f64 (*.f64 x #s(literal 2 binary64)) y) (-.f64 x y)) < 1.00000000000000004e121

    1. Initial program 99.5%

      \[\frac{\left(x \cdot 2\right) \cdot y}{x - y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(x \cdot 2\right)} \cdot y}{x - y} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{\left(2 \cdot x\right)} \cdot y}{x - y} \]
      3. count-2-revN/A

        \[\leadsto \frac{\color{blue}{\left(x + x\right)} \cdot y}{x - y} \]
      4. lower-+.f6499.5

        \[\leadsto \frac{\color{blue}{\left(x + x\right)} \cdot y}{x - y} \]
    4. Applied rewrites99.5%

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

    if -4.99999999999999965e-304 < (/.f64 (*.f64 (*.f64 x #s(literal 2 binary64)) y) (-.f64 x y)) < -0.0

    1. Initial program 11.7%

      \[\frac{\left(x \cdot 2\right) \cdot y}{x - y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\left(x \cdot 2\right) \cdot y}{x - y}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(x \cdot 2\right) \cdot y}}{x - y} \]
      3. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{y \cdot \left(x \cdot 2\right)}}{x - y} \]
      4. associate-/l*N/A

        \[\leadsto \color{blue}{y \cdot \frac{x \cdot 2}{x - y}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{x \cdot 2}{x - y} \cdot y} \]
      6. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot 2}{x - y} \cdot y} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot 2}}{x - y} \cdot y \]
      8. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{2 \cdot x}}{x - y} \cdot y \]
      9. associate-/l*N/A

        \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right)} \cdot y \]
      10. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right)} \cdot y \]
      11. lower-/.f64100.0

        \[\leadsto \left(2 \cdot \color{blue}{\frac{x}{x - y}}\right) \cdot y \]
    4. Applied rewrites100.0%

      \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right) \cdot y} \]
    5. Taylor expanded in x around inf

      \[\leadsto \color{blue}{2 \cdot y + 2 \cdot \frac{{y}^{2}}{x}} \]
    6. Step-by-step derivation
      1. distribute-lft-outN/A

        \[\leadsto \color{blue}{2 \cdot \left(y + \frac{{y}^{2}}{x}\right)} \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{\left(y + \frac{{y}^{2}}{x}\right) \cdot 2} \]
      3. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(y + \frac{{y}^{2}}{x}\right) \cdot 2} \]
      4. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\frac{{y}^{2}}{x} + y\right)} \cdot 2 \]
      5. unpow2N/A

        \[\leadsto \left(\frac{\color{blue}{y \cdot y}}{x} + y\right) \cdot 2 \]
      6. associate-/l*N/A

        \[\leadsto \left(\color{blue}{y \cdot \frac{y}{x}} + y\right) \cdot 2 \]
      7. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{y}{x}, y\right)} \cdot 2 \]
      8. lower-/.f6457.4

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{y}{x}}, y\right) \cdot 2 \]
    7. Applied rewrites57.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{y}{x}, y\right) \cdot 2} \]

    if 1.00000000000000004e121 < (/.f64 (*.f64 (*.f64 x #s(literal 2 binary64)) y) (-.f64 x y))

    1. Initial program 9.6%

      \[\frac{\left(x \cdot 2\right) \cdot y}{x - y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\left(x \cdot 2\right) \cdot y}{x - y}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(x \cdot 2\right) \cdot y}}{x - y} \]
      3. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{y \cdot \left(x \cdot 2\right)}}{x - y} \]
      4. associate-/l*N/A

        \[\leadsto \color{blue}{y \cdot \frac{x \cdot 2}{x - y}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{x \cdot 2}{x - y} \cdot y} \]
      6. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot 2}{x - y} \cdot y} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot 2}}{x - y} \cdot y \]
      8. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{2 \cdot x}}{x - y} \cdot y \]
      9. associate-/l*N/A

        \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right)} \cdot y \]
      10. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right)} \cdot y \]
      11. lower-/.f64100.0

        \[\leadsto \left(2 \cdot \color{blue}{\frac{x}{x - y}}\right) \cdot y \]
    4. Applied rewrites100.0%

      \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right) \cdot y} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right) \cdot y} \]
      2. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right)} \cdot y \]
      3. *-commutativeN/A

        \[\leadsto \color{blue}{\left(\frac{x}{x - y} \cdot 2\right)} \cdot y \]
      4. associate-*l*N/A

        \[\leadsto \color{blue}{\frac{x}{x - y} \cdot \left(2 \cdot y\right)} \]
      5. count-2-revN/A

        \[\leadsto \frac{x}{x - y} \cdot \color{blue}{\left(y + y\right)} \]
      6. flip-+N/A

        \[\leadsto \frac{x}{x - y} \cdot \color{blue}{\frac{y \cdot y - y \cdot y}{y - y}} \]
      7. difference-of-squaresN/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{\color{blue}{\left(y + y\right) \cdot \left(y - y\right)}}{y - y} \]
      8. count-2-revN/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{\color{blue}{\left(2 \cdot y\right)} \cdot \left(y - y\right)}{y - y} \]
      9. lift-*.f64N/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{\color{blue}{\left(2 \cdot y\right)} \cdot \left(y - y\right)}{y - y} \]
      10. +-inversesN/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{\left(2 \cdot y\right) \cdot \color{blue}{0}}{y - y} \]
      11. +-inversesN/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{\left(2 \cdot y\right) \cdot \color{blue}{\left(y \cdot y - y \cdot y\right)}}{y - y} \]
      12. +-inversesN/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{\left(2 \cdot y\right) \cdot \left(y \cdot y - y \cdot y\right)}{\color{blue}{0}} \]
      13. +-inversesN/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{\left(2 \cdot y\right) \cdot \left(y \cdot y - y \cdot y\right)}{\color{blue}{y \cdot y - y \cdot y}} \]
      14. lift-*.f64N/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{\color{blue}{\left(2 \cdot y\right)} \cdot \left(y \cdot y - y \cdot y\right)}{y \cdot y - y \cdot y} \]
      15. count-2-revN/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{\color{blue}{\left(y + y\right)} \cdot \left(y \cdot y - y \cdot y\right)}{y \cdot y - y \cdot y} \]
      16. +-inversesN/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{\left(y + y\right) \cdot \color{blue}{0}}{y \cdot y - y \cdot y} \]
      17. +-inversesN/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{\left(y + y\right) \cdot \color{blue}{\left(y - y\right)}}{y \cdot y - y \cdot y} \]
      18. difference-of-squaresN/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{\color{blue}{y \cdot y - y \cdot y}}{y \cdot y - y \cdot y} \]
      19. distribute-lft-out--N/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{\color{blue}{y \cdot \left(y - y\right)}}{y \cdot y - y \cdot y} \]
      20. +-inversesN/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{y \cdot \color{blue}{0}}{y \cdot y - y \cdot y} \]
      21. +-inversesN/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{y \cdot \color{blue}{\left(y \cdot y - y \cdot y\right)}}{y \cdot y - y \cdot y} \]
      22. +-inversesN/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{y \cdot \color{blue}{0}}{y \cdot y - y \cdot y} \]
      23. +-inversesN/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{y \cdot \color{blue}{\left(y - y\right)}}{y \cdot y - y \cdot y} \]
      24. distribute-lft-out--N/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{\color{blue}{y \cdot y - y \cdot y}}{y \cdot y - y \cdot y} \]
    6. Applied rewrites60.4%

      \[\leadsto \color{blue}{y + y} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification89.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \leq -\infty:\\ \;\;\;\;-2 \cdot x\\ \mathbf{elif}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \leq -5 \cdot 10^{-304}:\\ \;\;\;\;\frac{\left(x + x\right) \cdot y}{x - y}\\ \mathbf{elif}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \leq 0:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{y}{x}, y\right) \cdot 2\\ \mathbf{elif}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \leq 10^{+121}:\\ \;\;\;\;\frac{\left(x + x\right) \cdot y}{x - y}\\ \mathbf{else}:\\ \;\;\;\;y + y\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 93.7% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{-216} \lor \neg \left(y \leq 2.1 \cdot 10^{-131}\right):\\ \;\;\;\;x \cdot \left(\frac{2}{x - y} \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{y}{x}, y\right) \cdot 2\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (or (<= y -1e-216) (not (<= y 2.1e-131)))
   (* x (* (/ 2.0 (- x y)) y))
   (* (fma y (/ y x) y) 2.0)))
double code(double x, double y) {
	double tmp;
	if ((y <= -1e-216) || !(y <= 2.1e-131)) {
		tmp = x * ((2.0 / (x - y)) * y);
	} else {
		tmp = fma(y, (y / x), y) * 2.0;
	}
	return tmp;
}
function code(x, y)
	tmp = 0.0
	if ((y <= -1e-216) || !(y <= 2.1e-131))
		tmp = Float64(x * Float64(Float64(2.0 / Float64(x - y)) * y));
	else
		tmp = Float64(fma(y, Float64(y / x), y) * 2.0);
	end
	return tmp
end
code[x_, y_] := If[Or[LessEqual[y, -1e-216], N[Not[LessEqual[y, 2.1e-131]], $MachinePrecision]], N[(x * N[(N[(2.0 / N[(x - y), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(y / x), $MachinePrecision] + y), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-216} \lor \neg \left(y \leq 2.1 \cdot 10^{-131}\right):\\
\;\;\;\;x \cdot \left(\frac{2}{x - y} \cdot y\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{y}{x}, y\right) \cdot 2\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1e-216 or 2.09999999999999997e-131 < y

    1. Initial program 78.4%

      \[\frac{\left(x \cdot 2\right) \cdot y}{x - y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\left(x \cdot 2\right) \cdot y}{x - y}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(x \cdot 2\right) \cdot y}}{x - y} \]
      3. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{y \cdot \left(x \cdot 2\right)}}{x - y} \]
      4. associate-/l*N/A

        \[\leadsto \color{blue}{y \cdot \frac{x \cdot 2}{x - y}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{x \cdot 2}{x - y} \cdot y} \]
      6. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot 2}{x - y} \cdot y} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot 2}}{x - y} \cdot y \]
      8. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{2 \cdot x}}{x - y} \cdot y \]
      9. associate-/l*N/A

        \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right)} \cdot y \]
      10. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right)} \cdot y \]
      11. lower-/.f6485.9

        \[\leadsto \left(2 \cdot \color{blue}{\frac{x}{x - y}}\right) \cdot y \]
    4. Applied rewrites85.9%

      \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right) \cdot y} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right) \cdot y} \]
      2. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right)} \cdot y \]
      3. lift-/.f64N/A

        \[\leadsto \left(2 \cdot \color{blue}{\frac{x}{x - y}}\right) \cdot y \]
      4. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{2 \cdot x}{x - y}} \cdot y \]
      5. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{x \cdot 2}}{x - y} \cdot y \]
      6. associate-/l*N/A

        \[\leadsto \color{blue}{\left(x \cdot \frac{2}{x - y}\right)} \cdot y \]
      7. associate-*l*N/A

        \[\leadsto \color{blue}{x \cdot \left(\frac{2}{x - y} \cdot y\right)} \]
      8. lower-*.f64N/A

        \[\leadsto \color{blue}{x \cdot \left(\frac{2}{x - y} \cdot y\right)} \]
      9. lower-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(\frac{2}{x - y} \cdot y\right)} \]
      10. lower-/.f6497.3

        \[\leadsto x \cdot \left(\color{blue}{\frac{2}{x - y}} \cdot y\right) \]
    6. Applied rewrites97.3%

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

    if -1e-216 < y < 2.09999999999999997e-131

    1. Initial program 74.4%

      \[\frac{\left(x \cdot 2\right) \cdot y}{x - y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\left(x \cdot 2\right) \cdot y}{x - y}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(x \cdot 2\right) \cdot y}}{x - y} \]
      3. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{y \cdot \left(x \cdot 2\right)}}{x - y} \]
      4. associate-/l*N/A

        \[\leadsto \color{blue}{y \cdot \frac{x \cdot 2}{x - y}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{x \cdot 2}{x - y} \cdot y} \]
      6. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot 2}{x - y} \cdot y} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot 2}}{x - y} \cdot y \]
      8. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{2 \cdot x}}{x - y} \cdot y \]
      9. associate-/l*N/A

        \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right)} \cdot y \]
      10. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right)} \cdot y \]
      11. lower-/.f64100.0

        \[\leadsto \left(2 \cdot \color{blue}{\frac{x}{x - y}}\right) \cdot y \]
    4. Applied rewrites100.0%

      \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right) \cdot y} \]
    5. Taylor expanded in x around inf

      \[\leadsto \color{blue}{2 \cdot y + 2 \cdot \frac{{y}^{2}}{x}} \]
    6. Step-by-step derivation
      1. distribute-lft-outN/A

        \[\leadsto \color{blue}{2 \cdot \left(y + \frac{{y}^{2}}{x}\right)} \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{\left(y + \frac{{y}^{2}}{x}\right) \cdot 2} \]
      3. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(y + \frac{{y}^{2}}{x}\right) \cdot 2} \]
      4. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\frac{{y}^{2}}{x} + y\right)} \cdot 2 \]
      5. unpow2N/A

        \[\leadsto \left(\frac{\color{blue}{y \cdot y}}{x} + y\right) \cdot 2 \]
      6. associate-/l*N/A

        \[\leadsto \left(\color{blue}{y \cdot \frac{y}{x}} + y\right) \cdot 2 \]
      7. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{y}{x}, y\right)} \cdot 2 \]
      8. lower-/.f6498.2

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{y}{x}}, y\right) \cdot 2 \]
    7. Applied rewrites98.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{y}{x}, y\right) \cdot 2} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{-216} \lor \neg \left(y \leq 2.1 \cdot 10^{-131}\right):\\ \;\;\;\;x \cdot \left(\frac{2}{x - y} \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{y}{x}, y\right) \cdot 2\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 75.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{-7} \lor \neg \left(y \leq 8.3 \cdot 10^{-35}\right):\\ \;\;\;\;-2 \cdot x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{y}{x}, y\right) \cdot 2\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (or (<= y -1e-7) (not (<= y 8.3e-35)))
   (* -2.0 x)
   (* (fma y (/ y x) y) 2.0)))
double code(double x, double y) {
	double tmp;
	if ((y <= -1e-7) || !(y <= 8.3e-35)) {
		tmp = -2.0 * x;
	} else {
		tmp = fma(y, (y / x), y) * 2.0;
	}
	return tmp;
}
function code(x, y)
	tmp = 0.0
	if ((y <= -1e-7) || !(y <= 8.3e-35))
		tmp = Float64(-2.0 * x);
	else
		tmp = Float64(fma(y, Float64(y / x), y) * 2.0);
	end
	return tmp
end
code[x_, y_] := If[Or[LessEqual[y, -1e-7], N[Not[LessEqual[y, 8.3e-35]], $MachinePrecision]], N[(-2.0 * x), $MachinePrecision], N[(N[(y * N[(y / x), $MachinePrecision] + y), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-7} \lor \neg \left(y \leq 8.3 \cdot 10^{-35}\right):\\
\;\;\;\;-2 \cdot x\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{y}{x}, y\right) \cdot 2\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9.9999999999999995e-8 or 8.2999999999999997e-35 < y

    1. Initial program 75.0%

      \[\frac{\left(x \cdot 2\right) \cdot y}{x - y} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{-2 \cdot x} \]
    4. Step-by-step derivation
      1. lower-*.f6474.2

        \[\leadsto \color{blue}{-2 \cdot x} \]
    5. Applied rewrites74.2%

      \[\leadsto \color{blue}{-2 \cdot x} \]

    if -9.9999999999999995e-8 < y < 8.2999999999999997e-35

    1. Initial program 80.6%

      \[\frac{\left(x \cdot 2\right) \cdot y}{x - y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\left(x \cdot 2\right) \cdot y}{x - y}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(x \cdot 2\right) \cdot y}}{x - y} \]
      3. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{y \cdot \left(x \cdot 2\right)}}{x - y} \]
      4. associate-/l*N/A

        \[\leadsto \color{blue}{y \cdot \frac{x \cdot 2}{x - y}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{x \cdot 2}{x - y} \cdot y} \]
      6. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot 2}{x - y} \cdot y} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot 2}}{x - y} \cdot y \]
      8. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{2 \cdot x}}{x - y} \cdot y \]
      9. associate-/l*N/A

        \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right)} \cdot y \]
      10. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right)} \cdot y \]
      11. lower-/.f64100.0

        \[\leadsto \left(2 \cdot \color{blue}{\frac{x}{x - y}}\right) \cdot y \]
    4. Applied rewrites100.0%

      \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right) \cdot y} \]
    5. Taylor expanded in x around inf

      \[\leadsto \color{blue}{2 \cdot y + 2 \cdot \frac{{y}^{2}}{x}} \]
    6. Step-by-step derivation
      1. distribute-lft-outN/A

        \[\leadsto \color{blue}{2 \cdot \left(y + \frac{{y}^{2}}{x}\right)} \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{\left(y + \frac{{y}^{2}}{x}\right) \cdot 2} \]
      3. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(y + \frac{{y}^{2}}{x}\right) \cdot 2} \]
      4. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\frac{{y}^{2}}{x} + y\right)} \cdot 2 \]
      5. unpow2N/A

        \[\leadsto \left(\frac{\color{blue}{y \cdot y}}{x} + y\right) \cdot 2 \]
      6. associate-/l*N/A

        \[\leadsto \left(\color{blue}{y \cdot \frac{y}{x}} + y\right) \cdot 2 \]
      7. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{y}{x}, y\right)} \cdot 2 \]
      8. lower-/.f6480.9

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{y}{x}}, y\right) \cdot 2 \]
    7. Applied rewrites80.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{y}{x}, y\right) \cdot 2} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification77.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{-7} \lor \neg \left(y \leq 8.3 \cdot 10^{-35}\right):\\ \;\;\;\;-2 \cdot x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{y}{x}, y\right) \cdot 2\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 75.7% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{-7} \lor \neg \left(y \leq 4.6 \cdot 10^{-17}\right):\\ \;\;\;\;-2 \cdot x\\ \mathbf{else}:\\ \;\;\;\;y + y\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (or (<= y -1e-7) (not (<= y 4.6e-17))) (* -2.0 x) (+ y y)))
double code(double x, double y) {
	double tmp;
	if ((y <= -1e-7) || !(y <= 4.6e-17)) {
		tmp = -2.0 * x;
	} else {
		tmp = y + y;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if ((y <= (-1d-7)) .or. (.not. (y <= 4.6d-17))) then
        tmp = (-2.0d0) * x
    else
        tmp = y + y
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if ((y <= -1e-7) || !(y <= 4.6e-17)) {
		tmp = -2.0 * x;
	} else {
		tmp = y + y;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if (y <= -1e-7) or not (y <= 4.6e-17):
		tmp = -2.0 * x
	else:
		tmp = y + y
	return tmp
function code(x, y)
	tmp = 0.0
	if ((y <= -1e-7) || !(y <= 4.6e-17))
		tmp = Float64(-2.0 * x);
	else
		tmp = Float64(y + y);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if ((y <= -1e-7) || ~((y <= 4.6e-17)))
		tmp = -2.0 * x;
	else
		tmp = y + y;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[Or[LessEqual[y, -1e-7], N[Not[LessEqual[y, 4.6e-17]], $MachinePrecision]], N[(-2.0 * x), $MachinePrecision], N[(y + y), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-7} \lor \neg \left(y \leq 4.6 \cdot 10^{-17}\right):\\
\;\;\;\;-2 \cdot x\\

\mathbf{else}:\\
\;\;\;\;y + y\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9.9999999999999995e-8 or 4.60000000000000018e-17 < y

    1. Initial program 74.3%

      \[\frac{\left(x \cdot 2\right) \cdot y}{x - y} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{-2 \cdot x} \]
    4. Step-by-step derivation
      1. lower-*.f6474.9

        \[\leadsto \color{blue}{-2 \cdot x} \]
    5. Applied rewrites74.9%

      \[\leadsto \color{blue}{-2 \cdot x} \]

    if -9.9999999999999995e-8 < y < 4.60000000000000018e-17

    1. Initial program 81.3%

      \[\frac{\left(x \cdot 2\right) \cdot y}{x - y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\left(x \cdot 2\right) \cdot y}{x - y}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(x \cdot 2\right) \cdot y}}{x - y} \]
      3. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{y \cdot \left(x \cdot 2\right)}}{x - y} \]
      4. associate-/l*N/A

        \[\leadsto \color{blue}{y \cdot \frac{x \cdot 2}{x - y}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{x \cdot 2}{x - y} \cdot y} \]
      6. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot 2}{x - y} \cdot y} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot 2}}{x - y} \cdot y \]
      8. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{2 \cdot x}}{x - y} \cdot y \]
      9. associate-/l*N/A

        \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right)} \cdot y \]
      10. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right)} \cdot y \]
      11. lower-/.f64100.0

        \[\leadsto \left(2 \cdot \color{blue}{\frac{x}{x - y}}\right) \cdot y \]
    4. Applied rewrites100.0%

      \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right) \cdot y} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right) \cdot y} \]
      2. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right)} \cdot y \]
      3. *-commutativeN/A

        \[\leadsto \color{blue}{\left(\frac{x}{x - y} \cdot 2\right)} \cdot y \]
      4. associate-*l*N/A

        \[\leadsto \color{blue}{\frac{x}{x - y} \cdot \left(2 \cdot y\right)} \]
      5. count-2-revN/A

        \[\leadsto \frac{x}{x - y} \cdot \color{blue}{\left(y + y\right)} \]
      6. flip-+N/A

        \[\leadsto \frac{x}{x - y} \cdot \color{blue}{\frac{y \cdot y - y \cdot y}{y - y}} \]
      7. difference-of-squaresN/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{\color{blue}{\left(y + y\right) \cdot \left(y - y\right)}}{y - y} \]
      8. count-2-revN/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{\color{blue}{\left(2 \cdot y\right)} \cdot \left(y - y\right)}{y - y} \]
      9. lift-*.f64N/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{\color{blue}{\left(2 \cdot y\right)} \cdot \left(y - y\right)}{y - y} \]
      10. +-inversesN/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{\left(2 \cdot y\right) \cdot \color{blue}{0}}{y - y} \]
      11. +-inversesN/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{\left(2 \cdot y\right) \cdot \color{blue}{\left(y \cdot y - y \cdot y\right)}}{y - y} \]
      12. +-inversesN/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{\left(2 \cdot y\right) \cdot \left(y \cdot y - y \cdot y\right)}{\color{blue}{0}} \]
      13. +-inversesN/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{\left(2 \cdot y\right) \cdot \left(y \cdot y - y \cdot y\right)}{\color{blue}{y \cdot y - y \cdot y}} \]
      14. lift-*.f64N/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{\color{blue}{\left(2 \cdot y\right)} \cdot \left(y \cdot y - y \cdot y\right)}{y \cdot y - y \cdot y} \]
      15. count-2-revN/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{\color{blue}{\left(y + y\right)} \cdot \left(y \cdot y - y \cdot y\right)}{y \cdot y - y \cdot y} \]
      16. +-inversesN/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{\left(y + y\right) \cdot \color{blue}{0}}{y \cdot y - y \cdot y} \]
      17. +-inversesN/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{\left(y + y\right) \cdot \color{blue}{\left(y - y\right)}}{y \cdot y - y \cdot y} \]
      18. difference-of-squaresN/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{\color{blue}{y \cdot y - y \cdot y}}{y \cdot y - y \cdot y} \]
      19. distribute-lft-out--N/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{\color{blue}{y \cdot \left(y - y\right)}}{y \cdot y - y \cdot y} \]
      20. +-inversesN/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{y \cdot \color{blue}{0}}{y \cdot y - y \cdot y} \]
      21. +-inversesN/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{y \cdot \color{blue}{\left(y \cdot y - y \cdot y\right)}}{y \cdot y - y \cdot y} \]
      22. +-inversesN/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{y \cdot \color{blue}{0}}{y \cdot y - y \cdot y} \]
      23. +-inversesN/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{y \cdot \color{blue}{\left(y - y\right)}}{y \cdot y - y \cdot y} \]
      24. distribute-lft-out--N/A

        \[\leadsto \frac{x}{x - y} \cdot \frac{\color{blue}{y \cdot y - y \cdot y}}{y \cdot y - y \cdot y} \]
    6. Applied rewrites79.8%

      \[\leadsto \color{blue}{y + y} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification77.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{-7} \lor \neg \left(y \leq 4.6 \cdot 10^{-17}\right):\\ \;\;\;\;-2 \cdot x\\ \mathbf{else}:\\ \;\;\;\;y + y\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 50.5% accurate, 6.3× speedup?

\[\begin{array}{l} \\ y + y \end{array} \]
(FPCore (x y) :precision binary64 (+ y y))
double code(double x, double y) {
	return y + y;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = y + y
end function
public static double code(double x, double y) {
	return y + y;
}
def code(x, y):
	return y + y
function code(x, y)
	return Float64(y + y)
end
function tmp = code(x, y)
	tmp = y + y;
end
code[x_, y_] := N[(y + y), $MachinePrecision]
\begin{array}{l}

\\
y + y
\end{array}
Derivation
  1. Initial program 77.6%

    \[\frac{\left(x \cdot 2\right) \cdot y}{x - y} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \color{blue}{\frac{\left(x \cdot 2\right) \cdot y}{x - y}} \]
    2. lift-*.f64N/A

      \[\leadsto \frac{\color{blue}{\left(x \cdot 2\right) \cdot y}}{x - y} \]
    3. *-commutativeN/A

      \[\leadsto \frac{\color{blue}{y \cdot \left(x \cdot 2\right)}}{x - y} \]
    4. associate-/l*N/A

      \[\leadsto \color{blue}{y \cdot \frac{x \cdot 2}{x - y}} \]
    5. *-commutativeN/A

      \[\leadsto \color{blue}{\frac{x \cdot 2}{x - y} \cdot y} \]
    6. lower-*.f64N/A

      \[\leadsto \color{blue}{\frac{x \cdot 2}{x - y} \cdot y} \]
    7. lift-*.f64N/A

      \[\leadsto \frac{\color{blue}{x \cdot 2}}{x - y} \cdot y \]
    8. *-commutativeN/A

      \[\leadsto \frac{\color{blue}{2 \cdot x}}{x - y} \cdot y \]
    9. associate-/l*N/A

      \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right)} \cdot y \]
    10. lower-*.f64N/A

      \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right)} \cdot y \]
    11. lower-/.f6488.8

      \[\leadsto \left(2 \cdot \color{blue}{\frac{x}{x - y}}\right) \cdot y \]
  4. Applied rewrites88.8%

    \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right) \cdot y} \]
  5. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right) \cdot y} \]
    2. lift-*.f64N/A

      \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right)} \cdot y \]
    3. *-commutativeN/A

      \[\leadsto \color{blue}{\left(\frac{x}{x - y} \cdot 2\right)} \cdot y \]
    4. associate-*l*N/A

      \[\leadsto \color{blue}{\frac{x}{x - y} \cdot \left(2 \cdot y\right)} \]
    5. count-2-revN/A

      \[\leadsto \frac{x}{x - y} \cdot \color{blue}{\left(y + y\right)} \]
    6. flip-+N/A

      \[\leadsto \frac{x}{x - y} \cdot \color{blue}{\frac{y \cdot y - y \cdot y}{y - y}} \]
    7. difference-of-squaresN/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{\color{blue}{\left(y + y\right) \cdot \left(y - y\right)}}{y - y} \]
    8. count-2-revN/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{\color{blue}{\left(2 \cdot y\right)} \cdot \left(y - y\right)}{y - y} \]
    9. lift-*.f64N/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{\color{blue}{\left(2 \cdot y\right)} \cdot \left(y - y\right)}{y - y} \]
    10. +-inversesN/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{\left(2 \cdot y\right) \cdot \color{blue}{0}}{y - y} \]
    11. +-inversesN/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{\left(2 \cdot y\right) \cdot \color{blue}{\left(y \cdot y - y \cdot y\right)}}{y - y} \]
    12. +-inversesN/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{\left(2 \cdot y\right) \cdot \left(y \cdot y - y \cdot y\right)}{\color{blue}{0}} \]
    13. +-inversesN/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{\left(2 \cdot y\right) \cdot \left(y \cdot y - y \cdot y\right)}{\color{blue}{y \cdot y - y \cdot y}} \]
    14. lift-*.f64N/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{\color{blue}{\left(2 \cdot y\right)} \cdot \left(y \cdot y - y \cdot y\right)}{y \cdot y - y \cdot y} \]
    15. count-2-revN/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{\color{blue}{\left(y + y\right)} \cdot \left(y \cdot y - y \cdot y\right)}{y \cdot y - y \cdot y} \]
    16. +-inversesN/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{\left(y + y\right) \cdot \color{blue}{0}}{y \cdot y - y \cdot y} \]
    17. +-inversesN/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{\left(y + y\right) \cdot \color{blue}{\left(y - y\right)}}{y \cdot y - y \cdot y} \]
    18. difference-of-squaresN/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{\color{blue}{y \cdot y - y \cdot y}}{y \cdot y - y \cdot y} \]
    19. distribute-lft-out--N/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{\color{blue}{y \cdot \left(y - y\right)}}{y \cdot y - y \cdot y} \]
    20. +-inversesN/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{y \cdot \color{blue}{0}}{y \cdot y - y \cdot y} \]
    21. +-inversesN/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{y \cdot \color{blue}{\left(y \cdot y - y \cdot y\right)}}{y \cdot y - y \cdot y} \]
    22. +-inversesN/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{y \cdot \color{blue}{0}}{y \cdot y - y \cdot y} \]
    23. +-inversesN/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{y \cdot \color{blue}{\left(y - y\right)}}{y \cdot y - y \cdot y} \]
    24. distribute-lft-out--N/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{\color{blue}{y \cdot y - y \cdot y}}{y \cdot y - y \cdot y} \]
  6. Applied rewrites51.5%

    \[\leadsto \color{blue}{y + y} \]
  7. Add Preprocessing

Alternative 7: 3.4% accurate, 6.3× speedup?

\[\begin{array}{l} \\ x + x \end{array} \]
(FPCore (x y) :precision binary64 (+ x x))
double code(double x, double y) {
	return x + x;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = x + x
end function
public static double code(double x, double y) {
	return x + x;
}
def code(x, y):
	return x + x
function code(x, y)
	return Float64(x + x)
end
function tmp = code(x, y)
	tmp = x + x;
end
code[x_, y_] := N[(x + x), $MachinePrecision]
\begin{array}{l}

\\
x + x
\end{array}
Derivation
  1. Initial program 77.6%

    \[\frac{\left(x \cdot 2\right) \cdot y}{x - y} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \color{blue}{\frac{\left(x \cdot 2\right) \cdot y}{x - y}} \]
    2. lift-*.f64N/A

      \[\leadsto \frac{\color{blue}{\left(x \cdot 2\right) \cdot y}}{x - y} \]
    3. *-commutativeN/A

      \[\leadsto \frac{\color{blue}{y \cdot \left(x \cdot 2\right)}}{x - y} \]
    4. associate-/l*N/A

      \[\leadsto \color{blue}{y \cdot \frac{x \cdot 2}{x - y}} \]
    5. *-commutativeN/A

      \[\leadsto \color{blue}{\frac{x \cdot 2}{x - y} \cdot y} \]
    6. lower-*.f64N/A

      \[\leadsto \color{blue}{\frac{x \cdot 2}{x - y} \cdot y} \]
    7. lift-*.f64N/A

      \[\leadsto \frac{\color{blue}{x \cdot 2}}{x - y} \cdot y \]
    8. *-commutativeN/A

      \[\leadsto \frac{\color{blue}{2 \cdot x}}{x - y} \cdot y \]
    9. associate-/l*N/A

      \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right)} \cdot y \]
    10. lower-*.f64N/A

      \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right)} \cdot y \]
    11. lower-/.f6488.8

      \[\leadsto \left(2 \cdot \color{blue}{\frac{x}{x - y}}\right) \cdot y \]
  4. Applied rewrites88.8%

    \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right) \cdot y} \]
  5. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right) \cdot y} \]
    2. lift-*.f64N/A

      \[\leadsto \color{blue}{\left(2 \cdot \frac{x}{x - y}\right)} \cdot y \]
    3. *-commutativeN/A

      \[\leadsto \color{blue}{\left(\frac{x}{x - y} \cdot 2\right)} \cdot y \]
    4. associate-*l*N/A

      \[\leadsto \color{blue}{\frac{x}{x - y} \cdot \left(2 \cdot y\right)} \]
    5. count-2-revN/A

      \[\leadsto \frac{x}{x - y} \cdot \color{blue}{\left(y + y\right)} \]
    6. flip-+N/A

      \[\leadsto \frac{x}{x - y} \cdot \color{blue}{\frac{y \cdot y - y \cdot y}{y - y}} \]
    7. difference-of-squaresN/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{\color{blue}{\left(y + y\right) \cdot \left(y - y\right)}}{y - y} \]
    8. count-2-revN/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{\color{blue}{\left(2 \cdot y\right)} \cdot \left(y - y\right)}{y - y} \]
    9. lift-*.f64N/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{\color{blue}{\left(2 \cdot y\right)} \cdot \left(y - y\right)}{y - y} \]
    10. +-inversesN/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{\left(2 \cdot y\right) \cdot \color{blue}{0}}{y - y} \]
    11. +-inversesN/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{\left(2 \cdot y\right) \cdot \color{blue}{\left(y \cdot y - y \cdot y\right)}}{y - y} \]
    12. +-inversesN/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{\left(2 \cdot y\right) \cdot \left(y \cdot y - y \cdot y\right)}{\color{blue}{0}} \]
    13. +-inversesN/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{\left(2 \cdot y\right) \cdot \left(y \cdot y - y \cdot y\right)}{\color{blue}{y \cdot y - y \cdot y}} \]
    14. lift-*.f64N/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{\color{blue}{\left(2 \cdot y\right)} \cdot \left(y \cdot y - y \cdot y\right)}{y \cdot y - y \cdot y} \]
    15. count-2-revN/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{\color{blue}{\left(y + y\right)} \cdot \left(y \cdot y - y \cdot y\right)}{y \cdot y - y \cdot y} \]
    16. +-inversesN/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{\left(y + y\right) \cdot \color{blue}{0}}{y \cdot y - y \cdot y} \]
    17. +-inversesN/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{\left(y + y\right) \cdot \color{blue}{\left(y - y\right)}}{y \cdot y - y \cdot y} \]
    18. difference-of-squaresN/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{\color{blue}{y \cdot y - y \cdot y}}{y \cdot y - y \cdot y} \]
    19. distribute-lft-out--N/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{\color{blue}{y \cdot \left(y - y\right)}}{y \cdot y - y \cdot y} \]
    20. +-inversesN/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{y \cdot \color{blue}{0}}{y \cdot y - y \cdot y} \]
    21. +-inversesN/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{y \cdot \color{blue}{\left(y \cdot y - y \cdot y\right)}}{y \cdot y - y \cdot y} \]
    22. +-inversesN/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{y \cdot \color{blue}{0}}{y \cdot y - y \cdot y} \]
    23. +-inversesN/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{y \cdot \color{blue}{\left(y - y\right)}}{y \cdot y - y \cdot y} \]
    24. distribute-lft-out--N/A

      \[\leadsto \frac{x}{x - y} \cdot \frac{\color{blue}{y \cdot y - y \cdot y}}{y \cdot y - y \cdot y} \]
  6. Applied rewrites51.5%

    \[\leadsto \color{blue}{y + y} \]
  7. Step-by-step derivation
    1. lift-+.f64N/A

      \[\leadsto \color{blue}{y + y} \]
    2. flip-+N/A

      \[\leadsto \color{blue}{\frac{y \cdot y - y \cdot y}{y - y}} \]
    3. +-inversesN/A

      \[\leadsto \frac{\color{blue}{0}}{y - y} \]
    4. +-inversesN/A

      \[\leadsto \frac{\color{blue}{x \cdot x - x \cdot x}}{y - y} \]
    5. +-inversesN/A

      \[\leadsto \frac{x \cdot x - x \cdot x}{\color{blue}{0}} \]
    6. +-inversesN/A

      \[\leadsto \frac{x \cdot x - x \cdot x}{\color{blue}{x - x}} \]
    7. flip-+N/A

      \[\leadsto \color{blue}{x + x} \]
    8. lift-+.f643.3

      \[\leadsto \color{blue}{x + x} \]
  8. Applied rewrites3.3%

    \[\leadsto \color{blue}{x + x} \]
  9. Add Preprocessing

Developer Target 1: 99.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{2 \cdot x}{x - y} \cdot y\\ \mathbf{if}\;x < -1.7210442634149447 \cdot 10^{+81}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x < 83645045635564430:\\ \;\;\;\;\frac{x \cdot 2}{\frac{x - y}{y}}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* (/ (* 2.0 x) (- x y)) y)))
   (if (< x -1.7210442634149447e+81)
     t_0
     (if (< x 83645045635564430.0) (/ (* x 2.0) (/ (- x y) y)) t_0))))
double code(double x, double y) {
	double t_0 = ((2.0 * x) / (x - y)) * y;
	double tmp;
	if (x < -1.7210442634149447e+81) {
		tmp = t_0;
	} else if (x < 83645045635564430.0) {
		tmp = (x * 2.0) / ((x - y) / y);
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: tmp
    t_0 = ((2.0d0 * x) / (x - y)) * y
    if (x < (-1.7210442634149447d+81)) then
        tmp = t_0
    else if (x < 83645045635564430.0d0) then
        tmp = (x * 2.0d0) / ((x - y) / y)
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = ((2.0 * x) / (x - y)) * y;
	double tmp;
	if (x < -1.7210442634149447e+81) {
		tmp = t_0;
	} else if (x < 83645045635564430.0) {
		tmp = (x * 2.0) / ((x - y) / y);
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y):
	t_0 = ((2.0 * x) / (x - y)) * y
	tmp = 0
	if x < -1.7210442634149447e+81:
		tmp = t_0
	elif x < 83645045635564430.0:
		tmp = (x * 2.0) / ((x - y) / y)
	else:
		tmp = t_0
	return tmp
function code(x, y)
	t_0 = Float64(Float64(Float64(2.0 * x) / Float64(x - y)) * y)
	tmp = 0.0
	if (x < -1.7210442634149447e+81)
		tmp = t_0;
	elseif (x < 83645045635564430.0)
		tmp = Float64(Float64(x * 2.0) / Float64(Float64(x - y) / y));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = ((2.0 * x) / (x - y)) * y;
	tmp = 0.0;
	if (x < -1.7210442634149447e+81)
		tmp = t_0;
	elseif (x < 83645045635564430.0)
		tmp = (x * 2.0) / ((x - y) / y);
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[(2.0 * x), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[Less[x, -1.7210442634149447e+81], t$95$0, If[Less[x, 83645045635564430.0], N[(N[(x * 2.0), $MachinePrecision] / N[(N[(x - y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{2 \cdot x}{x - y} \cdot y\\
\mathbf{if}\;x < -1.7210442634149447 \cdot 10^{+81}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;x < 83645045635564430:\\
\;\;\;\;\frac{x \cdot 2}{\frac{x - y}{y}}\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024342 
(FPCore (x y)
  :name "Linear.Projection:perspective from linear-1.19.1.3, B"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< x -1721044263414944700000000000000000000000000000000000000000000000000000000000000000) (* (/ (* 2 x) (- x y)) y) (if (< x 83645045635564430) (/ (* x 2) (/ (- x y) y)) (* (/ (* 2 x) (- x y)) y))))

  (/ (* (* x 2.0) y) (- x y)))