
(FPCore (x y) :precision binary64 (let* ((t_0 (* (* y 4.0) y))) (/ (- (* x x) t_0) (+ (* x x) t_0))))
double code(double x, double y) {
double t_0 = (y * 4.0) * y;
return ((x * x) - t_0) / ((x * x) + t_0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
t_0 = (y * 4.0d0) * y
code = ((x * x) - t_0) / ((x * x) + t_0)
end function
public static double code(double x, double y) {
double t_0 = (y * 4.0) * y;
return ((x * x) - t_0) / ((x * x) + t_0);
}
def code(x, y): t_0 = (y * 4.0) * y return ((x * x) - t_0) / ((x * x) + t_0)
function code(x, y) t_0 = Float64(Float64(y * 4.0) * y) return Float64(Float64(Float64(x * x) - t_0) / Float64(Float64(x * x) + t_0)) end
function tmp = code(x, y) t_0 = (y * 4.0) * y; tmp = ((x * x) - t_0) / ((x * x) + t_0); end
code[x_, y_] := Block[{t$95$0 = N[(N[(y * 4.0), $MachinePrecision] * y), $MachinePrecision]}, N[(N[(N[(x * x), $MachinePrecision] - t$95$0), $MachinePrecision] / N[(N[(x * x), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y \cdot 4\right) \cdot y\\
\frac{x \cdot x - t_0}{x \cdot x + t_0}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (let* ((t_0 (* (* y 4.0) y))) (/ (- (* x x) t_0) (+ (* x x) t_0))))
double code(double x, double y) {
double t_0 = (y * 4.0) * y;
return ((x * x) - t_0) / ((x * x) + t_0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
t_0 = (y * 4.0d0) * y
code = ((x * x) - t_0) / ((x * x) + t_0)
end function
public static double code(double x, double y) {
double t_0 = (y * 4.0) * y;
return ((x * x) - t_0) / ((x * x) + t_0);
}
def code(x, y): t_0 = (y * 4.0) * y return ((x * x) - t_0) / ((x * x) + t_0)
function code(x, y) t_0 = Float64(Float64(y * 4.0) * y) return Float64(Float64(Float64(x * x) - t_0) / Float64(Float64(x * x) + t_0)) end
function tmp = code(x, y) t_0 = (y * 4.0) * y; tmp = ((x * x) - t_0) / ((x * x) + t_0); end
code[x_, y_] := Block[{t$95$0 = N[(N[(y * 4.0), $MachinePrecision] * y), $MachinePrecision]}, N[(N[(N[(x * x), $MachinePrecision] - t$95$0), $MachinePrecision] / N[(N[(x * x), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y \cdot 4\right) \cdot y\\
\frac{x \cdot x - t_0}{x \cdot x + t_0}
\end{array}
\end{array}
(FPCore (x y) :precision binary64 (- (/ x (+ x (* y (* (/ y x) 4.0)))) (/ y (fma 0.25 (/ x (/ y x)) y))))
double code(double x, double y) {
return (x / (x + (y * ((y / x) * 4.0)))) - (y / fma(0.25, (x / (y / x)), y));
}
function code(x, y) return Float64(Float64(x / Float64(x + Float64(y * Float64(Float64(y / x) * 4.0)))) - Float64(y / fma(0.25, Float64(x / Float64(y / x)), y))) end
code[x_, y_] := N[(N[(x / N[(x + N[(y * N[(N[(y / x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y / N[(0.25 * N[(x / N[(y / x), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{x + y \cdot \left(\frac{y}{x} \cdot 4\right)} - \frac{y}{\mathsf{fma}\left(0.25, \frac{x}{\frac{y}{x}}, y\right)}
\end{array}
Initial program 47.3%
div-sub47.3%
sub-neg47.3%
fma-def47.3%
*-commutative47.3%
*-commutative47.3%
fma-def47.3%
*-commutative47.3%
Applied egg-rr47.3%
sub-neg47.3%
associate-/l*47.8%
associate-/l*48.7%
Simplified48.7%
Taylor expanded in x around 0 71.1%
fma-def71.1%
unpow271.1%
associate-/l*75.1%
Simplified75.1%
Taylor expanded in x around 0 94.5%
*-commutative94.5%
unpow294.5%
associate-*r/100.0%
associate-*l*100.0%
fma-def100.0%
Simplified100.0%
fma-udef100.0%
Applied egg-rr100.0%
Final simplification100.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (/ y x)))
(t_1 (* y (* (/ y x) 4.0)))
(t_2 (* y (* y 4.0)))
(t_3 (/ (- (* x x) t_2) (+ t_2 (* x x)))))
(if (<= t_2 0.0)
(+ 1.0 (* -4.0 (/ (/ y x) (/ x y))))
(if (<= t_2 5e-169)
t_3
(if (<= t_2 2e-95)
(- (/ x (+ x t_1)) (/ y (* 0.25 t_0)))
(if (<= t_2 2e+238) t_3 (- (/ x t_1) (/ y (fma 0.25 t_0 y)))))))))
double code(double x, double y) {
double t_0 = x / (y / x);
double t_1 = y * ((y / x) * 4.0);
double t_2 = y * (y * 4.0);
double t_3 = ((x * x) - t_2) / (t_2 + (x * x));
double tmp;
if (t_2 <= 0.0) {
tmp = 1.0 + (-4.0 * ((y / x) / (x / y)));
} else if (t_2 <= 5e-169) {
tmp = t_3;
} else if (t_2 <= 2e-95) {
tmp = (x / (x + t_1)) - (y / (0.25 * t_0));
} else if (t_2 <= 2e+238) {
tmp = t_3;
} else {
tmp = (x / t_1) - (y / fma(0.25, t_0, y));
}
return tmp;
}
function code(x, y) t_0 = Float64(x / Float64(y / x)) t_1 = Float64(y * Float64(Float64(y / x) * 4.0)) t_2 = Float64(y * Float64(y * 4.0)) t_3 = Float64(Float64(Float64(x * x) - t_2) / Float64(t_2 + Float64(x * x))) tmp = 0.0 if (t_2 <= 0.0) tmp = Float64(1.0 + Float64(-4.0 * Float64(Float64(y / x) / Float64(x / y)))); elseif (t_2 <= 5e-169) tmp = t_3; elseif (t_2 <= 2e-95) tmp = Float64(Float64(x / Float64(x + t_1)) - Float64(y / Float64(0.25 * t_0))); elseif (t_2 <= 2e+238) tmp = t_3; else tmp = Float64(Float64(x / t_1) - Float64(y / fma(0.25, t_0, y))); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y * N[(N[(y / x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(y * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(x * x), $MachinePrecision] - t$95$2), $MachinePrecision] / N[(t$95$2 + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 0.0], N[(1.0 + N[(-4.0 * N[(N[(y / x), $MachinePrecision] / N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e-169], t$95$3, If[LessEqual[t$95$2, 2e-95], N[(N[(x / N[(x + t$95$1), $MachinePrecision]), $MachinePrecision] - N[(y / N[(0.25 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+238], t$95$3, N[(N[(x / t$95$1), $MachinePrecision] - N[(y / N[(0.25 * t$95$0 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\frac{y}{x}}\\
t_1 := y \cdot \left(\frac{y}{x} \cdot 4\right)\\
t_2 := y \cdot \left(y \cdot 4\right)\\
t_3 := \frac{x \cdot x - t_2}{t_2 + x \cdot x}\\
\mathbf{if}\;t_2 \leq 0:\\
\;\;\;\;1 + -4 \cdot \frac{\frac{y}{x}}{\frac{x}{y}}\\
\mathbf{elif}\;t_2 \leq 5 \cdot 10^{-169}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_2 \leq 2 \cdot 10^{-95}:\\
\;\;\;\;\frac{x}{x + t_1} - \frac{y}{0.25 \cdot t_0}\\
\mathbf{elif}\;t_2 \leq 2 \cdot 10^{+238}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t_1} - \frac{y}{\mathsf{fma}\left(0.25, t_0, y\right)}\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 4) y) < 0.0Initial program 51.7%
Taylor expanded in x around inf 51.7%
unpow251.7%
Simplified51.7%
Taylor expanded in x around inf 83.3%
unpow283.3%
unpow283.3%
times-frac90.6%
unpow290.6%
Simplified90.6%
unpow290.6%
clear-num90.6%
un-div-inv90.6%
Applied egg-rr90.6%
if 0.0 < (*.f64 (*.f64 y 4) y) < 5.0000000000000002e-169 or 1.99999999999999998e-95 < (*.f64 (*.f64 y 4) y) < 2.0000000000000001e238Initial program 80.0%
if 5.0000000000000002e-169 < (*.f64 (*.f64 y 4) y) < 1.99999999999999998e-95Initial program 41.7%
div-sub41.5%
sub-neg41.5%
fma-def41.5%
*-commutative41.5%
*-commutative41.5%
fma-def41.5%
*-commutative41.5%
Applied egg-rr41.5%
sub-neg41.5%
associate-/l*43.4%
associate-/l*43.4%
Simplified43.4%
Taylor expanded in x around 0 99.9%
*-commutative99.9%
unpow299.9%
associate-*r/99.9%
associate-*l*99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in x around inf 80.7%
unpow280.7%
associate-/l*80.7%
Simplified80.7%
fma-udef99.9%
Applied egg-rr80.7%
if 2.0000000000000001e238 < (*.f64 (*.f64 y 4) y) Initial program 6.0%
div-sub6.0%
sub-neg6.0%
fma-def6.0%
*-commutative6.0%
*-commutative6.0%
fma-def6.0%
*-commutative6.0%
Applied egg-rr6.0%
sub-neg6.0%
associate-/l*6.0%
associate-/l*8.9%
Simplified8.9%
Taylor expanded in x around 0 76.9%
fma-def76.9%
unpow276.9%
associate-/l*89.1%
Simplified89.1%
Taylor expanded in x around 0 89.1%
*-commutative89.1%
unpow289.1%
associate-*r/90.1%
associate-*l*90.1%
Simplified90.1%
Final simplification85.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* y (* y 4.0))) (t_1 (/ (- (* x x) t_0) (+ t_0 (* x x)))))
(if (<= t_0 0.0)
(+ 1.0 (* -4.0 (/ (/ y x) (/ x y))))
(if (<= t_0 5e-169)
t_1
(if (<= t_0 2e-95)
(- (/ x (+ x (* y (* (/ y x) 4.0)))) (/ y (* 0.25 (/ x (/ y x)))))
(if (<= t_0 2e+238) t_1 (fma 0.5 (* (/ x y) (/ x y)) -1.0)))))))
double code(double x, double y) {
double t_0 = y * (y * 4.0);
double t_1 = ((x * x) - t_0) / (t_0 + (x * x));
double tmp;
if (t_0 <= 0.0) {
tmp = 1.0 + (-4.0 * ((y / x) / (x / y)));
} else if (t_0 <= 5e-169) {
tmp = t_1;
} else if (t_0 <= 2e-95) {
tmp = (x / (x + (y * ((y / x) * 4.0)))) - (y / (0.25 * (x / (y / x))));
} else if (t_0 <= 2e+238) {
tmp = t_1;
} else {
tmp = fma(0.5, ((x / y) * (x / y)), -1.0);
}
return tmp;
}
function code(x, y) t_0 = Float64(y * Float64(y * 4.0)) t_1 = Float64(Float64(Float64(x * x) - t_0) / Float64(t_0 + Float64(x * x))) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(1.0 + Float64(-4.0 * Float64(Float64(y / x) / Float64(x / y)))); elseif (t_0 <= 5e-169) tmp = t_1; elseif (t_0 <= 2e-95) tmp = Float64(Float64(x / Float64(x + Float64(y * Float64(Float64(y / x) * 4.0)))) - Float64(y / Float64(0.25 * Float64(x / Float64(y / x))))); elseif (t_0 <= 2e+238) tmp = t_1; else tmp = fma(0.5, Float64(Float64(x / y) * Float64(x / y)), -1.0); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(y * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(x * x), $MachinePrecision] - t$95$0), $MachinePrecision] / N[(t$95$0 + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(1.0 + N[(-4.0 * N[(N[(y / x), $MachinePrecision] / N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e-169], t$95$1, If[LessEqual[t$95$0, 2e-95], N[(N[(x / N[(x + N[(y * N[(N[(y / x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y / N[(0.25 * N[(x / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+238], t$95$1, N[(0.5 * N[(N[(x / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(y \cdot 4\right)\\
t_1 := \frac{x \cdot x - t_0}{t_0 + x \cdot x}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;1 + -4 \cdot \frac{\frac{y}{x}}{\frac{x}{y}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{-169}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_0 \leq 2 \cdot 10^{-95}:\\
\;\;\;\;\frac{x}{x + y \cdot \left(\frac{y}{x} \cdot 4\right)} - \frac{y}{0.25 \cdot \frac{x}{\frac{y}{x}}}\\
\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+238}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.5, \frac{x}{y} \cdot \frac{x}{y}, -1\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 4) y) < 0.0Initial program 51.7%
Taylor expanded in x around inf 51.7%
unpow251.7%
Simplified51.7%
Taylor expanded in x around inf 83.3%
unpow283.3%
unpow283.3%
times-frac90.6%
unpow290.6%
Simplified90.6%
unpow290.6%
clear-num90.6%
un-div-inv90.6%
Applied egg-rr90.6%
if 0.0 < (*.f64 (*.f64 y 4) y) < 5.0000000000000002e-169 or 1.99999999999999998e-95 < (*.f64 (*.f64 y 4) y) < 2.0000000000000001e238Initial program 80.0%
if 5.0000000000000002e-169 < (*.f64 (*.f64 y 4) y) < 1.99999999999999998e-95Initial program 41.7%
div-sub41.5%
sub-neg41.5%
fma-def41.5%
*-commutative41.5%
*-commutative41.5%
fma-def41.5%
*-commutative41.5%
Applied egg-rr41.5%
sub-neg41.5%
associate-/l*43.4%
associate-/l*43.4%
Simplified43.4%
Taylor expanded in x around 0 99.9%
*-commutative99.9%
unpow299.9%
associate-*r/99.9%
associate-*l*99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in x around inf 80.7%
unpow280.7%
associate-/l*80.7%
Simplified80.7%
fma-udef99.9%
Applied egg-rr80.7%
if 2.0000000000000001e238 < (*.f64 (*.f64 y 4) y) Initial program 6.0%
Taylor expanded in x around 0 76.2%
fma-neg76.2%
unpow276.2%
unpow276.2%
times-frac90.1%
metadata-eval90.1%
Simplified90.1%
Final simplification85.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ 1.0 (* -4.0 (/ (/ y x) (/ x y)))))
(t_1 (* y (* y 4.0)))
(t_2 (/ (- (* x x) t_1) (+ t_1 (* x x)))))
(if (<= t_1 0.0)
t_0
(if (<= t_1 5e-169)
t_2
(if (<= t_1 2e-95)
t_0
(if (<= t_1 2e+238) t_2 (+ (/ x (* y (* (/ y x) 4.0))) -1.0)))))))
double code(double x, double y) {
double t_0 = 1.0 + (-4.0 * ((y / x) / (x / y)));
double t_1 = y * (y * 4.0);
double t_2 = ((x * x) - t_1) / (t_1 + (x * x));
double tmp;
if (t_1 <= 0.0) {
tmp = t_0;
} else if (t_1 <= 5e-169) {
tmp = t_2;
} else if (t_1 <= 2e-95) {
tmp = t_0;
} else if (t_1 <= 2e+238) {
tmp = t_2;
} else {
tmp = (x / (y * ((y / x) * 4.0))) + -1.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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = 1.0d0 + ((-4.0d0) * ((y / x) / (x / y)))
t_1 = y * (y * 4.0d0)
t_2 = ((x * x) - t_1) / (t_1 + (x * x))
if (t_1 <= 0.0d0) then
tmp = t_0
else if (t_1 <= 5d-169) then
tmp = t_2
else if (t_1 <= 2d-95) then
tmp = t_0
else if (t_1 <= 2d+238) then
tmp = t_2
else
tmp = (x / (y * ((y / x) * 4.0d0))) + (-1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 + (-4.0 * ((y / x) / (x / y)));
double t_1 = y * (y * 4.0);
double t_2 = ((x * x) - t_1) / (t_1 + (x * x));
double tmp;
if (t_1 <= 0.0) {
tmp = t_0;
} else if (t_1 <= 5e-169) {
tmp = t_2;
} else if (t_1 <= 2e-95) {
tmp = t_0;
} else if (t_1 <= 2e+238) {
tmp = t_2;
} else {
tmp = (x / (y * ((y / x) * 4.0))) + -1.0;
}
return tmp;
}
def code(x, y): t_0 = 1.0 + (-4.0 * ((y / x) / (x / y))) t_1 = y * (y * 4.0) t_2 = ((x * x) - t_1) / (t_1 + (x * x)) tmp = 0 if t_1 <= 0.0: tmp = t_0 elif t_1 <= 5e-169: tmp = t_2 elif t_1 <= 2e-95: tmp = t_0 elif t_1 <= 2e+238: tmp = t_2 else: tmp = (x / (y * ((y / x) * 4.0))) + -1.0 return tmp
function code(x, y) t_0 = Float64(1.0 + Float64(-4.0 * Float64(Float64(y / x) / Float64(x / y)))) t_1 = Float64(y * Float64(y * 4.0)) t_2 = Float64(Float64(Float64(x * x) - t_1) / Float64(t_1 + Float64(x * x))) tmp = 0.0 if (t_1 <= 0.0) tmp = t_0; elseif (t_1 <= 5e-169) tmp = t_2; elseif (t_1 <= 2e-95) tmp = t_0; elseif (t_1 <= 2e+238) tmp = t_2; else tmp = Float64(Float64(x / Float64(y * Float64(Float64(y / x) * 4.0))) + -1.0); end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 + (-4.0 * ((y / x) / (x / y))); t_1 = y * (y * 4.0); t_2 = ((x * x) - t_1) / (t_1 + (x * x)); tmp = 0.0; if (t_1 <= 0.0) tmp = t_0; elseif (t_1 <= 5e-169) tmp = t_2; elseif (t_1 <= 2e-95) tmp = t_0; elseif (t_1 <= 2e+238) tmp = t_2; else tmp = (x / (y * ((y / x) * 4.0))) + -1.0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 + N[(-4.0 * N[(N[(y / x), $MachinePrecision] / N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y * N[(y * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x * x), $MachinePrecision] - t$95$1), $MachinePrecision] / N[(t$95$1 + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0.0], t$95$0, If[LessEqual[t$95$1, 5e-169], t$95$2, If[LessEqual[t$95$1, 2e-95], t$95$0, If[LessEqual[t$95$1, 2e+238], t$95$2, N[(N[(x / N[(y * N[(N[(y / x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + -4 \cdot \frac{\frac{y}{x}}{\frac{x}{y}}\\
t_1 := y \cdot \left(y \cdot 4\right)\\
t_2 := \frac{x \cdot x - t_1}{t_1 + x \cdot x}\\
\mathbf{if}\;t_1 \leq 0:\\
\;\;\;\;t_0\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{-169}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{-95}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+238}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(\frac{y}{x} \cdot 4\right)} + -1\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 4) y) < 0.0 or 5.0000000000000002e-169 < (*.f64 (*.f64 y 4) y) < 1.99999999999999998e-95Initial program 50.0%
Taylor expanded in x around inf 46.4%
unpow246.4%
Simplified46.4%
Taylor expanded in x around inf 82.6%
unpow282.6%
unpow282.6%
times-frac88.7%
unpow288.7%
Simplified88.7%
unpow288.7%
clear-num88.7%
un-div-inv88.7%
Applied egg-rr88.7%
if 0.0 < (*.f64 (*.f64 y 4) y) < 5.0000000000000002e-169 or 1.99999999999999998e-95 < (*.f64 (*.f64 y 4) y) < 2.0000000000000001e238Initial program 80.0%
if 2.0000000000000001e238 < (*.f64 (*.f64 y 4) y) Initial program 6.0%
div-sub6.0%
sub-neg6.0%
fma-def6.0%
*-commutative6.0%
*-commutative6.0%
fma-def6.0%
*-commutative6.0%
Applied egg-rr6.0%
sub-neg6.0%
associate-/l*6.0%
associate-/l*8.9%
Simplified8.9%
Taylor expanded in x around 0 76.9%
fma-def76.9%
unpow276.9%
associate-/l*89.1%
Simplified89.1%
Taylor expanded in x around 0 89.1%
*-commutative89.1%
unpow289.1%
associate-*r/90.1%
associate-*l*90.1%
Simplified90.1%
Taylor expanded in y around inf 89.7%
Final simplification85.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* y (* (/ y x) 4.0)))
(t_1 (* y (* y 4.0)))
(t_2 (/ (- (* x x) t_1) (+ t_1 (* x x)))))
(if (<= t_1 0.0)
(+ 1.0 (* -4.0 (/ (/ y x) (/ x y))))
(if (<= t_1 5e-169)
t_2
(if (<= t_1 2e-95)
(- (/ x (+ x t_0)) (/ y (* 0.25 (/ x (/ y x)))))
(if (<= t_1 2e+238) t_2 (+ (/ x t_0) -1.0)))))))
double code(double x, double y) {
double t_0 = y * ((y / x) * 4.0);
double t_1 = y * (y * 4.0);
double t_2 = ((x * x) - t_1) / (t_1 + (x * x));
double tmp;
if (t_1 <= 0.0) {
tmp = 1.0 + (-4.0 * ((y / x) / (x / y)));
} else if (t_1 <= 5e-169) {
tmp = t_2;
} else if (t_1 <= 2e-95) {
tmp = (x / (x + t_0)) - (y / (0.25 * (x / (y / x))));
} else if (t_1 <= 2e+238) {
tmp = t_2;
} else {
tmp = (x / t_0) + -1.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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = y * ((y / x) * 4.0d0)
t_1 = y * (y * 4.0d0)
t_2 = ((x * x) - t_1) / (t_1 + (x * x))
if (t_1 <= 0.0d0) then
tmp = 1.0d0 + ((-4.0d0) * ((y / x) / (x / y)))
else if (t_1 <= 5d-169) then
tmp = t_2
else if (t_1 <= 2d-95) then
tmp = (x / (x + t_0)) - (y / (0.25d0 * (x / (y / x))))
else if (t_1 <= 2d+238) then
tmp = t_2
else
tmp = (x / t_0) + (-1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y * ((y / x) * 4.0);
double t_1 = y * (y * 4.0);
double t_2 = ((x * x) - t_1) / (t_1 + (x * x));
double tmp;
if (t_1 <= 0.0) {
tmp = 1.0 + (-4.0 * ((y / x) / (x / y)));
} else if (t_1 <= 5e-169) {
tmp = t_2;
} else if (t_1 <= 2e-95) {
tmp = (x / (x + t_0)) - (y / (0.25 * (x / (y / x))));
} else if (t_1 <= 2e+238) {
tmp = t_2;
} else {
tmp = (x / t_0) + -1.0;
}
return tmp;
}
def code(x, y): t_0 = y * ((y / x) * 4.0) t_1 = y * (y * 4.0) t_2 = ((x * x) - t_1) / (t_1 + (x * x)) tmp = 0 if t_1 <= 0.0: tmp = 1.0 + (-4.0 * ((y / x) / (x / y))) elif t_1 <= 5e-169: tmp = t_2 elif t_1 <= 2e-95: tmp = (x / (x + t_0)) - (y / (0.25 * (x / (y / x)))) elif t_1 <= 2e+238: tmp = t_2 else: tmp = (x / t_0) + -1.0 return tmp
function code(x, y) t_0 = Float64(y * Float64(Float64(y / x) * 4.0)) t_1 = Float64(y * Float64(y * 4.0)) t_2 = Float64(Float64(Float64(x * x) - t_1) / Float64(t_1 + Float64(x * x))) tmp = 0.0 if (t_1 <= 0.0) tmp = Float64(1.0 + Float64(-4.0 * Float64(Float64(y / x) / Float64(x / y)))); elseif (t_1 <= 5e-169) tmp = t_2; elseif (t_1 <= 2e-95) tmp = Float64(Float64(x / Float64(x + t_0)) - Float64(y / Float64(0.25 * Float64(x / Float64(y / x))))); elseif (t_1 <= 2e+238) tmp = t_2; else tmp = Float64(Float64(x / t_0) + -1.0); end return tmp end
function tmp_2 = code(x, y) t_0 = y * ((y / x) * 4.0); t_1 = y * (y * 4.0); t_2 = ((x * x) - t_1) / (t_1 + (x * x)); tmp = 0.0; if (t_1 <= 0.0) tmp = 1.0 + (-4.0 * ((y / x) / (x / y))); elseif (t_1 <= 5e-169) tmp = t_2; elseif (t_1 <= 2e-95) tmp = (x / (x + t_0)) - (y / (0.25 * (x / (y / x)))); elseif (t_1 <= 2e+238) tmp = t_2; else tmp = (x / t_0) + -1.0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(N[(y / x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y * N[(y * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x * x), $MachinePrecision] - t$95$1), $MachinePrecision] / N[(t$95$1 + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0.0], N[(1.0 + N[(-4.0 * N[(N[(y / x), $MachinePrecision] / N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e-169], t$95$2, If[LessEqual[t$95$1, 2e-95], N[(N[(x / N[(x + t$95$0), $MachinePrecision]), $MachinePrecision] - N[(y / N[(0.25 * N[(x / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+238], t$95$2, N[(N[(x / t$95$0), $MachinePrecision] + -1.0), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(\frac{y}{x} \cdot 4\right)\\
t_1 := y \cdot \left(y \cdot 4\right)\\
t_2 := \frac{x \cdot x - t_1}{t_1 + x \cdot x}\\
\mathbf{if}\;t_1 \leq 0:\\
\;\;\;\;1 + -4 \cdot \frac{\frac{y}{x}}{\frac{x}{y}}\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{-169}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{-95}:\\
\;\;\;\;\frac{x}{x + t_0} - \frac{y}{0.25 \cdot \frac{x}{\frac{y}{x}}}\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+238}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t_0} + -1\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 4) y) < 0.0Initial program 51.7%
Taylor expanded in x around inf 51.7%
unpow251.7%
Simplified51.7%
Taylor expanded in x around inf 83.3%
unpow283.3%
unpow283.3%
times-frac90.6%
unpow290.6%
Simplified90.6%
unpow290.6%
clear-num90.6%
un-div-inv90.6%
Applied egg-rr90.6%
if 0.0 < (*.f64 (*.f64 y 4) y) < 5.0000000000000002e-169 or 1.99999999999999998e-95 < (*.f64 (*.f64 y 4) y) < 2.0000000000000001e238Initial program 80.0%
if 5.0000000000000002e-169 < (*.f64 (*.f64 y 4) y) < 1.99999999999999998e-95Initial program 41.7%
div-sub41.5%
sub-neg41.5%
fma-def41.5%
*-commutative41.5%
*-commutative41.5%
fma-def41.5%
*-commutative41.5%
Applied egg-rr41.5%
sub-neg41.5%
associate-/l*43.4%
associate-/l*43.4%
Simplified43.4%
Taylor expanded in x around 0 99.9%
*-commutative99.9%
unpow299.9%
associate-*r/99.9%
associate-*l*99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in x around inf 80.7%
unpow280.7%
associate-/l*80.7%
Simplified80.7%
fma-udef99.9%
Applied egg-rr80.7%
if 2.0000000000000001e238 < (*.f64 (*.f64 y 4) y) Initial program 6.0%
div-sub6.0%
sub-neg6.0%
fma-def6.0%
*-commutative6.0%
*-commutative6.0%
fma-def6.0%
*-commutative6.0%
Applied egg-rr6.0%
sub-neg6.0%
associate-/l*6.0%
associate-/l*8.9%
Simplified8.9%
Taylor expanded in x around 0 76.9%
fma-def76.9%
unpow276.9%
associate-/l*89.1%
Simplified89.1%
Taylor expanded in x around 0 89.1%
*-commutative89.1%
unpow289.1%
associate-*r/90.1%
associate-*l*90.1%
Simplified90.1%
Taylor expanded in y around inf 89.7%
Final simplification85.7%
(FPCore (x y) :precision binary64 (if (or (<= y -4.6e-45) (not (<= y 6.5e+92))) (+ (/ x (* y (* (/ y x) 4.0))) -1.0) (+ 1.0 (* -4.0 (/ (/ y x) (/ x y))))))
double code(double x, double y) {
double tmp;
if ((y <= -4.6e-45) || !(y <= 6.5e+92)) {
tmp = (x / (y * ((y / x) * 4.0))) + -1.0;
} else {
tmp = 1.0 + (-4.0 * ((y / x) / (x / y)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-4.6d-45)) .or. (.not. (y <= 6.5d+92))) then
tmp = (x / (y * ((y / x) * 4.0d0))) + (-1.0d0)
else
tmp = 1.0d0 + ((-4.0d0) * ((y / x) / (x / y)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -4.6e-45) || !(y <= 6.5e+92)) {
tmp = (x / (y * ((y / x) * 4.0))) + -1.0;
} else {
tmp = 1.0 + (-4.0 * ((y / x) / (x / y)));
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -4.6e-45) or not (y <= 6.5e+92): tmp = (x / (y * ((y / x) * 4.0))) + -1.0 else: tmp = 1.0 + (-4.0 * ((y / x) / (x / y))) return tmp
function code(x, y) tmp = 0.0 if ((y <= -4.6e-45) || !(y <= 6.5e+92)) tmp = Float64(Float64(x / Float64(y * Float64(Float64(y / x) * 4.0))) + -1.0); else tmp = Float64(1.0 + Float64(-4.0 * Float64(Float64(y / x) / Float64(x / y)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -4.6e-45) || ~((y <= 6.5e+92))) tmp = (x / (y * ((y / x) * 4.0))) + -1.0; else tmp = 1.0 + (-4.0 * ((y / x) / (x / y))); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -4.6e-45], N[Not[LessEqual[y, 6.5e+92]], $MachinePrecision]], N[(N[(x / N[(y * N[(N[(y / x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], N[(1.0 + N[(-4.0 * N[(N[(y / x), $MachinePrecision] / N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.6 \cdot 10^{-45} \lor \neg \left(y \leq 6.5 \cdot 10^{+92}\right):\\
\;\;\;\;\frac{x}{y \cdot \left(\frac{y}{x} \cdot 4\right)} + -1\\
\mathbf{else}:\\
\;\;\;\;1 + -4 \cdot \frac{\frac{y}{x}}{\frac{x}{y}}\\
\end{array}
\end{array}
if y < -4.59999999999999983e-45 or 6.49999999999999999e92 < y Initial program 30.0%
div-sub30.0%
sub-neg30.0%
fma-def30.0%
*-commutative30.0%
*-commutative30.0%
fma-def30.0%
*-commutative30.0%
Applied egg-rr30.0%
sub-neg30.0%
associate-/l*30.1%
associate-/l*32.2%
Simplified32.2%
Taylor expanded in x around 0 79.8%
fma-def79.8%
unpow279.8%
associate-/l*88.3%
Simplified88.3%
Taylor expanded in x around 0 81.3%
*-commutative81.3%
unpow281.3%
associate-*r/82.0%
associate-*l*82.0%
Simplified82.0%
Taylor expanded in y around inf 81.7%
if -4.59999999999999983e-45 < y < 6.49999999999999999e92Initial program 62.5%
Taylor expanded in x around inf 42.0%
unpow242.0%
Simplified42.0%
Taylor expanded in x around inf 72.4%
unpow272.4%
unpow272.4%
times-frac75.7%
unpow275.7%
Simplified75.7%
unpow275.7%
clear-num75.7%
un-div-inv75.7%
Applied egg-rr75.7%
Final simplification78.5%
(FPCore (x y) :precision binary64 (if (<= y -1.28e-48) -1.0 (if (<= y 5.5e+118) (+ 1.0 (* -4.0 (/ (/ y x) (/ x y)))) -1.0)))
double code(double x, double y) {
double tmp;
if (y <= -1.28e-48) {
tmp = -1.0;
} else if (y <= 5.5e+118) {
tmp = 1.0 + (-4.0 * ((y / x) / (x / y)));
} else {
tmp = -1.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-1.28d-48)) then
tmp = -1.0d0
else if (y <= 5.5d+118) then
tmp = 1.0d0 + ((-4.0d0) * ((y / x) / (x / y)))
else
tmp = -1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.28e-48) {
tmp = -1.0;
} else if (y <= 5.5e+118) {
tmp = 1.0 + (-4.0 * ((y / x) / (x / y)));
} else {
tmp = -1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.28e-48: tmp = -1.0 elif y <= 5.5e+118: tmp = 1.0 + (-4.0 * ((y / x) / (x / y))) else: tmp = -1.0 return tmp
function code(x, y) tmp = 0.0 if (y <= -1.28e-48) tmp = -1.0; elseif (y <= 5.5e+118) tmp = Float64(1.0 + Float64(-4.0 * Float64(Float64(y / x) / Float64(x / y)))); else tmp = -1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.28e-48) tmp = -1.0; elseif (y <= 5.5e+118) tmp = 1.0 + (-4.0 * ((y / x) / (x / y))); else tmp = -1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.28e-48], -1.0, If[LessEqual[y, 5.5e+118], N[(1.0 + N[(-4.0 * N[(N[(y / x), $MachinePrecision] / N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.28 \cdot 10^{-48}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{+118}:\\
\;\;\;\;1 + -4 \cdot \frac{\frac{y}{x}}{\frac{x}{y}}\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\end{array}
if y < -1.28000000000000001e-48 or 5.5000000000000003e118 < y Initial program 28.1%
Taylor expanded in x around 0 82.4%
if -1.28000000000000001e-48 < y < 5.5000000000000003e118Initial program 62.7%
Taylor expanded in x around inf 41.0%
unpow241.0%
Simplified41.0%
Taylor expanded in x around inf 71.6%
unpow271.6%
unpow271.6%
times-frac74.7%
unpow274.7%
Simplified74.7%
unpow274.7%
clear-num74.7%
un-div-inv74.7%
Applied egg-rr74.7%
Final simplification78.2%
(FPCore (x y) :precision binary64 (if (<= y -1.28e-48) -1.0 (if (<= y 8.5e+92) 1.0 -1.0)))
double code(double x, double y) {
double tmp;
if (y <= -1.28e-48) {
tmp = -1.0;
} else if (y <= 8.5e+92) {
tmp = 1.0;
} else {
tmp = -1.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-1.28d-48)) then
tmp = -1.0d0
else if (y <= 8.5d+92) then
tmp = 1.0d0
else
tmp = -1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.28e-48) {
tmp = -1.0;
} else if (y <= 8.5e+92) {
tmp = 1.0;
} else {
tmp = -1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.28e-48: tmp = -1.0 elif y <= 8.5e+92: tmp = 1.0 else: tmp = -1.0 return tmp
function code(x, y) tmp = 0.0 if (y <= -1.28e-48) tmp = -1.0; elseif (y <= 8.5e+92) tmp = 1.0; else tmp = -1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.28e-48) tmp = -1.0; elseif (y <= 8.5e+92) tmp = 1.0; else tmp = -1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.28e-48], -1.0, If[LessEqual[y, 8.5e+92], 1.0, -1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.28 \cdot 10^{-48}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{+92}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\end{array}
if y < -1.28000000000000001e-48 or 8.5000000000000001e92 < y Initial program 30.0%
Taylor expanded in x around 0 80.8%
if -1.28000000000000001e-48 < y < 8.5000000000000001e92Initial program 62.5%
Taylor expanded in x around inf 74.9%
Final simplification77.7%
(FPCore (x y) :precision binary64 -1.0)
double code(double x, double y) {
return -1.0;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = -1.0d0
end function
public static double code(double x, double y) {
return -1.0;
}
def code(x, y): return -1.0
function code(x, y) return -1.0 end
function tmp = code(x, y) tmp = -1.0; end
code[x_, y_] := -1.0
\begin{array}{l}
\\
-1
\end{array}
Initial program 47.3%
Taylor expanded in x around 0 51.1%
Final simplification51.1%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (* y y) 4.0))
(t_1 (+ (* x x) t_0))
(t_2 (/ t_0 t_1))
(t_3 (* (* y 4.0) y)))
(if (< (/ (- (* x x) t_3) (+ (* x x) t_3)) 0.9743233849626781)
(- (/ (* x x) t_1) t_2)
(- (pow (/ x (sqrt t_1)) 2.0) t_2))))
double code(double x, double y) {
double t_0 = (y * y) * 4.0;
double t_1 = (x * x) + t_0;
double t_2 = t_0 / t_1;
double t_3 = (y * 4.0) * y;
double tmp;
if ((((x * x) - t_3) / ((x * x) + t_3)) < 0.9743233849626781) {
tmp = ((x * x) / t_1) - t_2;
} else {
tmp = pow((x / sqrt(t_1)), 2.0) - t_2;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = (y * y) * 4.0d0
t_1 = (x * x) + t_0
t_2 = t_0 / t_1
t_3 = (y * 4.0d0) * y
if ((((x * x) - t_3) / ((x * x) + t_3)) < 0.9743233849626781d0) then
tmp = ((x * x) / t_1) - t_2
else
tmp = ((x / sqrt(t_1)) ** 2.0d0) - t_2
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (y * y) * 4.0;
double t_1 = (x * x) + t_0;
double t_2 = t_0 / t_1;
double t_3 = (y * 4.0) * y;
double tmp;
if ((((x * x) - t_3) / ((x * x) + t_3)) < 0.9743233849626781) {
tmp = ((x * x) / t_1) - t_2;
} else {
tmp = Math.pow((x / Math.sqrt(t_1)), 2.0) - t_2;
}
return tmp;
}
def code(x, y): t_0 = (y * y) * 4.0 t_1 = (x * x) + t_0 t_2 = t_0 / t_1 t_3 = (y * 4.0) * y tmp = 0 if (((x * x) - t_3) / ((x * x) + t_3)) < 0.9743233849626781: tmp = ((x * x) / t_1) - t_2 else: tmp = math.pow((x / math.sqrt(t_1)), 2.0) - t_2 return tmp
function code(x, y) t_0 = Float64(Float64(y * y) * 4.0) t_1 = Float64(Float64(x * x) + t_0) t_2 = Float64(t_0 / t_1) t_3 = Float64(Float64(y * 4.0) * y) tmp = 0.0 if (Float64(Float64(Float64(x * x) - t_3) / Float64(Float64(x * x) + t_3)) < 0.9743233849626781) tmp = Float64(Float64(Float64(x * x) / t_1) - t_2); else tmp = Float64((Float64(x / sqrt(t_1)) ^ 2.0) - t_2); end return tmp end
function tmp_2 = code(x, y) t_0 = (y * y) * 4.0; t_1 = (x * x) + t_0; t_2 = t_0 / t_1; t_3 = (y * 4.0) * y; tmp = 0.0; if ((((x * x) - t_3) / ((x * x) + t_3)) < 0.9743233849626781) tmp = ((x * x) / t_1) - t_2; else tmp = ((x / sqrt(t_1)) ^ 2.0) - t_2; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(y * y), $MachinePrecision] * 4.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x * x), $MachinePrecision] + t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y * 4.0), $MachinePrecision] * y), $MachinePrecision]}, If[Less[N[(N[(N[(x * x), $MachinePrecision] - t$95$3), $MachinePrecision] / N[(N[(x * x), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision], 0.9743233849626781], N[(N[(N[(x * x), $MachinePrecision] / t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], N[(N[Power[N[(x / N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] - t$95$2), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y \cdot y\right) \cdot 4\\
t_1 := x \cdot x + t_0\\
t_2 := \frac{t_0}{t_1}\\
t_3 := \left(y \cdot 4\right) \cdot y\\
\mathbf{if}\;\frac{x \cdot x - t_3}{x \cdot x + t_3} < 0.9743233849626781:\\
\;\;\;\;\frac{x \cdot x}{t_1} - t_2\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{x}{\sqrt{t_1}}\right)}^{2} - t_2\\
\end{array}
\end{array}
herbie shell --seed 2023196
(FPCore (x y)
:name "Diagrams.TwoD.Arc:arcBetween from diagrams-lib-1.3.0.3"
:precision binary64
:herbie-target
(if (< (/ (- (* x x) (* (* y 4.0) y)) (+ (* x x) (* (* y 4.0) y))) 0.9743233849626781) (- (/ (* x x) (+ (* x x) (* (* y y) 4.0))) (/ (* (* y y) 4.0) (+ (* x x) (* (* y y) 4.0)))) (- (pow (/ x (sqrt (+ (* x x) (* (* y y) 4.0)))) 2.0) (/ (* (* y y) 4.0) (+ (* x x) (* (* y y) 4.0)))))
(/ (- (* x x) (* (* y 4.0) y)) (+ (* x x) (* (* y 4.0) y))))