
(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}
x_m = (fabs.f64 x) y_m = (fabs.f64 y) (FPCore (x_m y_m) :precision binary64 (let* ((t_0 (hypot (* 2.0 y_m) x_m))) (/ (fma 2.0 y_m (- x_m)) (* (/ t_0 (fma 2.0 y_m x_m)) (- t_0)))))
x_m = fabs(x);
y_m = fabs(y);
double code(double x_m, double y_m) {
double t_0 = hypot((2.0 * y_m), x_m);
return fma(2.0, y_m, -x_m) / ((t_0 / fma(2.0, y_m, x_m)) * -t_0);
}
x_m = abs(x) y_m = abs(y) function code(x_m, y_m) t_0 = hypot(Float64(2.0 * y_m), x_m) return Float64(fma(2.0, y_m, Float64(-x_m)) / Float64(Float64(t_0 / fma(2.0, y_m, x_m)) * Float64(-t_0))) end
x_m = N[Abs[x], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
code[x$95$m_, y$95$m_] := Block[{t$95$0 = N[Sqrt[N[(2.0 * y$95$m), $MachinePrecision] ^ 2 + x$95$m ^ 2], $MachinePrecision]}, N[(N[(2.0 * y$95$m + (-x$95$m)), $MachinePrecision] / N[(N[(t$95$0 / N[(2.0 * y$95$m + x$95$m), $MachinePrecision]), $MachinePrecision] * (-t$95$0)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \mathsf{hypot}\left(2 \cdot y\_m, x\_m\right)\\
\frac{\mathsf{fma}\left(2, y\_m, -x\_m\right)}{\frac{t\_0}{\mathsf{fma}\left(2, y\_m, x\_m\right)} \cdot \left(-t\_0\right)}
\end{array}
\end{array}
Initial program 45.7%
add-sqr-sqrt45.7%
difference-of-squares45.7%
*-commutative45.7%
associate-*r*45.7%
sqrt-prod45.7%
sqrt-unprod19.9%
add-sqr-sqrt35.2%
metadata-eval35.2%
*-commutative35.2%
associate-*r*35.2%
sqrt-prod35.2%
sqrt-unprod19.9%
add-sqr-sqrt45.7%
metadata-eval45.7%
Applied egg-rr45.7%
Applied egg-rr69.6%
fma-undefine69.6%
*-commutative69.6%
fma-undefine69.6%
unpow269.6%
pow-sqr69.6%
*-commutative69.6%
metadata-eval69.6%
+-commutative69.6%
fma-define69.6%
*-commutative69.6%
Simplified69.6%
fma-undefine69.6%
*-commutative69.6%
Applied egg-rr69.6%
Applied egg-rr100.0%
x_m = (fabs.f64 x) y_m = (fabs.f64 y) (FPCore (x_m y_m) :precision binary64 (let* ((t_0 (hypot (* 2.0 y_m) x_m))) (* (/ (fma y_m 2.0 x_m) t_0) (/ (+ x_m (* y_m -2.0)) t_0))))
x_m = fabs(x);
y_m = fabs(y);
double code(double x_m, double y_m) {
double t_0 = hypot((2.0 * y_m), x_m);
return (fma(y_m, 2.0, x_m) / t_0) * ((x_m + (y_m * -2.0)) / t_0);
}
x_m = abs(x) y_m = abs(y) function code(x_m, y_m) t_0 = hypot(Float64(2.0 * y_m), x_m) return Float64(Float64(fma(y_m, 2.0, x_m) / t_0) * Float64(Float64(x_m + Float64(y_m * -2.0)) / t_0)) end
x_m = N[Abs[x], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
code[x$95$m_, y$95$m_] := Block[{t$95$0 = N[Sqrt[N[(2.0 * y$95$m), $MachinePrecision] ^ 2 + x$95$m ^ 2], $MachinePrecision]}, N[(N[(N[(y$95$m * 2.0 + x$95$m), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[(x$95$m + N[(y$95$m * -2.0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \mathsf{hypot}\left(2 \cdot y\_m, x\_m\right)\\
\frac{\mathsf{fma}\left(y\_m, 2, x\_m\right)}{t\_0} \cdot \frac{x\_m + y\_m \cdot -2}{t\_0}
\end{array}
\end{array}
Initial program 45.7%
add-sqr-sqrt45.7%
difference-of-squares45.7%
*-commutative45.7%
associate-*r*45.7%
sqrt-prod45.7%
sqrt-unprod19.9%
add-sqr-sqrt35.2%
metadata-eval35.2%
*-commutative35.2%
associate-*r*35.2%
sqrt-prod35.2%
sqrt-unprod19.9%
add-sqr-sqrt45.7%
metadata-eval45.7%
Applied egg-rr45.7%
add-sqr-sqrt45.7%
times-frac47.4%
+-commutative47.4%
fma-define47.4%
+-commutative47.4%
add-sqr-sqrt47.4%
hypot-define47.4%
*-commutative47.4%
associate-*r*47.4%
metadata-eval47.4%
swap-sqr47.4%
sqrt-unprod20.9%
add-sqr-sqrt47.4%
Applied egg-rr100.0%
Final simplification100.0%
x_m = (fabs.f64 x) y_m = (fabs.f64 y) (FPCore (x_m y_m) :precision binary64 (if (<= x_m 2.2e-164) (+ (* 0.5 (* (/ x_m y_m) (/ x_m y_m))) -1.0) (* (/ x_m (hypot (* 2.0 y_m) x_m)) (+ 1.0 (/ (* y_m -2.0) x_m)))))
x_m = fabs(x);
y_m = fabs(y);
double code(double x_m, double y_m) {
double tmp;
if (x_m <= 2.2e-164) {
tmp = (0.5 * ((x_m / y_m) * (x_m / y_m))) + -1.0;
} else {
tmp = (x_m / hypot((2.0 * y_m), x_m)) * (1.0 + ((y_m * -2.0) / x_m));
}
return tmp;
}
x_m = Math.abs(x);
y_m = Math.abs(y);
public static double code(double x_m, double y_m) {
double tmp;
if (x_m <= 2.2e-164) {
tmp = (0.5 * ((x_m / y_m) * (x_m / y_m))) + -1.0;
} else {
tmp = (x_m / Math.hypot((2.0 * y_m), x_m)) * (1.0 + ((y_m * -2.0) / x_m));
}
return tmp;
}
x_m = math.fabs(x) y_m = math.fabs(y) def code(x_m, y_m): tmp = 0 if x_m <= 2.2e-164: tmp = (0.5 * ((x_m / y_m) * (x_m / y_m))) + -1.0 else: tmp = (x_m / math.hypot((2.0 * y_m), x_m)) * (1.0 + ((y_m * -2.0) / x_m)) return tmp
x_m = abs(x) y_m = abs(y) function code(x_m, y_m) tmp = 0.0 if (x_m <= 2.2e-164) tmp = Float64(Float64(0.5 * Float64(Float64(x_m / y_m) * Float64(x_m / y_m))) + -1.0); else tmp = Float64(Float64(x_m / hypot(Float64(2.0 * y_m), x_m)) * Float64(1.0 + Float64(Float64(y_m * -2.0) / x_m))); end return tmp end
x_m = abs(x); y_m = abs(y); function tmp_2 = code(x_m, y_m) tmp = 0.0; if (x_m <= 2.2e-164) tmp = (0.5 * ((x_m / y_m) * (x_m / y_m))) + -1.0; else tmp = (x_m / hypot((2.0 * y_m), x_m)) * (1.0 + ((y_m * -2.0) / x_m)); end tmp_2 = tmp; end
x_m = N[Abs[x], $MachinePrecision] y_m = N[Abs[y], $MachinePrecision] code[x$95$m_, y$95$m_] := If[LessEqual[x$95$m, 2.2e-164], N[(N[(0.5 * N[(N[(x$95$m / y$95$m), $MachinePrecision] * N[(x$95$m / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], N[(N[(x$95$m / N[Sqrt[N[(2.0 * y$95$m), $MachinePrecision] ^ 2 + x$95$m ^ 2], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(y$95$m * -2.0), $MachinePrecision] / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x\_m \leq 2.2 \cdot 10^{-164}:\\
\;\;\;\;0.5 \cdot \left(\frac{x\_m}{y\_m} \cdot \frac{x\_m}{y\_m}\right) + -1\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{\mathsf{hypot}\left(2 \cdot y\_m, x\_m\right)} \cdot \left(1 + \frac{y\_m \cdot -2}{x\_m}\right)\\
\end{array}
\end{array}
if x < 2.19999999999999988e-164Initial program 45.2%
sub-neg45.2%
distribute-rgt-neg-in45.2%
cancel-sign-sub45.2%
distribute-lft-neg-out45.2%
remove-double-neg45.2%
distribute-lft-neg-out45.2%
distribute-lft-neg-in45.2%
distribute-rgt-neg-out45.2%
Simplified45.3%
Taylor expanded in x around 0 48.6%
pow248.6%
unpow248.6%
times-frac56.4%
Applied egg-rr56.4%
if 2.19999999999999988e-164 < x Initial program 46.3%
add-sqr-sqrt46.3%
difference-of-squares46.3%
*-commutative46.3%
associate-*r*46.3%
sqrt-prod46.3%
sqrt-unprod16.7%
add-sqr-sqrt39.9%
metadata-eval39.9%
*-commutative39.9%
associate-*r*39.9%
sqrt-prod39.9%
sqrt-unprod16.7%
add-sqr-sqrt46.3%
metadata-eval46.3%
Applied egg-rr46.3%
add-sqr-sqrt46.3%
times-frac48.0%
+-commutative48.0%
fma-define48.0%
+-commutative48.0%
add-sqr-sqrt48.0%
hypot-define48.0%
*-commutative48.0%
associate-*r*48.0%
metadata-eval48.0%
swap-sqr48.0%
sqrt-unprod17.7%
add-sqr-sqrt48.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 72.2%
associate-*r/72.2%
*-commutative72.2%
Simplified72.2%
Taylor expanded in y around 0 85.4%
Final simplification68.6%
x_m = (fabs.f64 x)
y_m = (fabs.f64 y)
(FPCore (x_m y_m)
:precision binary64
(let* ((t_0 (* y_m (* y_m 4.0))))
(if (<= (* x_m x_m) 1e-237)
(+ (* 0.5 (* (/ x_m y_m) (/ x_m y_m))) -1.0)
(if (<= (* x_m x_m) 2e+234)
(/ (- (* x_m x_m) t_0) (+ (* x_m x_m) t_0))
(* (+ 1.0 (/ (* y_m -2.0) x_m)) (+ 1.0 (* 2.0 (/ y_m x_m))))))))x_m = fabs(x);
y_m = fabs(y);
double code(double x_m, double y_m) {
double t_0 = y_m * (y_m * 4.0);
double tmp;
if ((x_m * x_m) <= 1e-237) {
tmp = (0.5 * ((x_m / y_m) * (x_m / y_m))) + -1.0;
} else if ((x_m * x_m) <= 2e+234) {
tmp = ((x_m * x_m) - t_0) / ((x_m * x_m) + t_0);
} else {
tmp = (1.0 + ((y_m * -2.0) / x_m)) * (1.0 + (2.0 * (y_m / x_m)));
}
return tmp;
}
x_m = abs(x)
y_m = abs(y)
real(8) function code(x_m, y_m)
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8) :: t_0
real(8) :: tmp
t_0 = y_m * (y_m * 4.0d0)
if ((x_m * x_m) <= 1d-237) then
tmp = (0.5d0 * ((x_m / y_m) * (x_m / y_m))) + (-1.0d0)
else if ((x_m * x_m) <= 2d+234) then
tmp = ((x_m * x_m) - t_0) / ((x_m * x_m) + t_0)
else
tmp = (1.0d0 + ((y_m * (-2.0d0)) / x_m)) * (1.0d0 + (2.0d0 * (y_m / x_m)))
end if
code = tmp
end function
x_m = Math.abs(x);
y_m = Math.abs(y);
public static double code(double x_m, double y_m) {
double t_0 = y_m * (y_m * 4.0);
double tmp;
if ((x_m * x_m) <= 1e-237) {
tmp = (0.5 * ((x_m / y_m) * (x_m / y_m))) + -1.0;
} else if ((x_m * x_m) <= 2e+234) {
tmp = ((x_m * x_m) - t_0) / ((x_m * x_m) + t_0);
} else {
tmp = (1.0 + ((y_m * -2.0) / x_m)) * (1.0 + (2.0 * (y_m / x_m)));
}
return tmp;
}
x_m = math.fabs(x) y_m = math.fabs(y) def code(x_m, y_m): t_0 = y_m * (y_m * 4.0) tmp = 0 if (x_m * x_m) <= 1e-237: tmp = (0.5 * ((x_m / y_m) * (x_m / y_m))) + -1.0 elif (x_m * x_m) <= 2e+234: tmp = ((x_m * x_m) - t_0) / ((x_m * x_m) + t_0) else: tmp = (1.0 + ((y_m * -2.0) / x_m)) * (1.0 + (2.0 * (y_m / x_m))) return tmp
x_m = abs(x) y_m = abs(y) function code(x_m, y_m) t_0 = Float64(y_m * Float64(y_m * 4.0)) tmp = 0.0 if (Float64(x_m * x_m) <= 1e-237) tmp = Float64(Float64(0.5 * Float64(Float64(x_m / y_m) * Float64(x_m / y_m))) + -1.0); elseif (Float64(x_m * x_m) <= 2e+234) tmp = Float64(Float64(Float64(x_m * x_m) - t_0) / Float64(Float64(x_m * x_m) + t_0)); else tmp = Float64(Float64(1.0 + Float64(Float64(y_m * -2.0) / x_m)) * Float64(1.0 + Float64(2.0 * Float64(y_m / x_m)))); end return tmp end
x_m = abs(x); y_m = abs(y); function tmp_2 = code(x_m, y_m) t_0 = y_m * (y_m * 4.0); tmp = 0.0; if ((x_m * x_m) <= 1e-237) tmp = (0.5 * ((x_m / y_m) * (x_m / y_m))) + -1.0; elseif ((x_m * x_m) <= 2e+234) tmp = ((x_m * x_m) - t_0) / ((x_m * x_m) + t_0); else tmp = (1.0 + ((y_m * -2.0) / x_m)) * (1.0 + (2.0 * (y_m / x_m))); end tmp_2 = tmp; end
x_m = N[Abs[x], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
code[x$95$m_, y$95$m_] := Block[{t$95$0 = N[(y$95$m * N[(y$95$m * 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x$95$m * x$95$m), $MachinePrecision], 1e-237], N[(N[(0.5 * N[(N[(x$95$m / y$95$m), $MachinePrecision] * N[(x$95$m / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[N[(x$95$m * x$95$m), $MachinePrecision], 2e+234], N[(N[(N[(x$95$m * x$95$m), $MachinePrecision] - t$95$0), $MachinePrecision] / N[(N[(x$95$m * x$95$m), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(N[(y$95$m * -2.0), $MachinePrecision] / x$95$m), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(2.0 * N[(y$95$m / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
x_m = \left|x\right|
\\
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := y\_m \cdot \left(y\_m \cdot 4\right)\\
\mathbf{if}\;x\_m \cdot x\_m \leq 10^{-237}:\\
\;\;\;\;0.5 \cdot \left(\frac{x\_m}{y\_m} \cdot \frac{x\_m}{y\_m}\right) + -1\\
\mathbf{elif}\;x\_m \cdot x\_m \leq 2 \cdot 10^{+234}:\\
\;\;\;\;\frac{x\_m \cdot x\_m - t\_0}{x\_m \cdot x\_m + t\_0}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \frac{y\_m \cdot -2}{x\_m}\right) \cdot \left(1 + 2 \cdot \frac{y\_m}{x\_m}\right)\\
\end{array}
\end{array}
if (*.f64 x x) < 9.9999999999999999e-238Initial program 48.5%
sub-neg48.5%
distribute-rgt-neg-in48.5%
cancel-sign-sub48.5%
distribute-lft-neg-out48.5%
remove-double-neg48.5%
distribute-lft-neg-out48.5%
distribute-lft-neg-in48.5%
distribute-rgt-neg-out48.5%
Simplified48.5%
Taylor expanded in x around 0 77.3%
pow277.3%
unpow277.3%
times-frac87.8%
Applied egg-rr87.8%
if 9.9999999999999999e-238 < (*.f64 x x) < 2.00000000000000004e234Initial program 71.9%
if 2.00000000000000004e234 < (*.f64 x x) Initial program 15.6%
add-sqr-sqrt15.6%
difference-of-squares15.6%
*-commutative15.6%
associate-*r*15.6%
sqrt-prod15.6%
sqrt-unprod7.8%
add-sqr-sqrt15.6%
metadata-eval15.6%
*-commutative15.6%
associate-*r*15.6%
sqrt-prod15.6%
sqrt-unprod7.8%
add-sqr-sqrt15.6%
metadata-eval15.6%
Applied egg-rr15.6%
add-sqr-sqrt15.6%
times-frac18.2%
+-commutative18.2%
fma-define18.2%
+-commutative18.2%
add-sqr-sqrt18.2%
hypot-define18.2%
*-commutative18.2%
associate-*r*18.2%
metadata-eval18.2%
swap-sqr18.2%
sqrt-unprod9.3%
add-sqr-sqrt18.2%
Applied egg-rr100.0%
Taylor expanded in x around inf 49.2%
associate-*r/49.2%
*-commutative49.2%
Simplified49.2%
Taylor expanded in y around 0 86.8%
Final simplification81.5%
x_m = (fabs.f64 x)
y_m = (fabs.f64 y)
(FPCore (x_m y_m)
:precision binary64
(if (<= x_m 2e-118)
(+ (* 0.5 (* (/ x_m y_m) (/ x_m y_m))) -1.0)
(if (<= x_m 2.15e+120)
(/
(* (+ x_m (* 2.0 y_m)) (- x_m (* 2.0 y_m)))
(+ (* x_m x_m) (* y_m (* y_m 4.0))))
(* (+ 1.0 (/ (* y_m -2.0) x_m)) (+ 1.0 (* 2.0 (/ y_m x_m)))))))x_m = fabs(x);
y_m = fabs(y);
double code(double x_m, double y_m) {
double tmp;
if (x_m <= 2e-118) {
tmp = (0.5 * ((x_m / y_m) * (x_m / y_m))) + -1.0;
} else if (x_m <= 2.15e+120) {
tmp = ((x_m + (2.0 * y_m)) * (x_m - (2.0 * y_m))) / ((x_m * x_m) + (y_m * (y_m * 4.0)));
} else {
tmp = (1.0 + ((y_m * -2.0) / x_m)) * (1.0 + (2.0 * (y_m / x_m)));
}
return tmp;
}
x_m = abs(x)
y_m = abs(y)
real(8) function code(x_m, y_m)
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8) :: tmp
if (x_m <= 2d-118) then
tmp = (0.5d0 * ((x_m / y_m) * (x_m / y_m))) + (-1.0d0)
else if (x_m <= 2.15d+120) then
tmp = ((x_m + (2.0d0 * y_m)) * (x_m - (2.0d0 * y_m))) / ((x_m * x_m) + (y_m * (y_m * 4.0d0)))
else
tmp = (1.0d0 + ((y_m * (-2.0d0)) / x_m)) * (1.0d0 + (2.0d0 * (y_m / x_m)))
end if
code = tmp
end function
x_m = Math.abs(x);
y_m = Math.abs(y);
public static double code(double x_m, double y_m) {
double tmp;
if (x_m <= 2e-118) {
tmp = (0.5 * ((x_m / y_m) * (x_m / y_m))) + -1.0;
} else if (x_m <= 2.15e+120) {
tmp = ((x_m + (2.0 * y_m)) * (x_m - (2.0 * y_m))) / ((x_m * x_m) + (y_m * (y_m * 4.0)));
} else {
tmp = (1.0 + ((y_m * -2.0) / x_m)) * (1.0 + (2.0 * (y_m / x_m)));
}
return tmp;
}
x_m = math.fabs(x) y_m = math.fabs(y) def code(x_m, y_m): tmp = 0 if x_m <= 2e-118: tmp = (0.5 * ((x_m / y_m) * (x_m / y_m))) + -1.0 elif x_m <= 2.15e+120: tmp = ((x_m + (2.0 * y_m)) * (x_m - (2.0 * y_m))) / ((x_m * x_m) + (y_m * (y_m * 4.0))) else: tmp = (1.0 + ((y_m * -2.0) / x_m)) * (1.0 + (2.0 * (y_m / x_m))) return tmp
x_m = abs(x) y_m = abs(y) function code(x_m, y_m) tmp = 0.0 if (x_m <= 2e-118) tmp = Float64(Float64(0.5 * Float64(Float64(x_m / y_m) * Float64(x_m / y_m))) + -1.0); elseif (x_m <= 2.15e+120) tmp = Float64(Float64(Float64(x_m + Float64(2.0 * y_m)) * Float64(x_m - Float64(2.0 * y_m))) / Float64(Float64(x_m * x_m) + Float64(y_m * Float64(y_m * 4.0)))); else tmp = Float64(Float64(1.0 + Float64(Float64(y_m * -2.0) / x_m)) * Float64(1.0 + Float64(2.0 * Float64(y_m / x_m)))); end return tmp end
x_m = abs(x); y_m = abs(y); function tmp_2 = code(x_m, y_m) tmp = 0.0; if (x_m <= 2e-118) tmp = (0.5 * ((x_m / y_m) * (x_m / y_m))) + -1.0; elseif (x_m <= 2.15e+120) tmp = ((x_m + (2.0 * y_m)) * (x_m - (2.0 * y_m))) / ((x_m * x_m) + (y_m * (y_m * 4.0))); else tmp = (1.0 + ((y_m * -2.0) / x_m)) * (1.0 + (2.0 * (y_m / x_m))); end tmp_2 = tmp; end
x_m = N[Abs[x], $MachinePrecision] y_m = N[Abs[y], $MachinePrecision] code[x$95$m_, y$95$m_] := If[LessEqual[x$95$m, 2e-118], N[(N[(0.5 * N[(N[(x$95$m / y$95$m), $MachinePrecision] * N[(x$95$m / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[x$95$m, 2.15e+120], N[(N[(N[(x$95$m + N[(2.0 * y$95$m), $MachinePrecision]), $MachinePrecision] * N[(x$95$m - N[(2.0 * y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x$95$m * x$95$m), $MachinePrecision] + N[(y$95$m * N[(y$95$m * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(N[(y$95$m * -2.0), $MachinePrecision] / x$95$m), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(2.0 * N[(y$95$m / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
x_m = \left|x\right|
\\
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x\_m \leq 2 \cdot 10^{-118}:\\
\;\;\;\;0.5 \cdot \left(\frac{x\_m}{y\_m} \cdot \frac{x\_m}{y\_m}\right) + -1\\
\mathbf{elif}\;x\_m \leq 2.15 \cdot 10^{+120}:\\
\;\;\;\;\frac{\left(x\_m + 2 \cdot y\_m\right) \cdot \left(x\_m - 2 \cdot y\_m\right)}{x\_m \cdot x\_m + y\_m \cdot \left(y\_m \cdot 4\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \frac{y\_m \cdot -2}{x\_m}\right) \cdot \left(1 + 2 \cdot \frac{y\_m}{x\_m}\right)\\
\end{array}
\end{array}
if x < 1.99999999999999997e-118Initial program 44.9%
sub-neg44.9%
distribute-rgt-neg-in44.9%
cancel-sign-sub44.9%
distribute-lft-neg-out44.9%
remove-double-neg44.9%
distribute-lft-neg-out44.9%
distribute-lft-neg-in44.9%
distribute-rgt-neg-out44.9%
Simplified44.9%
Taylor expanded in x around 0 50.6%
pow250.6%
unpow250.6%
times-frac57.9%
Applied egg-rr57.9%
if 1.99999999999999997e-118 < x < 2.1500000000000001e120Initial program 77.1%
add-sqr-sqrt77.1%
difference-of-squares77.1%
*-commutative77.1%
associate-*r*77.1%
sqrt-prod77.1%
sqrt-unprod29.1%
add-sqr-sqrt66.8%
metadata-eval66.8%
*-commutative66.8%
associate-*r*66.8%
sqrt-prod66.8%
sqrt-unprod29.1%
add-sqr-sqrt77.1%
metadata-eval77.1%
Applied egg-rr77.1%
if 2.1500000000000001e120 < x Initial program 18.0%
add-sqr-sqrt18.0%
difference-of-squares18.0%
*-commutative18.0%
associate-*r*18.0%
sqrt-prod18.0%
sqrt-unprod4.0%
add-sqr-sqrt18.0%
metadata-eval18.0%
*-commutative18.0%
associate-*r*18.0%
sqrt-prod18.0%
sqrt-unprod4.0%
add-sqr-sqrt18.0%
metadata-eval18.0%
Applied egg-rr18.0%
add-sqr-sqrt18.0%
times-frac20.6%
+-commutative20.6%
fma-define20.6%
+-commutative20.6%
add-sqr-sqrt20.6%
hypot-define20.6%
*-commutative20.6%
associate-*r*20.6%
metadata-eval20.6%
swap-sqr20.6%
sqrt-unprod5.6%
add-sqr-sqrt20.6%
Applied egg-rr100.0%
Taylor expanded in x around inf 87.3%
associate-*r/87.3%
*-commutative87.3%
Simplified87.3%
Taylor expanded in y around 0 87.1%
Final simplification67.2%
x_m = (fabs.f64 x) y_m = (fabs.f64 y) (FPCore (x_m y_m) :precision binary64 (if (<= x_m 3.3e-96) (+ (* 0.5 (* (/ x_m y_m) (/ x_m y_m))) -1.0) (* (+ 1.0 (/ (* y_m -2.0) x_m)) (+ 1.0 (* 2.0 (/ y_m x_m))))))
x_m = fabs(x);
y_m = fabs(y);
double code(double x_m, double y_m) {
double tmp;
if (x_m <= 3.3e-96) {
tmp = (0.5 * ((x_m / y_m) * (x_m / y_m))) + -1.0;
} else {
tmp = (1.0 + ((y_m * -2.0) / x_m)) * (1.0 + (2.0 * (y_m / x_m)));
}
return tmp;
}
x_m = abs(x)
y_m = abs(y)
real(8) function code(x_m, y_m)
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8) :: tmp
if (x_m <= 3.3d-96) then
tmp = (0.5d0 * ((x_m / y_m) * (x_m / y_m))) + (-1.0d0)
else
tmp = (1.0d0 + ((y_m * (-2.0d0)) / x_m)) * (1.0d0 + (2.0d0 * (y_m / x_m)))
end if
code = tmp
end function
x_m = Math.abs(x);
y_m = Math.abs(y);
public static double code(double x_m, double y_m) {
double tmp;
if (x_m <= 3.3e-96) {
tmp = (0.5 * ((x_m / y_m) * (x_m / y_m))) + -1.0;
} else {
tmp = (1.0 + ((y_m * -2.0) / x_m)) * (1.0 + (2.0 * (y_m / x_m)));
}
return tmp;
}
x_m = math.fabs(x) y_m = math.fabs(y) def code(x_m, y_m): tmp = 0 if x_m <= 3.3e-96: tmp = (0.5 * ((x_m / y_m) * (x_m / y_m))) + -1.0 else: tmp = (1.0 + ((y_m * -2.0) / x_m)) * (1.0 + (2.0 * (y_m / x_m))) return tmp
x_m = abs(x) y_m = abs(y) function code(x_m, y_m) tmp = 0.0 if (x_m <= 3.3e-96) tmp = Float64(Float64(0.5 * Float64(Float64(x_m / y_m) * Float64(x_m / y_m))) + -1.0); else tmp = Float64(Float64(1.0 + Float64(Float64(y_m * -2.0) / x_m)) * Float64(1.0 + Float64(2.0 * Float64(y_m / x_m)))); end return tmp end
x_m = abs(x); y_m = abs(y); function tmp_2 = code(x_m, y_m) tmp = 0.0; if (x_m <= 3.3e-96) tmp = (0.5 * ((x_m / y_m) * (x_m / y_m))) + -1.0; else tmp = (1.0 + ((y_m * -2.0) / x_m)) * (1.0 + (2.0 * (y_m / x_m))); end tmp_2 = tmp; end
x_m = N[Abs[x], $MachinePrecision] y_m = N[Abs[y], $MachinePrecision] code[x$95$m_, y$95$m_] := If[LessEqual[x$95$m, 3.3e-96], N[(N[(0.5 * N[(N[(x$95$m / y$95$m), $MachinePrecision] * N[(x$95$m / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], N[(N[(1.0 + N[(N[(y$95$m * -2.0), $MachinePrecision] / x$95$m), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(2.0 * N[(y$95$m / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x\_m \leq 3.3 \cdot 10^{-96}:\\
\;\;\;\;0.5 \cdot \left(\frac{x\_m}{y\_m} \cdot \frac{x\_m}{y\_m}\right) + -1\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \frac{y\_m \cdot -2}{x\_m}\right) \cdot \left(1 + 2 \cdot \frac{y\_m}{x\_m}\right)\\
\end{array}
\end{array}
if x < 3.2999999999999999e-96Initial program 46.3%
sub-neg46.3%
distribute-rgt-neg-in46.3%
cancel-sign-sub46.3%
distribute-lft-neg-out46.3%
remove-double-neg46.3%
distribute-lft-neg-out46.3%
distribute-lft-neg-in46.3%
distribute-rgt-neg-out46.3%
Simplified46.3%
Taylor expanded in x around 0 50.7%
pow250.7%
unpow250.7%
times-frac57.8%
Applied egg-rr57.8%
if 3.2999999999999999e-96 < x Initial program 44.7%
add-sqr-sqrt44.7%
difference-of-squares44.7%
*-commutative44.7%
associate-*r*44.7%
sqrt-prod44.7%
sqrt-unprod17.0%
add-sqr-sqrt41.5%
metadata-eval41.5%
*-commutative41.5%
associate-*r*41.5%
sqrt-prod41.5%
sqrt-unprod17.0%
add-sqr-sqrt44.7%
metadata-eval44.7%
Applied egg-rr44.7%
add-sqr-sqrt44.7%
times-frac46.4%
+-commutative46.4%
fma-define46.4%
+-commutative46.4%
add-sqr-sqrt46.4%
hypot-define46.4%
*-commutative46.4%
associate-*r*46.4%
metadata-eval46.4%
swap-sqr46.4%
sqrt-unprod18.1%
add-sqr-sqrt46.4%
Applied egg-rr100.0%
Taylor expanded in x around inf 78.2%
associate-*r/78.2%
*-commutative78.2%
Simplified78.2%
Taylor expanded in y around 0 77.9%
Final simplification65.2%
x_m = (fabs.f64 x) y_m = (fabs.f64 y) (FPCore (x_m y_m) :precision binary64 (if (<= x_m 7.4e-98) (+ (* 0.5 (* (/ x_m y_m) (/ x_m y_m))) -1.0) 1.0))
x_m = fabs(x);
y_m = fabs(y);
double code(double x_m, double y_m) {
double tmp;
if (x_m <= 7.4e-98) {
tmp = (0.5 * ((x_m / y_m) * (x_m / y_m))) + -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
x_m = abs(x)
y_m = abs(y)
real(8) function code(x_m, y_m)
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8) :: tmp
if (x_m <= 7.4d-98) then
tmp = (0.5d0 * ((x_m / y_m) * (x_m / y_m))) + (-1.0d0)
else
tmp = 1.0d0
end if
code = tmp
end function
x_m = Math.abs(x);
y_m = Math.abs(y);
public static double code(double x_m, double y_m) {
double tmp;
if (x_m <= 7.4e-98) {
tmp = (0.5 * ((x_m / y_m) * (x_m / y_m))) + -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
x_m = math.fabs(x) y_m = math.fabs(y) def code(x_m, y_m): tmp = 0 if x_m <= 7.4e-98: tmp = (0.5 * ((x_m / y_m) * (x_m / y_m))) + -1.0 else: tmp = 1.0 return tmp
x_m = abs(x) y_m = abs(y) function code(x_m, y_m) tmp = 0.0 if (x_m <= 7.4e-98) tmp = Float64(Float64(0.5 * Float64(Float64(x_m / y_m) * Float64(x_m / y_m))) + -1.0); else tmp = 1.0; end return tmp end
x_m = abs(x); y_m = abs(y); function tmp_2 = code(x_m, y_m) tmp = 0.0; if (x_m <= 7.4e-98) tmp = (0.5 * ((x_m / y_m) * (x_m / y_m))) + -1.0; else tmp = 1.0; end tmp_2 = tmp; end
x_m = N[Abs[x], $MachinePrecision] y_m = N[Abs[y], $MachinePrecision] code[x$95$m_, y$95$m_] := If[LessEqual[x$95$m, 7.4e-98], N[(N[(0.5 * N[(N[(x$95$m / y$95$m), $MachinePrecision] * N[(x$95$m / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], 1.0]
\begin{array}{l}
x_m = \left|x\right|
\\
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x\_m \leq 7.4 \cdot 10^{-98}:\\
\;\;\;\;0.5 \cdot \left(\frac{x\_m}{y\_m} \cdot \frac{x\_m}{y\_m}\right) + -1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < 7.400000000000001e-98Initial program 46.3%
sub-neg46.3%
distribute-rgt-neg-in46.3%
cancel-sign-sub46.3%
distribute-lft-neg-out46.3%
remove-double-neg46.3%
distribute-lft-neg-out46.3%
distribute-lft-neg-in46.3%
distribute-rgt-neg-out46.3%
Simplified46.3%
Taylor expanded in x around 0 50.7%
pow250.7%
unpow250.7%
times-frac57.8%
Applied egg-rr57.8%
if 7.400000000000001e-98 < x Initial program 44.7%
sub-neg44.7%
distribute-rgt-neg-in44.7%
cancel-sign-sub44.7%
distribute-lft-neg-out44.7%
remove-double-neg44.7%
distribute-lft-neg-out44.7%
distribute-lft-neg-in44.7%
distribute-rgt-neg-out44.7%
Simplified44.7%
Taylor expanded in x around inf 77.1%
Final simplification64.9%
x_m = (fabs.f64 x) y_m = (fabs.f64 y) (FPCore (x_m y_m) :precision binary64 (if (<= x_m 1.3e-105) -1.0 1.0))
x_m = fabs(x);
y_m = fabs(y);
double code(double x_m, double y_m) {
double tmp;
if (x_m <= 1.3e-105) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
x_m = abs(x)
y_m = abs(y)
real(8) function code(x_m, y_m)
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8) :: tmp
if (x_m <= 1.3d-105) then
tmp = -1.0d0
else
tmp = 1.0d0
end if
code = tmp
end function
x_m = Math.abs(x);
y_m = Math.abs(y);
public static double code(double x_m, double y_m) {
double tmp;
if (x_m <= 1.3e-105) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
x_m = math.fabs(x) y_m = math.fabs(y) def code(x_m, y_m): tmp = 0 if x_m <= 1.3e-105: tmp = -1.0 else: tmp = 1.0 return tmp
x_m = abs(x) y_m = abs(y) function code(x_m, y_m) tmp = 0.0 if (x_m <= 1.3e-105) tmp = -1.0; else tmp = 1.0; end return tmp end
x_m = abs(x); y_m = abs(y); function tmp_2 = code(x_m, y_m) tmp = 0.0; if (x_m <= 1.3e-105) tmp = -1.0; else tmp = 1.0; end tmp_2 = tmp; end
x_m = N[Abs[x], $MachinePrecision] y_m = N[Abs[y], $MachinePrecision] code[x$95$m_, y$95$m_] := If[LessEqual[x$95$m, 1.3e-105], -1.0, 1.0]
\begin{array}{l}
x_m = \left|x\right|
\\
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x\_m \leq 1.3 \cdot 10^{-105}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < 1.2999999999999999e-105Initial program 45.9%
sub-neg45.9%
distribute-rgt-neg-in45.9%
cancel-sign-sub45.9%
distribute-lft-neg-out45.9%
remove-double-neg45.9%
distribute-lft-neg-out45.9%
distribute-lft-neg-in45.9%
distribute-rgt-neg-out45.9%
Simplified46.0%
Taylor expanded in x around 0 56.8%
if 1.2999999999999999e-105 < x Initial program 45.3%
sub-neg45.3%
distribute-rgt-neg-in45.3%
cancel-sign-sub45.3%
distribute-lft-neg-out45.3%
remove-double-neg45.3%
distribute-lft-neg-out45.3%
distribute-lft-neg-in45.3%
distribute-rgt-neg-out45.3%
Simplified45.3%
Taylor expanded in x around inf 77.4%
x_m = (fabs.f64 x) y_m = (fabs.f64 y) (FPCore (x_m y_m) :precision binary64 -1.0)
x_m = fabs(x);
y_m = fabs(y);
double code(double x_m, double y_m) {
return -1.0;
}
x_m = abs(x)
y_m = abs(y)
real(8) function code(x_m, y_m)
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
code = -1.0d0
end function
x_m = Math.abs(x);
y_m = Math.abs(y);
public static double code(double x_m, double y_m) {
return -1.0;
}
x_m = math.fabs(x) y_m = math.fabs(y) def code(x_m, y_m): return -1.0
x_m = abs(x) y_m = abs(y) function code(x_m, y_m) return -1.0 end
x_m = abs(x); y_m = abs(y); function tmp = code(x_m, y_m) tmp = -1.0; end
x_m = N[Abs[x], $MachinePrecision] y_m = N[Abs[y], $MachinePrecision] code[x$95$m_, y$95$m_] := -1.0
\begin{array}{l}
x_m = \left|x\right|
\\
y_m = \left|y\right|
\\
-1
\end{array}
Initial program 45.7%
sub-neg45.7%
distribute-rgt-neg-in45.7%
cancel-sign-sub45.7%
distribute-lft-neg-out45.7%
remove-double-neg45.7%
distribute-lft-neg-out45.7%
distribute-lft-neg-in45.7%
distribute-rgt-neg-out45.7%
Simplified45.7%
Taylor expanded in x around 0 44.4%
(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 2024182
(FPCore (x y)
:name "Diagrams.TwoD.Arc:arcBetween from diagrams-lib-1.3.0.3"
:precision binary64
:alt
(! :herbie-platform default (if (< (/ (- (* x x) (* (* y 4) y)) (+ (* x x) (* (* y 4) y))) 9743233849626781/10000000000000000) (- (/ (* x x) (+ (* x x) (* (* y y) 4))) (/ (* (* y y) 4) (+ (* x x) (* (* y y) 4)))) (- (pow (/ x (sqrt (+ (* x x) (* (* y y) 4)))) 2) (/ (* (* y y) 4) (+ (* x x) (* (* y y) 4))))))
(/ (- (* x x) (* (* y 4.0) y)) (+ (* x x) (* (* y 4.0) y))))