
(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:
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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}
(FPCore (x y) :precision binary64 (let* ((t_0 (* x (/ (* y 2.0) (- x y))))) (if (<= y -8.2e-28) t_0 (if (<= y 1e-29) (* y (/ (* 2.0 x) (- x y))) t_0))))
double code(double x, double y) {
double t_0 = x * ((y * 2.0) / (x - y));
double tmp;
if (y <= -8.2e-28) {
tmp = t_0;
} else if (y <= 1e-29) {
tmp = y * ((2.0 * x) / (x - 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 = x * ((y * 2.0d0) / (x - y))
if (y <= (-8.2d-28)) then
tmp = t_0
else if (y <= 1d-29) then
tmp = y * ((2.0d0 * x) / (x - y))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x * ((y * 2.0) / (x - y));
double tmp;
if (y <= -8.2e-28) {
tmp = t_0;
} else if (y <= 1e-29) {
tmp = y * ((2.0 * x) / (x - y));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = x * ((y * 2.0) / (x - y)) tmp = 0 if y <= -8.2e-28: tmp = t_0 elif y <= 1e-29: tmp = y * ((2.0 * x) / (x - y)) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(x * Float64(Float64(y * 2.0) / Float64(x - y))) tmp = 0.0 if (y <= -8.2e-28) tmp = t_0; elseif (y <= 1e-29) tmp = Float64(y * Float64(Float64(2.0 * x) / Float64(x - y))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = x * ((y * 2.0) / (x - y)); tmp = 0.0; if (y <= -8.2e-28) tmp = t_0; elseif (y <= 1e-29) tmp = y * ((2.0 * x) / (x - y)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x * N[(N[(y * 2.0), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8.2e-28], t$95$0, If[LessEqual[y, 1e-29], N[(y * N[(N[(2.0 * x), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{y \cdot 2}{x - y}\\
\mathbf{if}\;y \leq -8.2 \cdot 10^{-28}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 10^{-29}:\\
\;\;\;\;y \cdot \frac{2 \cdot x}{x - y}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -8.2000000000000005e-28 or 9.99999999999999943e-30 < y Initial program 79.2%
associate-*l*N/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6499.9
Applied egg-rr99.9%
if -8.2000000000000005e-28 < y < 9.99999999999999943e-30Initial program 80.2%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6499.1
Applied egg-rr99.1%
Final simplification99.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (* y x) (/ 2.0 (- x y))))
(t_1 (/ (* y (* 2.0 x)) (- x y)))
(t_2 (* y (fma y (/ 2.0 x) 2.0))))
(if (<= t_1 (- INFINITY))
t_2
(if (<= t_1 -5e-264)
t_0
(if (<= t_1 2e-296) (* y 2.0) (if (<= t_1 2e+104) t_0 t_2))))))
double code(double x, double y) {
double t_0 = (y * x) * (2.0 / (x - y));
double t_1 = (y * (2.0 * x)) / (x - y);
double t_2 = y * fma(y, (2.0 / x), 2.0);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_1 <= -5e-264) {
tmp = t_0;
} else if (t_1 <= 2e-296) {
tmp = y * 2.0;
} else if (t_1 <= 2e+104) {
tmp = t_0;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y) t_0 = Float64(Float64(y * x) * Float64(2.0 / Float64(x - y))) t_1 = Float64(Float64(y * Float64(2.0 * x)) / Float64(x - y)) t_2 = Float64(y * fma(y, Float64(2.0 / x), 2.0)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_2; elseif (t_1 <= -5e-264) tmp = t_0; elseif (t_1 <= 2e-296) tmp = Float64(y * 2.0); elseif (t_1 <= 2e+104) tmp = t_0; else tmp = t_2; end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(y * x), $MachinePrecision] * N[(2.0 / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y * N[(2.0 * x), $MachinePrecision]), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(y * N[(2.0 / x), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, -5e-264], t$95$0, If[LessEqual[t$95$1, 2e-296], N[(y * 2.0), $MachinePrecision], If[LessEqual[t$95$1, 2e+104], t$95$0, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y \cdot x\right) \cdot \frac{2}{x - y}\\
t_1 := \frac{y \cdot \left(2 \cdot x\right)}{x - y}\\
t_2 := y \cdot \mathsf{fma}\left(y, \frac{2}{x}, 2\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-264}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-296}:\\
\;\;\;\;y \cdot 2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+104}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (*.f64 (*.f64 x #s(literal 2 binary64)) y) (-.f64 x y)) < -inf.0 or 2e104 < (/.f64 (*.f64 (*.f64 x #s(literal 2 binary64)) y) (-.f64 x y)) Initial program 7.7%
Taylor expanded in x around inf
associate-*r/N/A
unpow2N/A
associate-*r*N/A
associate-*l/N/A
*-commutativeN/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
distribute-rgt-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6465.1
Simplified65.1%
if -inf.0 < (/.f64 (*.f64 (*.f64 x #s(literal 2 binary64)) y) (-.f64 x y)) < -5.0000000000000001e-264 or 2e-296 < (/.f64 (*.f64 (*.f64 x #s(literal 2 binary64)) y) (-.f64 x y)) < 2e104Initial program 99.2%
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6498.9
Applied egg-rr98.9%
if -5.0000000000000001e-264 < (/.f64 (*.f64 (*.f64 x #s(literal 2 binary64)) y) (-.f64 x y)) < 2e-296Initial program 28.2%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f6470.0
Simplified70.0%
Final simplification91.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* y (fma y (/ 2.0 x) 2.0))))
(if (<= x -9.5e+167)
t_0
(if (<= x 2.8e+128) (* x (/ (* y 2.0) (- x y))) t_0))))
double code(double x, double y) {
double t_0 = y * fma(y, (2.0 / x), 2.0);
double tmp;
if (x <= -9.5e+167) {
tmp = t_0;
} else if (x <= 2.8e+128) {
tmp = x * ((y * 2.0) / (x - y));
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y) t_0 = Float64(y * fma(y, Float64(2.0 / x), 2.0)) tmp = 0.0 if (x <= -9.5e+167) tmp = t_0; elseif (x <= 2.8e+128) tmp = Float64(x * Float64(Float64(y * 2.0) / Float64(x - y))); else tmp = t_0; end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(y * N[(2.0 / x), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9.5e+167], t$95$0, If[LessEqual[x, 2.8e+128], N[(x * N[(N[(y * 2.0), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \mathsf{fma}\left(y, \frac{2}{x}, 2\right)\\
\mathbf{if}\;x \leq -9.5 \cdot 10^{+167}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{+128}:\\
\;\;\;\;x \cdot \frac{y \cdot 2}{x - y}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -9.5000000000000006e167 or 2.79999999999999983e128 < x Initial program 69.1%
Taylor expanded in x around inf
associate-*r/N/A
unpow2N/A
associate-*r*N/A
associate-*l/N/A
*-commutativeN/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
distribute-rgt-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6495.2
Simplified95.2%
if -9.5000000000000006e167 < x < 2.79999999999999983e128Initial program 83.9%
associate-*l*N/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6497.4
Applied egg-rr97.4%
Final simplification96.7%
(FPCore (x y) :precision binary64 (if (<= x -2.15e+75) (* y (fma y (/ 2.0 x) 2.0)) (if (<= x 1.05e-15) (* -2.0 (fma x (/ x y) x)) (* y 2.0))))
double code(double x, double y) {
double tmp;
if (x <= -2.15e+75) {
tmp = y * fma(y, (2.0 / x), 2.0);
} else if (x <= 1.05e-15) {
tmp = -2.0 * fma(x, (x / y), x);
} else {
tmp = y * 2.0;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= -2.15e+75) tmp = Float64(y * fma(y, Float64(2.0 / x), 2.0)); elseif (x <= 1.05e-15) tmp = Float64(-2.0 * fma(x, Float64(x / y), x)); else tmp = Float64(y * 2.0); end return tmp end
code[x_, y_] := If[LessEqual[x, -2.15e+75], N[(y * N[(y * N[(2.0 / x), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.05e-15], N[(-2.0 * N[(x * N[(x / y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(y * 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.15 \cdot 10^{+75}:\\
\;\;\;\;y \cdot \mathsf{fma}\left(y, \frac{2}{x}, 2\right)\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{-15}:\\
\;\;\;\;-2 \cdot \mathsf{fma}\left(x, \frac{x}{y}, x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 2\\
\end{array}
\end{array}
if x < -2.1500000000000001e75Initial program 65.8%
Taylor expanded in x around inf
associate-*r/N/A
unpow2N/A
associate-*r*N/A
associate-*l/N/A
*-commutativeN/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
distribute-rgt-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6487.7
Simplified87.7%
if -2.1500000000000001e75 < x < 1.0499999999999999e-15Initial program 82.1%
Taylor expanded in x around 0
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
*-commutativeN/A
associate-*r*N/A
associate-/l*N/A
unpow2N/A
distribute-rgt-outN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
unpow2N/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6473.8
Simplified73.8%
if 1.0499999999999999e-15 < x Initial program 85.3%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f6475.6
Simplified75.6%
(FPCore (x y) :precision binary64 (if (<= x -1.32e+34) (* y 2.0) (if (<= x 4.4e-15) (* -2.0 (fma x (/ x y) x)) (* y 2.0))))
double code(double x, double y) {
double tmp;
if (x <= -1.32e+34) {
tmp = y * 2.0;
} else if (x <= 4.4e-15) {
tmp = -2.0 * fma(x, (x / y), x);
} else {
tmp = y * 2.0;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= -1.32e+34) tmp = Float64(y * 2.0); elseif (x <= 4.4e-15) tmp = Float64(-2.0 * fma(x, Float64(x / y), x)); else tmp = Float64(y * 2.0); end return tmp end
code[x_, y_] := If[LessEqual[x, -1.32e+34], N[(y * 2.0), $MachinePrecision], If[LessEqual[x, 4.4e-15], N[(-2.0 * N[(x * N[(x / y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(y * 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.32 \cdot 10^{+34}:\\
\;\;\;\;y \cdot 2\\
\mathbf{elif}\;x \leq 4.4 \cdot 10^{-15}:\\
\;\;\;\;-2 \cdot \mathsf{fma}\left(x, \frac{x}{y}, x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 2\\
\end{array}
\end{array}
if x < -1.31999999999999991e34 or 4.39999999999999971e-15 < x Initial program 77.3%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f6478.3
Simplified78.3%
if -1.31999999999999991e34 < x < 4.39999999999999971e-15Initial program 82.2%
Taylor expanded in x around 0
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
*-commutativeN/A
associate-*r*N/A
associate-/l*N/A
unpow2N/A
distribute-rgt-outN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
unpow2N/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6475.8
Simplified75.8%
(FPCore (x y) :precision binary64 (if (<= x -1.06e+52) (* y 2.0) (if (<= x 1.25e+31) (* x -2.0) (* y 2.0))))
double code(double x, double y) {
double tmp;
if (x <= -1.06e+52) {
tmp = y * 2.0;
} else if (x <= 1.25e+31) {
tmp = x * -2.0;
} else {
tmp = y * 2.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.06d+52)) then
tmp = y * 2.0d0
else if (x <= 1.25d+31) then
tmp = x * (-2.0d0)
else
tmp = y * 2.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.06e+52) {
tmp = y * 2.0;
} else if (x <= 1.25e+31) {
tmp = x * -2.0;
} else {
tmp = y * 2.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.06e+52: tmp = y * 2.0 elif x <= 1.25e+31: tmp = x * -2.0 else: tmp = y * 2.0 return tmp
function code(x, y) tmp = 0.0 if (x <= -1.06e+52) tmp = Float64(y * 2.0); elseif (x <= 1.25e+31) tmp = Float64(x * -2.0); else tmp = Float64(y * 2.0); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.06e+52) tmp = y * 2.0; elseif (x <= 1.25e+31) tmp = x * -2.0; else tmp = y * 2.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.06e+52], N[(y * 2.0), $MachinePrecision], If[LessEqual[x, 1.25e+31], N[(x * -2.0), $MachinePrecision], N[(y * 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.06 \cdot 10^{+52}:\\
\;\;\;\;y \cdot 2\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{+31}:\\
\;\;\;\;x \cdot -2\\
\mathbf{else}:\\
\;\;\;\;y \cdot 2\\
\end{array}
\end{array}
if x < -1.0599999999999999e52 or 1.25000000000000007e31 < x Initial program 74.1%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f6482.6
Simplified82.6%
if -1.0599999999999999e52 < x < 1.25000000000000007e31Initial program 84.4%
Taylor expanded in x around 0
*-lowering-*.f6472.3
Simplified72.3%
Final simplification77.0%
(FPCore (x y) :precision binary64 (* x -2.0))
double code(double x, double y) {
return x * -2.0;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x * (-2.0d0)
end function
public static double code(double x, double y) {
return x * -2.0;
}
def code(x, y): return x * -2.0
function code(x, y) return Float64(x * -2.0) end
function tmp = code(x, y) tmp = x * -2.0; end
code[x_, y_] := N[(x * -2.0), $MachinePrecision]
\begin{array}{l}
\\
x \cdot -2
\end{array}
Initial program 79.6%
Taylor expanded in x around 0
*-lowering-*.f6447.1
Simplified47.1%
Final simplification47.1%
(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}
herbie shell --seed 2024199
(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)))