Linear.Projection:perspective from linear-1.19.1.3, B

Percentage Accurate: 76.2% → 99.7%
Time: 4.9s
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: 76.2% 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.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9.99999999999999965e-65 or 1.9999999999999999e-7 < y

    1. Initial program 83.4%

      \[\frac{\left(x \cdot 2\right) \cdot y}{x - y} \]
    2. Step-by-step derivation
      1. associate-/l*99.9%

        \[\leadsto \color{blue}{\frac{x \cdot 2}{\frac{x - y}{y}}} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{x \cdot 2}{\frac{x - y}{y}}} \]
    4. Taylor expanded in x around 0 100.0%

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

    if -9.99999999999999965e-65 < y < 1.9999999999999999e-7

    1. Initial program 69.7%

      \[\frac{\left(x \cdot 2\right) \cdot y}{x - y} \]
    2. Step-by-step derivation
      1. *-commutative69.7%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{x - y}{x \cdot 2}}} \]
      3. div-sub99.1%

        \[\leadsto \frac{y}{\color{blue}{\frac{x}{x \cdot 2} - \frac{y}{x \cdot 2}}} \]
      4. sub-neg99.1%

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

        \[\leadsto \frac{y}{\color{blue}{\left(-\frac{y}{x \cdot 2}\right) + \frac{x}{x \cdot 2}}} \]
      6. distribute-neg-frac99.1%

        \[\leadsto \frac{y}{\color{blue}{\frac{-y}{x \cdot 2}} + \frac{x}{x \cdot 2}} \]
      7. neg-mul-199.1%

        \[\leadsto \frac{y}{\frac{\color{blue}{-1 \cdot y}}{x \cdot 2} + \frac{x}{x \cdot 2}} \]
      8. *-commutative99.1%

        \[\leadsto \frac{y}{\frac{\color{blue}{y \cdot -1}}{x \cdot 2} + \frac{x}{x \cdot 2}} \]
      9. times-frac99.1%

        \[\leadsto \frac{y}{\color{blue}{\frac{y}{x} \cdot \frac{-1}{2}} + \frac{x}{x \cdot 2}} \]
      10. metadata-eval99.1%

        \[\leadsto \frac{y}{\frac{y}{x} \cdot \color{blue}{-0.5} + \frac{x}{x \cdot 2}} \]
      11. metadata-eval99.1%

        \[\leadsto \frac{y}{\frac{y}{x} \cdot \color{blue}{\left(-0.5\right)} + \frac{x}{x \cdot 2}} \]
      12. metadata-eval99.1%

        \[\leadsto \frac{y}{\frac{y}{x} \cdot \left(-\color{blue}{\frac{1}{2}}\right) + \frac{x}{x \cdot 2}} \]
      13. *-inverses99.1%

        \[\leadsto \frac{y}{\frac{y}{x} \cdot \left(-\frac{\color{blue}{\frac{y}{y}}}{2}\right) + \frac{x}{x \cdot 2}} \]
      14. associate-/r*99.1%

        \[\leadsto \frac{y}{\frac{y}{x} \cdot \left(-\color{blue}{\frac{y}{y \cdot 2}}\right) + \frac{x}{x \cdot 2}} \]
      15. *-commutative99.1%

        \[\leadsto \frac{y}{\frac{y}{x} \cdot \left(-\frac{y}{\color{blue}{2 \cdot y}}\right) + \frac{x}{x \cdot 2}} \]
      16. associate-/r*100.0%

        \[\leadsto \frac{y}{\frac{y}{x} \cdot \left(-\frac{y}{2 \cdot y}\right) + \color{blue}{\frac{\frac{x}{x}}{2}}} \]
      17. *-inverses100.0%

        \[\leadsto \frac{y}{\frac{y}{x} \cdot \left(-\frac{y}{2 \cdot y}\right) + \frac{\color{blue}{1}}{2}} \]
      18. *-inverses100.0%

        \[\leadsto \frac{y}{\frac{y}{x} \cdot \left(-\frac{y}{2 \cdot y}\right) + \frac{\color{blue}{\frac{y}{y}}}{2}} \]
      19. associate-/r*100.0%

        \[\leadsto \frac{y}{\frac{y}{x} \cdot \left(-\frac{y}{2 \cdot y}\right) + \color{blue}{\frac{y}{y \cdot 2}}} \]
      20. *-commutative100.0%

        \[\leadsto \frac{y}{\frac{y}{x} \cdot \left(-\frac{y}{2 \cdot y}\right) + \frac{y}{\color{blue}{2 \cdot y}}} \]
      21. fma-def100.0%

        \[\leadsto \frac{y}{\color{blue}{\mathsf{fma}\left(\frac{y}{x}, -\frac{y}{2 \cdot y}, \frac{y}{2 \cdot y}\right)}} \]
    3. Simplified100.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{-64} \lor \neg \left(y \leq 2 \cdot 10^{-7}\right):\\ \;\;\;\;\frac{x \cdot 2}{\frac{x}{y} + -1}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\mathsf{fma}\left(\frac{y}{x}, -0.5, 0.5\right)}\\ \end{array} \]

Alternative 2: 98.6% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -9 \cdot 10^{-108}:\\ \;\;\;\;\frac{x}{\mathsf{fma}\left(0.5, \frac{x}{y}, -0.5\right)}\\ \mathbf{elif}\;y \leq 9.2 \cdot 10^{-89}:\\ \;\;\;\;y \cdot \frac{x \cdot 2}{x - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot 2}{\frac{x}{y} + -1}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y -9e-108)
   (/ x (fma 0.5 (/ x y) -0.5))
   (if (<= y 9.2e-89)
     (* y (/ (* x 2.0) (- x y)))
     (/ (* x 2.0) (+ (/ x y) -1.0)))))
double code(double x, double y) {
	double tmp;
	if (y <= -9e-108) {
		tmp = x / fma(0.5, (x / y), -0.5);
	} else if (y <= 9.2e-89) {
		tmp = y * ((x * 2.0) / (x - y));
	} else {
		tmp = (x * 2.0) / ((x / y) + -1.0);
	}
	return tmp;
}
function code(x, y)
	tmp = 0.0
	if (y <= -9e-108)
		tmp = Float64(x / fma(0.5, Float64(x / y), -0.5));
	elseif (y <= 9.2e-89)
		tmp = Float64(y * Float64(Float64(x * 2.0) / Float64(x - y)));
	else
		tmp = Float64(Float64(x * 2.0) / Float64(Float64(x / y) + -1.0));
	end
	return tmp
end
code[x_, y_] := If[LessEqual[y, -9e-108], N[(x / N[(0.5 * N[(x / y), $MachinePrecision] + -0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.2e-89], N[(y * N[(N[(x * 2.0), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] / N[(N[(x / y), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{-108}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(0.5, \frac{x}{y}, -0.5\right)}\\

\mathbf{elif}\;y \leq 9.2 \cdot 10^{-89}:\\
\;\;\;\;y \cdot \frac{x \cdot 2}{x - y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -8.99999999999999941e-108

    1. Initial program 80.9%

      \[\frac{\left(x \cdot 2\right) \cdot y}{x - y} \]
    2. Step-by-step derivation
      1. associate-*l*82.0%

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

        \[\leadsto \color{blue}{\frac{x}{\frac{x - y}{2 \cdot y}}} \]
      3. div-sub98.9%

        \[\leadsto \frac{x}{\color{blue}{\frac{x}{2 \cdot y} - \frac{y}{2 \cdot y}}} \]
      4. remove-double-neg98.9%

        \[\leadsto \frac{x}{\frac{\color{blue}{-\left(-x\right)}}{2 \cdot y} - \frac{y}{2 \cdot y}} \]
      5. remove-double-neg98.9%

        \[\leadsto \frac{x}{\frac{\color{blue}{x}}{2 \cdot y} - \frac{y}{2 \cdot y}} \]
      6. *-lft-identity98.9%

        \[\leadsto \frac{x}{\frac{\color{blue}{1 \cdot x}}{2 \cdot y} - \frac{y}{2 \cdot y}} \]
      7. *-inverses98.9%

        \[\leadsto \frac{x}{\frac{\color{blue}{\frac{x}{x}} \cdot x}{2 \cdot y} - \frac{y}{2 \cdot y}} \]
      8. times-frac98.9%

        \[\leadsto \frac{x}{\color{blue}{\frac{\frac{x}{x}}{2} \cdot \frac{x}{y}} - \frac{y}{2 \cdot y}} \]
      9. *-inverses98.9%

        \[\leadsto \frac{x}{\frac{\color{blue}{1}}{2} \cdot \frac{x}{y} - \frac{y}{2 \cdot y}} \]
      10. *-inverses98.9%

        \[\leadsto \frac{x}{\frac{\color{blue}{\frac{y}{y}}}{2} \cdot \frac{x}{y} - \frac{y}{2 \cdot y}} \]
      11. associate-/r*98.9%

        \[\leadsto \frac{x}{\color{blue}{\frac{y}{y \cdot 2}} \cdot \frac{x}{y} - \frac{y}{2 \cdot y}} \]
      12. *-commutative98.9%

        \[\leadsto \frac{x}{\frac{y}{\color{blue}{2 \cdot y}} \cdot \frac{x}{y} - \frac{y}{2 \cdot y}} \]
      13. fma-neg98.9%

        \[\leadsto \frac{x}{\color{blue}{\mathsf{fma}\left(\frac{y}{2 \cdot y}, \frac{x}{y}, -\frac{y}{2 \cdot y}\right)}} \]
      14. *-commutative98.9%

        \[\leadsto \frac{x}{\mathsf{fma}\left(\frac{y}{\color{blue}{y \cdot 2}}, \frac{x}{y}, -\frac{y}{2 \cdot y}\right)} \]
      15. associate-/r*98.9%

        \[\leadsto \frac{x}{\mathsf{fma}\left(\color{blue}{\frac{\frac{y}{y}}{2}}, \frac{x}{y}, -\frac{y}{2 \cdot y}\right)} \]
      16. *-inverses98.9%

        \[\leadsto \frac{x}{\mathsf{fma}\left(\frac{\color{blue}{1}}{2}, \frac{x}{y}, -\frac{y}{2 \cdot y}\right)} \]
      17. metadata-eval98.9%

        \[\leadsto \frac{x}{\mathsf{fma}\left(\color{blue}{0.5}, \frac{x}{y}, -\frac{y}{2 \cdot y}\right)} \]
      18. *-commutative98.9%

        \[\leadsto \frac{x}{\mathsf{fma}\left(0.5, \frac{x}{y}, -\frac{y}{\color{blue}{y \cdot 2}}\right)} \]
      19. associate-/r*98.9%

        \[\leadsto \frac{x}{\mathsf{fma}\left(0.5, \frac{x}{y}, -\color{blue}{\frac{\frac{y}{y}}{2}}\right)} \]
      20. *-inverses98.9%

        \[\leadsto \frac{x}{\mathsf{fma}\left(0.5, \frac{x}{y}, -\frac{\color{blue}{1}}{2}\right)} \]
      21. metadata-eval98.9%

        \[\leadsto \frac{x}{\mathsf{fma}\left(0.5, \frac{x}{y}, -\color{blue}{0.5}\right)} \]
      22. metadata-eval98.9%

        \[\leadsto \frac{x}{\mathsf{fma}\left(0.5, \frac{x}{y}, \color{blue}{-0.5}\right)} \]
    3. Simplified98.9%

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

    if -8.99999999999999941e-108 < y < 9.200000000000001e-89

    1. Initial program 65.6%

      \[\frac{\left(x \cdot 2\right) \cdot y}{x - y} \]
    2. Step-by-step derivation
      1. associate-*l/100.0%

        \[\leadsto \color{blue}{\frac{x \cdot 2}{x - y} \cdot y} \]
    3. Simplified100.0%

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

    if 9.200000000000001e-89 < y

    1. Initial program 85.1%

      \[\frac{\left(x \cdot 2\right) \cdot y}{x - y} \]
    2. Step-by-step derivation
      1. associate-/l*99.9%

        \[\leadsto \color{blue}{\frac{x \cdot 2}{\frac{x - y}{y}}} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{x \cdot 2}{\frac{x - y}{y}}} \]
    4. Taylor expanded in x around 0 100.0%

      \[\leadsto \frac{x \cdot 2}{\color{blue}{\frac{x}{y} - 1}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9 \cdot 10^{-108}:\\ \;\;\;\;\frac{x}{\mathsf{fma}\left(0.5, \frac{x}{y}, -0.5\right)}\\ \mathbf{elif}\;y \leq 9.2 \cdot 10^{-89}:\\ \;\;\;\;y \cdot \frac{x \cdot 2}{x - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot 2}{\frac{x}{y} + -1}\\ \end{array} \]

Alternative 3: 87.5% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 2 \cdot \frac{y \cdot x}{x - y}\\ \mathbf{if}\;x \leq -3.2 \cdot 10^{+145}:\\ \;\;\;\;\frac{y}{0.5}\\ \mathbf{elif}\;x \leq -7.6 \cdot 10^{-159}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 9.2 \cdot 10^{-172}:\\ \;\;\;\;\frac{x}{-0.5}\\ \mathbf{elif}\;x \leq 1.78 \cdot 10^{+134}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{0.5}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* 2.0 (/ (* y x) (- x y)))))
   (if (<= x -3.2e+145)
     (/ y 0.5)
     (if (<= x -7.6e-159)
       t_0
       (if (<= x 9.2e-172) (/ x -0.5) (if (<= x 1.78e+134) t_0 (/ y 0.5)))))))
double code(double x, double y) {
	double t_0 = 2.0 * ((y * x) / (x - y));
	double tmp;
	if (x <= -3.2e+145) {
		tmp = y / 0.5;
	} else if (x <= -7.6e-159) {
		tmp = t_0;
	} else if (x <= 9.2e-172) {
		tmp = x / -0.5;
	} else if (x <= 1.78e+134) {
		tmp = t_0;
	} else {
		tmp = y / 0.5;
	}
	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 * ((y * x) / (x - y))
    if (x <= (-3.2d+145)) then
        tmp = y / 0.5d0
    else if (x <= (-7.6d-159)) then
        tmp = t_0
    else if (x <= 9.2d-172) then
        tmp = x / (-0.5d0)
    else if (x <= 1.78d+134) then
        tmp = t_0
    else
        tmp = y / 0.5d0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = 2.0 * ((y * x) / (x - y));
	double tmp;
	if (x <= -3.2e+145) {
		tmp = y / 0.5;
	} else if (x <= -7.6e-159) {
		tmp = t_0;
	} else if (x <= 9.2e-172) {
		tmp = x / -0.5;
	} else if (x <= 1.78e+134) {
		tmp = t_0;
	} else {
		tmp = y / 0.5;
	}
	return tmp;
}
def code(x, y):
	t_0 = 2.0 * ((y * x) / (x - y))
	tmp = 0
	if x <= -3.2e+145:
		tmp = y / 0.5
	elif x <= -7.6e-159:
		tmp = t_0
	elif x <= 9.2e-172:
		tmp = x / -0.5
	elif x <= 1.78e+134:
		tmp = t_0
	else:
		tmp = y / 0.5
	return tmp
function code(x, y)
	t_0 = Float64(2.0 * Float64(Float64(y * x) / Float64(x - y)))
	tmp = 0.0
	if (x <= -3.2e+145)
		tmp = Float64(y / 0.5);
	elseif (x <= -7.6e-159)
		tmp = t_0;
	elseif (x <= 9.2e-172)
		tmp = Float64(x / -0.5);
	elseif (x <= 1.78e+134)
		tmp = t_0;
	else
		tmp = Float64(y / 0.5);
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = 2.0 * ((y * x) / (x - y));
	tmp = 0.0;
	if (x <= -3.2e+145)
		tmp = y / 0.5;
	elseif (x <= -7.6e-159)
		tmp = t_0;
	elseif (x <= 9.2e-172)
		tmp = x / -0.5;
	elseif (x <= 1.78e+134)
		tmp = t_0;
	else
		tmp = y / 0.5;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(2.0 * N[(N[(y * x), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.2e+145], N[(y / 0.5), $MachinePrecision], If[LessEqual[x, -7.6e-159], t$95$0, If[LessEqual[x, 9.2e-172], N[(x / -0.5), $MachinePrecision], If[LessEqual[x, 1.78e+134], t$95$0, N[(y / 0.5), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 2 \cdot \frac{y \cdot x}{x - y}\\
\mathbf{if}\;x \leq -3.2 \cdot 10^{+145}:\\
\;\;\;\;\frac{y}{0.5}\\

\mathbf{elif}\;x \leq -7.6 \cdot 10^{-159}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x \leq 9.2 \cdot 10^{-172}:\\
\;\;\;\;\frac{x}{-0.5}\\

\mathbf{elif}\;x \leq 1.78 \cdot 10^{+134}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;\frac{y}{0.5}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -3.20000000000000008e145 or 1.78000000000000005e134 < x

    1. Initial program 65.2%

      \[\frac{\left(x \cdot 2\right) \cdot y}{x - y} \]
    2. Step-by-step derivation
      1. *-commutative65.2%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{x - y}{x \cdot 2}}} \]
      3. div-sub98.4%

        \[\leadsto \frac{y}{\color{blue}{\frac{x}{x \cdot 2} - \frac{y}{x \cdot 2}}} \]
      4. sub-neg98.4%

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

        \[\leadsto \frac{y}{\color{blue}{\left(-\frac{y}{x \cdot 2}\right) + \frac{x}{x \cdot 2}}} \]
      6. distribute-neg-frac98.4%

        \[\leadsto \frac{y}{\color{blue}{\frac{-y}{x \cdot 2}} + \frac{x}{x \cdot 2}} \]
      7. neg-mul-198.4%

        \[\leadsto \frac{y}{\frac{\color{blue}{-1 \cdot y}}{x \cdot 2} + \frac{x}{x \cdot 2}} \]
      8. *-commutative98.4%

        \[\leadsto \frac{y}{\frac{\color{blue}{y \cdot -1}}{x \cdot 2} + \frac{x}{x \cdot 2}} \]
      9. times-frac98.4%

        \[\leadsto \frac{y}{\color{blue}{\frac{y}{x} \cdot \frac{-1}{2}} + \frac{x}{x \cdot 2}} \]
      10. metadata-eval98.4%

        \[\leadsto \frac{y}{\frac{y}{x} \cdot \color{blue}{-0.5} + \frac{x}{x \cdot 2}} \]
      11. metadata-eval98.4%

        \[\leadsto \frac{y}{\frac{y}{x} \cdot \color{blue}{\left(-0.5\right)} + \frac{x}{x \cdot 2}} \]
      12. metadata-eval98.4%

        \[\leadsto \frac{y}{\frac{y}{x} \cdot \left(-\color{blue}{\frac{1}{2}}\right) + \frac{x}{x \cdot 2}} \]
      13. *-inverses98.4%

        \[\leadsto \frac{y}{\frac{y}{x} \cdot \left(-\frac{\color{blue}{\frac{y}{y}}}{2}\right) + \frac{x}{x \cdot 2}} \]
      14. associate-/r*98.4%

        \[\leadsto \frac{y}{\frac{y}{x} \cdot \left(-\color{blue}{\frac{y}{y \cdot 2}}\right) + \frac{x}{x \cdot 2}} \]
      15. *-commutative98.4%

        \[\leadsto \frac{y}{\frac{y}{x} \cdot \left(-\frac{y}{\color{blue}{2 \cdot y}}\right) + \frac{x}{x \cdot 2}} \]
      16. associate-/r*100.0%

        \[\leadsto \frac{y}{\frac{y}{x} \cdot \left(-\frac{y}{2 \cdot y}\right) + \color{blue}{\frac{\frac{x}{x}}{2}}} \]
      17. *-inverses100.0%

        \[\leadsto \frac{y}{\frac{y}{x} \cdot \left(-\frac{y}{2 \cdot y}\right) + \frac{\color{blue}{1}}{2}} \]
      18. *-inverses100.0%

        \[\leadsto \frac{y}{\frac{y}{x} \cdot \left(-\frac{y}{2 \cdot y}\right) + \frac{\color{blue}{\frac{y}{y}}}{2}} \]
      19. associate-/r*100.0%

        \[\leadsto \frac{y}{\frac{y}{x} \cdot \left(-\frac{y}{2 \cdot y}\right) + \color{blue}{\frac{y}{y \cdot 2}}} \]
      20. *-commutative100.0%

        \[\leadsto \frac{y}{\frac{y}{x} \cdot \left(-\frac{y}{2 \cdot y}\right) + \frac{y}{\color{blue}{2 \cdot y}}} \]
      21. fma-def100.0%

        \[\leadsto \frac{y}{\color{blue}{\mathsf{fma}\left(\frac{y}{x}, -\frac{y}{2 \cdot y}, \frac{y}{2 \cdot y}\right)}} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{y}{\mathsf{fma}\left(\frac{y}{x}, -0.5, 0.5\right)}} \]
    4. Taylor expanded in y around 0 86.6%

      \[\leadsto \frac{y}{\color{blue}{0.5}} \]

    if -3.20000000000000008e145 < x < -7.6000000000000002e-159 or 9.1999999999999998e-172 < x < 1.78000000000000005e134

    1. Initial program 93.6%

      \[\frac{\left(x \cdot 2\right) \cdot y}{x - y} \]
    2. Step-by-step derivation
      1. *-commutative93.6%

        \[\leadsto \frac{\color{blue}{\left(2 \cdot x\right)} \cdot y}{x - y} \]
      2. associate-*l*93.6%

        \[\leadsto \frac{\color{blue}{2 \cdot \left(x \cdot y\right)}}{x - y} \]
      3. associate-*r/93.6%

        \[\leadsto \color{blue}{2 \cdot \frac{x \cdot y}{x - y}} \]
    3. Simplified93.6%

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

    if -7.6000000000000002e-159 < x < 9.1999999999999998e-172

    1. Initial program 61.3%

      \[\frac{\left(x \cdot 2\right) \cdot y}{x - y} \]
    2. Step-by-step derivation
      1. associate-*l*61.3%

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

        \[\leadsto \color{blue}{\frac{x}{\frac{x - y}{2 \cdot y}}} \]
      3. div-sub100.0%

        \[\leadsto \frac{x}{\color{blue}{\frac{x}{2 \cdot y} - \frac{y}{2 \cdot y}}} \]
      4. remove-double-neg100.0%

        \[\leadsto \frac{x}{\frac{\color{blue}{-\left(-x\right)}}{2 \cdot y} - \frac{y}{2 \cdot y}} \]
      5. remove-double-neg100.0%

        \[\leadsto \frac{x}{\frac{\color{blue}{x}}{2 \cdot y} - \frac{y}{2 \cdot y}} \]
      6. *-lft-identity100.0%

        \[\leadsto \frac{x}{\frac{\color{blue}{1 \cdot x}}{2 \cdot y} - \frac{y}{2 \cdot y}} \]
      7. *-inverses100.0%

        \[\leadsto \frac{x}{\frac{\color{blue}{\frac{x}{x}} \cdot x}{2 \cdot y} - \frac{y}{2 \cdot y}} \]
      8. times-frac100.0%

        \[\leadsto \frac{x}{\color{blue}{\frac{\frac{x}{x}}{2} \cdot \frac{x}{y}} - \frac{y}{2 \cdot y}} \]
      9. *-inverses100.0%

        \[\leadsto \frac{x}{\frac{\color{blue}{1}}{2} \cdot \frac{x}{y} - \frac{y}{2 \cdot y}} \]
      10. *-inverses100.0%

        \[\leadsto \frac{x}{\frac{\color{blue}{\frac{y}{y}}}{2} \cdot \frac{x}{y} - \frac{y}{2 \cdot y}} \]
      11. associate-/r*100.0%

        \[\leadsto \frac{x}{\color{blue}{\frac{y}{y \cdot 2}} \cdot \frac{x}{y} - \frac{y}{2 \cdot y}} \]
      12. *-commutative100.0%

        \[\leadsto \frac{x}{\frac{y}{\color{blue}{2 \cdot y}} \cdot \frac{x}{y} - \frac{y}{2 \cdot y}} \]
      13. fma-neg100.0%

        \[\leadsto \frac{x}{\color{blue}{\mathsf{fma}\left(\frac{y}{2 \cdot y}, \frac{x}{y}, -\frac{y}{2 \cdot y}\right)}} \]
      14. *-commutative100.0%

        \[\leadsto \frac{x}{\mathsf{fma}\left(\frac{y}{\color{blue}{y \cdot 2}}, \frac{x}{y}, -\frac{y}{2 \cdot y}\right)} \]
      15. associate-/r*100.0%

        \[\leadsto \frac{x}{\mathsf{fma}\left(\color{blue}{\frac{\frac{y}{y}}{2}}, \frac{x}{y}, -\frac{y}{2 \cdot y}\right)} \]
      16. *-inverses100.0%

        \[\leadsto \frac{x}{\mathsf{fma}\left(\frac{\color{blue}{1}}{2}, \frac{x}{y}, -\frac{y}{2 \cdot y}\right)} \]
      17. metadata-eval100.0%

        \[\leadsto \frac{x}{\mathsf{fma}\left(\color{blue}{0.5}, \frac{x}{y}, -\frac{y}{2 \cdot y}\right)} \]
      18. *-commutative100.0%

        \[\leadsto \frac{x}{\mathsf{fma}\left(0.5, \frac{x}{y}, -\frac{y}{\color{blue}{y \cdot 2}}\right)} \]
      19. associate-/r*100.0%

        \[\leadsto \frac{x}{\mathsf{fma}\left(0.5, \frac{x}{y}, -\color{blue}{\frac{\frac{y}{y}}{2}}\right)} \]
      20. *-inverses100.0%

        \[\leadsto \frac{x}{\mathsf{fma}\left(0.5, \frac{x}{y}, -\frac{\color{blue}{1}}{2}\right)} \]
      21. metadata-eval100.0%

        \[\leadsto \frac{x}{\mathsf{fma}\left(0.5, \frac{x}{y}, -\color{blue}{0.5}\right)} \]
      22. metadata-eval100.0%

        \[\leadsto \frac{x}{\mathsf{fma}\left(0.5, \frac{x}{y}, \color{blue}{-0.5}\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{x}{\mathsf{fma}\left(0.5, \frac{x}{y}, -0.5\right)}} \]
    4. Taylor expanded in x around 0 86.1%

      \[\leadsto \frac{x}{\color{blue}{-0.5}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification89.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.2 \cdot 10^{+145}:\\ \;\;\;\;\frac{y}{0.5}\\ \mathbf{elif}\;x \leq -7.6 \cdot 10^{-159}:\\ \;\;\;\;2 \cdot \frac{y \cdot x}{x - y}\\ \mathbf{elif}\;x \leq 9.2 \cdot 10^{-172}:\\ \;\;\;\;\frac{x}{-0.5}\\ \mathbf{elif}\;x \leq 1.78 \cdot 10^{+134}:\\ \;\;\;\;2 \cdot \frac{y \cdot x}{x - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{0.5}\\ \end{array} \]

Alternative 4: 99.6% accurate, 0.7× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{x - y}{x \cdot 2}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9.99999999999999965e-65 or 1.00000000000000005e-4 < y

    1. Initial program 83.4%

      \[\frac{\left(x \cdot 2\right) \cdot y}{x - y} \]
    2. Step-by-step derivation
      1. associate-/l*99.9%

        \[\leadsto \color{blue}{\frac{x \cdot 2}{\frac{x - y}{y}}} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{x \cdot 2}{\frac{x - y}{y}}} \]
    4. Taylor expanded in x around 0 100.0%

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

    if -9.99999999999999965e-65 < y < 1.00000000000000005e-4

    1. Initial program 69.7%

      \[\frac{\left(x \cdot 2\right) \cdot y}{x - y} \]
    2. Step-by-step derivation
      1. associate-*l/99.0%

        \[\leadsto \color{blue}{\frac{x \cdot 2}{x - y} \cdot y} \]
    3. Simplified99.0%

      \[\leadsto \color{blue}{\frac{x \cdot 2}{x - y} \cdot y} \]
    4. Step-by-step derivation
      1. *-commutative99.0%

        \[\leadsto \color{blue}{y \cdot \frac{x \cdot 2}{x - y}} \]
      2. clear-num99.0%

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{x - y}{x \cdot 2}}} \]
      3. un-div-inv99.1%

        \[\leadsto \color{blue}{\frac{y}{\frac{x - y}{x \cdot 2}}} \]
    5. Applied egg-rr99.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{-64} \lor \neg \left(y \leq 0.0001\right):\\ \;\;\;\;\frac{x \cdot 2}{\frac{x}{y} + -1}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{x - y}{x \cdot 2}}\\ \end{array} \]

Alternative 5: 93.6% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -7 \cdot 10^{+202}:\\ \;\;\;\;\frac{x}{-0.5}\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{+143}:\\ \;\;\;\;y \cdot \frac{x \cdot 2}{x - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{-0.5}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y -7e+202)
   (/ x -0.5)
   (if (<= y 2.5e+143) (* y (/ (* x 2.0) (- x y))) (/ x -0.5))))
double code(double x, double y) {
	double tmp;
	if (y <= -7e+202) {
		tmp = x / -0.5;
	} else if (y <= 2.5e+143) {
		tmp = y * ((x * 2.0) / (x - y));
	} else {
		tmp = x / -0.5;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= (-7d+202)) then
        tmp = x / (-0.5d0)
    else if (y <= 2.5d+143) then
        tmp = y * ((x * 2.0d0) / (x - y))
    else
        tmp = x / (-0.5d0)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= -7e+202) {
		tmp = x / -0.5;
	} else if (y <= 2.5e+143) {
		tmp = y * ((x * 2.0) / (x - y));
	} else {
		tmp = x / -0.5;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= -7e+202:
		tmp = x / -0.5
	elif y <= 2.5e+143:
		tmp = y * ((x * 2.0) / (x - y))
	else:
		tmp = x / -0.5
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= -7e+202)
		tmp = Float64(x / -0.5);
	elseif (y <= 2.5e+143)
		tmp = Float64(y * Float64(Float64(x * 2.0) / Float64(x - y)));
	else
		tmp = Float64(x / -0.5);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= -7e+202)
		tmp = x / -0.5;
	elseif (y <= 2.5e+143)
		tmp = y * ((x * 2.0) / (x - y));
	else
		tmp = x / -0.5;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, -7e+202], N[(x / -0.5), $MachinePrecision], If[LessEqual[y, 2.5e+143], N[(y * N[(N[(x * 2.0), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / -0.5), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{+202}:\\
\;\;\;\;\frac{x}{-0.5}\\

\mathbf{elif}\;y \leq 2.5 \cdot 10^{+143}:\\
\;\;\;\;y \cdot \frac{x \cdot 2}{x - y}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{-0.5}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.99999999999999975e202 or 2.50000000000000006e143 < y

    1. Initial program 77.2%

      \[\frac{\left(x \cdot 2\right) \cdot y}{x - y} \]
    2. Step-by-step derivation
      1. associate-*l*77.2%

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

        \[\leadsto \color{blue}{\frac{x}{\frac{x - y}{2 \cdot y}}} \]
      3. div-sub100.0%

        \[\leadsto \frac{x}{\color{blue}{\frac{x}{2 \cdot y} - \frac{y}{2 \cdot y}}} \]
      4. remove-double-neg100.0%

        \[\leadsto \frac{x}{\frac{\color{blue}{-\left(-x\right)}}{2 \cdot y} - \frac{y}{2 \cdot y}} \]
      5. remove-double-neg100.0%

        \[\leadsto \frac{x}{\frac{\color{blue}{x}}{2 \cdot y} - \frac{y}{2 \cdot y}} \]
      6. *-lft-identity100.0%

        \[\leadsto \frac{x}{\frac{\color{blue}{1 \cdot x}}{2 \cdot y} - \frac{y}{2 \cdot y}} \]
      7. *-inverses100.0%

        \[\leadsto \frac{x}{\frac{\color{blue}{\frac{x}{x}} \cdot x}{2 \cdot y} - \frac{y}{2 \cdot y}} \]
      8. times-frac100.0%

        \[\leadsto \frac{x}{\color{blue}{\frac{\frac{x}{x}}{2} \cdot \frac{x}{y}} - \frac{y}{2 \cdot y}} \]
      9. *-inverses100.0%

        \[\leadsto \frac{x}{\frac{\color{blue}{1}}{2} \cdot \frac{x}{y} - \frac{y}{2 \cdot y}} \]
      10. *-inverses100.0%

        \[\leadsto \frac{x}{\frac{\color{blue}{\frac{y}{y}}}{2} \cdot \frac{x}{y} - \frac{y}{2 \cdot y}} \]
      11. associate-/r*100.0%

        \[\leadsto \frac{x}{\color{blue}{\frac{y}{y \cdot 2}} \cdot \frac{x}{y} - \frac{y}{2 \cdot y}} \]
      12. *-commutative100.0%

        \[\leadsto \frac{x}{\frac{y}{\color{blue}{2 \cdot y}} \cdot \frac{x}{y} - \frac{y}{2 \cdot y}} \]
      13. fma-neg100.0%

        \[\leadsto \frac{x}{\color{blue}{\mathsf{fma}\left(\frac{y}{2 \cdot y}, \frac{x}{y}, -\frac{y}{2 \cdot y}\right)}} \]
      14. *-commutative100.0%

        \[\leadsto \frac{x}{\mathsf{fma}\left(\frac{y}{\color{blue}{y \cdot 2}}, \frac{x}{y}, -\frac{y}{2 \cdot y}\right)} \]
      15. associate-/r*100.0%

        \[\leadsto \frac{x}{\mathsf{fma}\left(\color{blue}{\frac{\frac{y}{y}}{2}}, \frac{x}{y}, -\frac{y}{2 \cdot y}\right)} \]
      16. *-inverses100.0%

        \[\leadsto \frac{x}{\mathsf{fma}\left(\frac{\color{blue}{1}}{2}, \frac{x}{y}, -\frac{y}{2 \cdot y}\right)} \]
      17. metadata-eval100.0%

        \[\leadsto \frac{x}{\mathsf{fma}\left(\color{blue}{0.5}, \frac{x}{y}, -\frac{y}{2 \cdot y}\right)} \]
      18. *-commutative100.0%

        \[\leadsto \frac{x}{\mathsf{fma}\left(0.5, \frac{x}{y}, -\frac{y}{\color{blue}{y \cdot 2}}\right)} \]
      19. associate-/r*100.0%

        \[\leadsto \frac{x}{\mathsf{fma}\left(0.5, \frac{x}{y}, -\color{blue}{\frac{\frac{y}{y}}{2}}\right)} \]
      20. *-inverses100.0%

        \[\leadsto \frac{x}{\mathsf{fma}\left(0.5, \frac{x}{y}, -\frac{\color{blue}{1}}{2}\right)} \]
      21. metadata-eval100.0%

        \[\leadsto \frac{x}{\mathsf{fma}\left(0.5, \frac{x}{y}, -\color{blue}{0.5}\right)} \]
      22. metadata-eval100.0%

        \[\leadsto \frac{x}{\mathsf{fma}\left(0.5, \frac{x}{y}, \color{blue}{-0.5}\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{x}{\mathsf{fma}\left(0.5, \frac{x}{y}, -0.5\right)}} \]
    4. Taylor expanded in x around 0 92.1%

      \[\leadsto \frac{x}{\color{blue}{-0.5}} \]

    if -6.99999999999999975e202 < y < 2.50000000000000006e143

    1. Initial program 77.5%

      \[\frac{\left(x \cdot 2\right) \cdot y}{x - y} \]
    2. Step-by-step derivation
      1. associate-*l/95.9%

        \[\leadsto \color{blue}{\frac{x \cdot 2}{x - y} \cdot y} \]
    3. Simplified95.9%

      \[\leadsto \color{blue}{\frac{x \cdot 2}{x - y} \cdot y} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification95.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7 \cdot 10^{+202}:\\ \;\;\;\;\frac{x}{-0.5}\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{+143}:\\ \;\;\;\;y \cdot \frac{x \cdot 2}{x - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{-0.5}\\ \end{array} \]

Alternative 6: 73.9% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.45 \cdot 10^{-5}:\\ \;\;\;\;\frac{y}{0.5}\\ \mathbf{elif}\;x \leq 9.5 \cdot 10^{+54}:\\ \;\;\;\;\frac{x}{-0.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{0.5}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x -1.45e-5) (/ y 0.5) (if (<= x 9.5e+54) (/ x -0.5) (/ y 0.5))))
double code(double x, double y) {
	double tmp;
	if (x <= -1.45e-5) {
		tmp = y / 0.5;
	} else if (x <= 9.5e+54) {
		tmp = x / -0.5;
	} else {
		tmp = y / 0.5;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-1.45d-5)) then
        tmp = y / 0.5d0
    else if (x <= 9.5d+54) then
        tmp = x / (-0.5d0)
    else
        tmp = y / 0.5d0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= -1.45e-5) {
		tmp = y / 0.5;
	} else if (x <= 9.5e+54) {
		tmp = x / -0.5;
	} else {
		tmp = y / 0.5;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= -1.45e-5:
		tmp = y / 0.5
	elif x <= 9.5e+54:
		tmp = x / -0.5
	else:
		tmp = y / 0.5
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= -1.45e-5)
		tmp = Float64(y / 0.5);
	elseif (x <= 9.5e+54)
		tmp = Float64(x / -0.5);
	else
		tmp = Float64(y / 0.5);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -1.45e-5)
		tmp = y / 0.5;
	elseif (x <= 9.5e+54)
		tmp = x / -0.5;
	else
		tmp = y / 0.5;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, -1.45e-5], N[(y / 0.5), $MachinePrecision], If[LessEqual[x, 9.5e+54], N[(x / -0.5), $MachinePrecision], N[(y / 0.5), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \cdot 10^{-5}:\\
\;\;\;\;\frac{y}{0.5}\\

\mathbf{elif}\;x \leq 9.5 \cdot 10^{+54}:\\
\;\;\;\;\frac{x}{-0.5}\\

\mathbf{else}:\\
\;\;\;\;\frac{y}{0.5}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.45e-5 or 9.4999999999999999e54 < x

    1. Initial program 75.8%

      \[\frac{\left(x \cdot 2\right) \cdot y}{x - y} \]
    2. Step-by-step derivation
      1. *-commutative75.8%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{x - y}{x \cdot 2}}} \]
      3. div-sub99.0%

        \[\leadsto \frac{y}{\color{blue}{\frac{x}{x \cdot 2} - \frac{y}{x \cdot 2}}} \]
      4. sub-neg99.0%

        \[\leadsto \frac{y}{\color{blue}{\frac{x}{x \cdot 2} + \left(-\frac{y}{x \cdot 2}\right)}} \]
      5. +-commutative99.0%

        \[\leadsto \frac{y}{\color{blue}{\left(-\frac{y}{x \cdot 2}\right) + \frac{x}{x \cdot 2}}} \]
      6. distribute-neg-frac99.0%

        \[\leadsto \frac{y}{\color{blue}{\frac{-y}{x \cdot 2}} + \frac{x}{x \cdot 2}} \]
      7. neg-mul-199.0%

        \[\leadsto \frac{y}{\frac{\color{blue}{-1 \cdot y}}{x \cdot 2} + \frac{x}{x \cdot 2}} \]
      8. *-commutative99.0%

        \[\leadsto \frac{y}{\frac{\color{blue}{y \cdot -1}}{x \cdot 2} + \frac{x}{x \cdot 2}} \]
      9. times-frac99.0%

        \[\leadsto \frac{y}{\color{blue}{\frac{y}{x} \cdot \frac{-1}{2}} + \frac{x}{x \cdot 2}} \]
      10. metadata-eval99.0%

        \[\leadsto \frac{y}{\frac{y}{x} \cdot \color{blue}{-0.5} + \frac{x}{x \cdot 2}} \]
      11. metadata-eval99.0%

        \[\leadsto \frac{y}{\frac{y}{x} \cdot \color{blue}{\left(-0.5\right)} + \frac{x}{x \cdot 2}} \]
      12. metadata-eval99.0%

        \[\leadsto \frac{y}{\frac{y}{x} \cdot \left(-\color{blue}{\frac{1}{2}}\right) + \frac{x}{x \cdot 2}} \]
      13. *-inverses99.0%

        \[\leadsto \frac{y}{\frac{y}{x} \cdot \left(-\frac{\color{blue}{\frac{y}{y}}}{2}\right) + \frac{x}{x \cdot 2}} \]
      14. associate-/r*99.0%

        \[\leadsto \frac{y}{\frac{y}{x} \cdot \left(-\color{blue}{\frac{y}{y \cdot 2}}\right) + \frac{x}{x \cdot 2}} \]
      15. *-commutative99.0%

        \[\leadsto \frac{y}{\frac{y}{x} \cdot \left(-\frac{y}{\color{blue}{2 \cdot y}}\right) + \frac{x}{x \cdot 2}} \]
      16. associate-/r*100.0%

        \[\leadsto \frac{y}{\frac{y}{x} \cdot \left(-\frac{y}{2 \cdot y}\right) + \color{blue}{\frac{\frac{x}{x}}{2}}} \]
      17. *-inverses100.0%

        \[\leadsto \frac{y}{\frac{y}{x} \cdot \left(-\frac{y}{2 \cdot y}\right) + \frac{\color{blue}{1}}{2}} \]
      18. *-inverses100.0%

        \[\leadsto \frac{y}{\frac{y}{x} \cdot \left(-\frac{y}{2 \cdot y}\right) + \frac{\color{blue}{\frac{y}{y}}}{2}} \]
      19. associate-/r*100.0%

        \[\leadsto \frac{y}{\frac{y}{x} \cdot \left(-\frac{y}{2 \cdot y}\right) + \color{blue}{\frac{y}{y \cdot 2}}} \]
      20. *-commutative100.0%

        \[\leadsto \frac{y}{\frac{y}{x} \cdot \left(-\frac{y}{2 \cdot y}\right) + \frac{y}{\color{blue}{2 \cdot y}}} \]
      21. fma-def100.0%

        \[\leadsto \frac{y}{\color{blue}{\mathsf{fma}\left(\frac{y}{x}, -\frac{y}{2 \cdot y}, \frac{y}{2 \cdot y}\right)}} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{y}{\mathsf{fma}\left(\frac{y}{x}, -0.5, 0.5\right)}} \]
    4. Taylor expanded in y around 0 78.5%

      \[\leadsto \frac{y}{\color{blue}{0.5}} \]

    if -1.45e-5 < x < 9.4999999999999999e54

    1. Initial program 78.5%

      \[\frac{\left(x \cdot 2\right) \cdot y}{x - y} \]
    2. Step-by-step derivation
      1. associate-*l*78.5%

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

        \[\leadsto \color{blue}{\frac{x}{\frac{x - y}{2 \cdot y}}} \]
      3. div-sub99.4%

        \[\leadsto \frac{x}{\color{blue}{\frac{x}{2 \cdot y} - \frac{y}{2 \cdot y}}} \]
      4. remove-double-neg99.4%

        \[\leadsto \frac{x}{\frac{\color{blue}{-\left(-x\right)}}{2 \cdot y} - \frac{y}{2 \cdot y}} \]
      5. remove-double-neg99.4%

        \[\leadsto \frac{x}{\frac{\color{blue}{x}}{2 \cdot y} - \frac{y}{2 \cdot y}} \]
      6. *-lft-identity99.4%

        \[\leadsto \frac{x}{\frac{\color{blue}{1 \cdot x}}{2 \cdot y} - \frac{y}{2 \cdot y}} \]
      7. *-inverses99.4%

        \[\leadsto \frac{x}{\frac{\color{blue}{\frac{x}{x}} \cdot x}{2 \cdot y} - \frac{y}{2 \cdot y}} \]
      8. times-frac99.4%

        \[\leadsto \frac{x}{\color{blue}{\frac{\frac{x}{x}}{2} \cdot \frac{x}{y}} - \frac{y}{2 \cdot y}} \]
      9. *-inverses99.4%

        \[\leadsto \frac{x}{\frac{\color{blue}{1}}{2} \cdot \frac{x}{y} - \frac{y}{2 \cdot y}} \]
      10. *-inverses99.4%

        \[\leadsto \frac{x}{\frac{\color{blue}{\frac{y}{y}}}{2} \cdot \frac{x}{y} - \frac{y}{2 \cdot y}} \]
      11. associate-/r*99.4%

        \[\leadsto \frac{x}{\color{blue}{\frac{y}{y \cdot 2}} \cdot \frac{x}{y} - \frac{y}{2 \cdot y}} \]
      12. *-commutative99.4%

        \[\leadsto \frac{x}{\frac{y}{\color{blue}{2 \cdot y}} \cdot \frac{x}{y} - \frac{y}{2 \cdot y}} \]
      13. fma-neg99.4%

        \[\leadsto \frac{x}{\color{blue}{\mathsf{fma}\left(\frac{y}{2 \cdot y}, \frac{x}{y}, -\frac{y}{2 \cdot y}\right)}} \]
      14. *-commutative99.4%

        \[\leadsto \frac{x}{\mathsf{fma}\left(\frac{y}{\color{blue}{y \cdot 2}}, \frac{x}{y}, -\frac{y}{2 \cdot y}\right)} \]
      15. associate-/r*99.4%

        \[\leadsto \frac{x}{\mathsf{fma}\left(\color{blue}{\frac{\frac{y}{y}}{2}}, \frac{x}{y}, -\frac{y}{2 \cdot y}\right)} \]
      16. *-inverses99.4%

        \[\leadsto \frac{x}{\mathsf{fma}\left(\frac{\color{blue}{1}}{2}, \frac{x}{y}, -\frac{y}{2 \cdot y}\right)} \]
      17. metadata-eval99.4%

        \[\leadsto \frac{x}{\mathsf{fma}\left(\color{blue}{0.5}, \frac{x}{y}, -\frac{y}{2 \cdot y}\right)} \]
      18. *-commutative99.4%

        \[\leadsto \frac{x}{\mathsf{fma}\left(0.5, \frac{x}{y}, -\frac{y}{\color{blue}{y \cdot 2}}\right)} \]
      19. associate-/r*99.4%

        \[\leadsto \frac{x}{\mathsf{fma}\left(0.5, \frac{x}{y}, -\color{blue}{\frac{\frac{y}{y}}{2}}\right)} \]
      20. *-inverses99.4%

        \[\leadsto \frac{x}{\mathsf{fma}\left(0.5, \frac{x}{y}, -\frac{\color{blue}{1}}{2}\right)} \]
      21. metadata-eval99.4%

        \[\leadsto \frac{x}{\mathsf{fma}\left(0.5, \frac{x}{y}, -\color{blue}{0.5}\right)} \]
      22. metadata-eval99.4%

        \[\leadsto \frac{x}{\mathsf{fma}\left(0.5, \frac{x}{y}, \color{blue}{-0.5}\right)} \]
    3. Simplified99.4%

      \[\leadsto \color{blue}{\frac{x}{\mathsf{fma}\left(0.5, \frac{x}{y}, -0.5\right)}} \]
    4. Taylor expanded in x around 0 76.4%

      \[\leadsto \frac{x}{\color{blue}{-0.5}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification77.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.45 \cdot 10^{-5}:\\ \;\;\;\;\frac{y}{0.5}\\ \mathbf{elif}\;x \leq 9.5 \cdot 10^{+54}:\\ \;\;\;\;\frac{x}{-0.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{0.5}\\ \end{array} \]

Alternative 7: 50.9% accurate, 3.0× speedup?

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

\\
\frac{x}{-0.5}
\end{array}
Derivation
  1. Initial program 77.4%

    \[\frac{\left(x \cdot 2\right) \cdot y}{x - y} \]
  2. Step-by-step derivation
    1. associate-*l*77.8%

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

      \[\leadsto \color{blue}{\frac{x}{\frac{x - y}{2 \cdot y}}} \]
    3. div-sub89.4%

      \[\leadsto \frac{x}{\color{blue}{\frac{x}{2 \cdot y} - \frac{y}{2 \cdot y}}} \]
    4. remove-double-neg89.4%

      \[\leadsto \frac{x}{\frac{\color{blue}{-\left(-x\right)}}{2 \cdot y} - \frac{y}{2 \cdot y}} \]
    5. remove-double-neg89.4%

      \[\leadsto \frac{x}{\frac{\color{blue}{x}}{2 \cdot y} - \frac{y}{2 \cdot y}} \]
    6. *-lft-identity89.4%

      \[\leadsto \frac{x}{\frac{\color{blue}{1 \cdot x}}{2 \cdot y} - \frac{y}{2 \cdot y}} \]
    7. *-inverses89.4%

      \[\leadsto \frac{x}{\frac{\color{blue}{\frac{x}{x}} \cdot x}{2 \cdot y} - \frac{y}{2 \cdot y}} \]
    8. times-frac89.4%

      \[\leadsto \frac{x}{\color{blue}{\frac{\frac{x}{x}}{2} \cdot \frac{x}{y}} - \frac{y}{2 \cdot y}} \]
    9. *-inverses89.4%

      \[\leadsto \frac{x}{\frac{\color{blue}{1}}{2} \cdot \frac{x}{y} - \frac{y}{2 \cdot y}} \]
    10. *-inverses89.4%

      \[\leadsto \frac{x}{\frac{\color{blue}{\frac{y}{y}}}{2} \cdot \frac{x}{y} - \frac{y}{2 \cdot y}} \]
    11. associate-/r*89.4%

      \[\leadsto \frac{x}{\color{blue}{\frac{y}{y \cdot 2}} \cdot \frac{x}{y} - \frac{y}{2 \cdot y}} \]
    12. *-commutative89.4%

      \[\leadsto \frac{x}{\frac{y}{\color{blue}{2 \cdot y}} \cdot \frac{x}{y} - \frac{y}{2 \cdot y}} \]
    13. fma-neg89.4%

      \[\leadsto \frac{x}{\color{blue}{\mathsf{fma}\left(\frac{y}{2 \cdot y}, \frac{x}{y}, -\frac{y}{2 \cdot y}\right)}} \]
    14. *-commutative89.4%

      \[\leadsto \frac{x}{\mathsf{fma}\left(\frac{y}{\color{blue}{y \cdot 2}}, \frac{x}{y}, -\frac{y}{2 \cdot y}\right)} \]
    15. associate-/r*89.4%

      \[\leadsto \frac{x}{\mathsf{fma}\left(\color{blue}{\frac{\frac{y}{y}}{2}}, \frac{x}{y}, -\frac{y}{2 \cdot y}\right)} \]
    16. *-inverses89.4%

      \[\leadsto \frac{x}{\mathsf{fma}\left(\frac{\color{blue}{1}}{2}, \frac{x}{y}, -\frac{y}{2 \cdot y}\right)} \]
    17. metadata-eval89.4%

      \[\leadsto \frac{x}{\mathsf{fma}\left(\color{blue}{0.5}, \frac{x}{y}, -\frac{y}{2 \cdot y}\right)} \]
    18. *-commutative89.4%

      \[\leadsto \frac{x}{\mathsf{fma}\left(0.5, \frac{x}{y}, -\frac{y}{\color{blue}{y \cdot 2}}\right)} \]
    19. associate-/r*89.4%

      \[\leadsto \frac{x}{\mathsf{fma}\left(0.5, \frac{x}{y}, -\color{blue}{\frac{\frac{y}{y}}{2}}\right)} \]
    20. *-inverses89.4%

      \[\leadsto \frac{x}{\mathsf{fma}\left(0.5, \frac{x}{y}, -\frac{\color{blue}{1}}{2}\right)} \]
    21. metadata-eval89.4%

      \[\leadsto \frac{x}{\mathsf{fma}\left(0.5, \frac{x}{y}, -\color{blue}{0.5}\right)} \]
    22. metadata-eval89.4%

      \[\leadsto \frac{x}{\mathsf{fma}\left(0.5, \frac{x}{y}, \color{blue}{-0.5}\right)} \]
  3. Simplified89.4%

    \[\leadsto \color{blue}{\frac{x}{\mathsf{fma}\left(0.5, \frac{x}{y}, -0.5\right)}} \]
  4. Taylor expanded in x around 0 54.7%

    \[\leadsto \frac{x}{\color{blue}{-0.5}} \]
  5. Final simplification54.7%

    \[\leadsto \frac{x}{-0.5} \]

Developer target: 99.4% accurate, 0.7× 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 2023238 
(FPCore (x y)
  :name "Linear.Projection:perspective from linear-1.19.1.3, B"
  :precision binary64

  :herbie-target
  (if (< x -1.7210442634149447e+81) (* (/ (* 2.0 x) (- x y)) y) (if (< x 83645045635564430.0) (/ (* x 2.0) (/ (- x y) y)) (* (/ (* 2.0 x) (- x y)) y)))

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