
(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 5 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
(let* ((t_0 (* y (* y 4.0))))
(if (<= t_0 0.0)
(+ 1.0 (/ -8.0 (/ (/ x y) (/ y x))))
(if (<= t_0 5e+149)
(/ (- (* x x) t_0) (+ t_0 (* x x)))
(+ (* 0.5 (* (/ x y) (/ x y))) -1.0)))))
double code(double x, double y) {
double t_0 = y * (y * 4.0);
double tmp;
if (t_0 <= 0.0) {
tmp = 1.0 + (-8.0 / ((x / y) / (y / x)));
} else if (t_0 <= 5e+149) {
tmp = ((x * x) - t_0) / (t_0 + (x * x));
} else {
tmp = (0.5 * ((x / y) * (x / y))) + -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) :: tmp
t_0 = y * (y * 4.0d0)
if (t_0 <= 0.0d0) then
tmp = 1.0d0 + ((-8.0d0) / ((x / y) / (y / x)))
else if (t_0 <= 5d+149) then
tmp = ((x * x) - t_0) / (t_0 + (x * x))
else
tmp = (0.5d0 * ((x / y) * (x / y))) + (-1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y * (y * 4.0);
double tmp;
if (t_0 <= 0.0) {
tmp = 1.0 + (-8.0 / ((x / y) / (y / x)));
} else if (t_0 <= 5e+149) {
tmp = ((x * x) - t_0) / (t_0 + (x * x));
} else {
tmp = (0.5 * ((x / y) * (x / y))) + -1.0;
}
return tmp;
}
def code(x, y): t_0 = y * (y * 4.0) tmp = 0 if t_0 <= 0.0: tmp = 1.0 + (-8.0 / ((x / y) / (y / x))) elif t_0 <= 5e+149: tmp = ((x * x) - t_0) / (t_0 + (x * x)) else: tmp = (0.5 * ((x / y) * (x / y))) + -1.0 return tmp
function code(x, y) t_0 = Float64(y * Float64(y * 4.0)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(1.0 + Float64(-8.0 / Float64(Float64(x / y) / Float64(y / x)))); elseif (t_0 <= 5e+149) tmp = Float64(Float64(Float64(x * x) - t_0) / Float64(t_0 + Float64(x * x))); else tmp = Float64(Float64(0.5 * Float64(Float64(x / y) * Float64(x / y))) + -1.0); end return tmp end
function tmp_2 = code(x, y) t_0 = y * (y * 4.0); tmp = 0.0; if (t_0 <= 0.0) tmp = 1.0 + (-8.0 / ((x / y) / (y / x))); elseif (t_0 <= 5e+149) tmp = ((x * x) - t_0) / (t_0 + (x * x)); else tmp = (0.5 * ((x / y) * (x / y))) + -1.0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(y * 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(1.0 + N[(-8.0 / N[(N[(x / y), $MachinePrecision] / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+149], N[(N[(N[(x * x), $MachinePrecision] - t$95$0), $MachinePrecision] / N[(t$95$0 + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[(N[(x / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(y \cdot 4\right)\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;1 + \frac{-8}{\frac{\frac{x}{y}}{\frac{y}{x}}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+149}:\\
\;\;\;\;\frac{x \cdot x - t\_0}{t\_0 + x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\frac{x}{y} \cdot \frac{x}{y}\right) + -1\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 4) y) < 0.0Initial program 45.7%
sub-neg45.7%
add-sqr-sqrt14.2%
associate-*r*14.2%
add-sqr-sqrt14.2%
fma-def14.2%
add-sqr-sqrt14.2%
*-commutative14.2%
distribute-rgt-neg-in14.2%
distribute-rgt-neg-in14.2%
metadata-eval14.2%
Applied egg-rr14.2%
Taylor expanded in y around 0 71.4%
associate-*r/71.4%
associate-/l*71.4%
unpow271.4%
unpow271.4%
times-frac89.7%
unpow289.7%
Simplified89.7%
pow289.7%
clear-num89.7%
un-div-inv89.7%
Applied egg-rr89.7%
if 0.0 < (*.f64 (*.f64 y 4) y) < 4.9999999999999999e149Initial program 77.8%
if 4.9999999999999999e149 < (*.f64 (*.f64 y 4) y) Initial program 23.1%
Taylor expanded in x around 0 81.5%
unpow281.5%
pow281.5%
times-frac87.6%
Applied egg-rr87.6%
Final simplification84.5%
(FPCore (x y) :precision binary64 (if (or (<= y 7e-14) (and (not (<= y 6.8e-6)) (<= y 1.15e+37))) (+ 1.0 (/ -8.0 (/ (/ x y) (/ y x)))) -1.0))
double code(double x, double y) {
double tmp;
if ((y <= 7e-14) || (!(y <= 6.8e-6) && (y <= 1.15e+37))) {
tmp = 1.0 + (-8.0 / ((x / y) / (y / x)));
} 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 <= 7d-14) .or. (.not. (y <= 6.8d-6)) .and. (y <= 1.15d+37)) then
tmp = 1.0d0 + ((-8.0d0) / ((x / y) / (y / x)))
else
tmp = -1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= 7e-14) || (!(y <= 6.8e-6) && (y <= 1.15e+37))) {
tmp = 1.0 + (-8.0 / ((x / y) / (y / x)));
} else {
tmp = -1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= 7e-14) or (not (y <= 6.8e-6) and (y <= 1.15e+37)): tmp = 1.0 + (-8.0 / ((x / y) / (y / x))) else: tmp = -1.0 return tmp
function code(x, y) tmp = 0.0 if ((y <= 7e-14) || (!(y <= 6.8e-6) && (y <= 1.15e+37))) tmp = Float64(1.0 + Float64(-8.0 / Float64(Float64(x / y) / Float64(y / x)))); else tmp = -1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= 7e-14) || (~((y <= 6.8e-6)) && (y <= 1.15e+37))) tmp = 1.0 + (-8.0 / ((x / y) / (y / x))); else tmp = -1.0; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, 7e-14], And[N[Not[LessEqual[y, 6.8e-6]], $MachinePrecision], LessEqual[y, 1.15e+37]]], N[(1.0 + N[(-8.0 / N[(N[(x / y), $MachinePrecision] / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7 \cdot 10^{-14} \lor \neg \left(y \leq 6.8 \cdot 10^{-6}\right) \land y \leq 1.15 \cdot 10^{+37}:\\
\;\;\;\;1 + \frac{-8}{\frac{\frac{x}{y}}{\frac{y}{x}}}\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\end{array}
if y < 7.0000000000000005e-14 or 6.80000000000000012e-6 < y < 1.15000000000000001e37Initial program 57.3%
sub-neg57.3%
add-sqr-sqrt24.9%
associate-*r*24.9%
add-sqr-sqrt24.8%
fma-def24.8%
add-sqr-sqrt24.9%
*-commutative24.9%
distribute-rgt-neg-in24.9%
distribute-rgt-neg-in24.9%
metadata-eval24.9%
Applied egg-rr24.9%
Taylor expanded in y around 0 55.8%
associate-*r/55.8%
associate-/l*55.8%
unpow255.8%
unpow255.8%
times-frac64.9%
unpow264.9%
Simplified64.9%
pow264.9%
clear-num64.9%
un-div-inv64.9%
Applied egg-rr64.9%
if 7.0000000000000005e-14 < y < 6.80000000000000012e-6 or 1.15000000000000001e37 < y Initial program 26.5%
Taylor expanded in x around 0 90.5%
Final simplification71.3%
(FPCore (x y) :precision binary64 (if (or (<= y 5.4e-24) (and (not (<= y 0.000205)) (<= y 6.5e+35))) (+ 1.0 (/ -8.0 (/ (/ x y) (/ y x)))) (+ (* 0.5 (* (/ x y) (/ x y))) -1.0)))
double code(double x, double y) {
double tmp;
if ((y <= 5.4e-24) || (!(y <= 0.000205) && (y <= 6.5e+35))) {
tmp = 1.0 + (-8.0 / ((x / y) / (y / x)));
} else {
tmp = (0.5 * ((x / y) * (x / y))) + -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 <= 5.4d-24) .or. (.not. (y <= 0.000205d0)) .and. (y <= 6.5d+35)) then
tmp = 1.0d0 + ((-8.0d0) / ((x / y) / (y / x)))
else
tmp = (0.5d0 * ((x / y) * (x / y))) + (-1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= 5.4e-24) || (!(y <= 0.000205) && (y <= 6.5e+35))) {
tmp = 1.0 + (-8.0 / ((x / y) / (y / x)));
} else {
tmp = (0.5 * ((x / y) * (x / y))) + -1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= 5.4e-24) or (not (y <= 0.000205) and (y <= 6.5e+35)): tmp = 1.0 + (-8.0 / ((x / y) / (y / x))) else: tmp = (0.5 * ((x / y) * (x / y))) + -1.0 return tmp
function code(x, y) tmp = 0.0 if ((y <= 5.4e-24) || (!(y <= 0.000205) && (y <= 6.5e+35))) tmp = Float64(1.0 + Float64(-8.0 / Float64(Float64(x / y) / Float64(y / x)))); else tmp = Float64(Float64(0.5 * Float64(Float64(x / y) * Float64(x / y))) + -1.0); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= 5.4e-24) || (~((y <= 0.000205)) && (y <= 6.5e+35))) tmp = 1.0 + (-8.0 / ((x / y) / (y / x))); else tmp = (0.5 * ((x / y) * (x / y))) + -1.0; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, 5.4e-24], And[N[Not[LessEqual[y, 0.000205]], $MachinePrecision], LessEqual[y, 6.5e+35]]], N[(1.0 + N[(-8.0 / N[(N[(x / y), $MachinePrecision] / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[(N[(x / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.4 \cdot 10^{-24} \lor \neg \left(y \leq 0.000205\right) \land y \leq 6.5 \cdot 10^{+35}:\\
\;\;\;\;1 + \frac{-8}{\frac{\frac{x}{y}}{\frac{y}{x}}}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\frac{x}{y} \cdot \frac{x}{y}\right) + -1\\
\end{array}
\end{array}
if y < 5.40000000000000014e-24 or 2.05e-4 < y < 6.5000000000000003e35Initial program 57.0%
sub-neg57.0%
add-sqr-sqrt25.0%
associate-*r*25.0%
add-sqr-sqrt25.0%
fma-def25.0%
add-sqr-sqrt25.0%
*-commutative25.0%
distribute-rgt-neg-in25.0%
distribute-rgt-neg-in25.0%
metadata-eval25.0%
Applied egg-rr25.0%
Taylor expanded in y around 0 55.5%
associate-*r/55.5%
associate-/l*55.5%
unpow255.5%
unpow255.5%
times-frac64.8%
unpow264.8%
Simplified64.8%
pow264.8%
clear-num64.8%
un-div-inv64.8%
Applied egg-rr64.8%
if 5.40000000000000014e-24 < y < 2.05e-4 or 6.5000000000000003e35 < y Initial program 27.7%
Taylor expanded in x around 0 85.0%
unpow285.0%
pow285.0%
times-frac89.8%
Applied egg-rr89.8%
Final simplification71.1%
(FPCore (x y) :precision binary64 (if (<= y 4e-20) 1.0 (if (<= y 0.2) -1.0 (if (<= y 1e+36) 1.0 -1.0))))
double code(double x, double y) {
double tmp;
if (y <= 4e-20) {
tmp = 1.0;
} else if (y <= 0.2) {
tmp = -1.0;
} else if (y <= 1e+36) {
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 <= 4d-20) then
tmp = 1.0d0
else if (y <= 0.2d0) then
tmp = -1.0d0
else if (y <= 1d+36) 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 <= 4e-20) {
tmp = 1.0;
} else if (y <= 0.2) {
tmp = -1.0;
} else if (y <= 1e+36) {
tmp = 1.0;
} else {
tmp = -1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 4e-20: tmp = 1.0 elif y <= 0.2: tmp = -1.0 elif y <= 1e+36: tmp = 1.0 else: tmp = -1.0 return tmp
function code(x, y) tmp = 0.0 if (y <= 4e-20) tmp = 1.0; elseif (y <= 0.2) tmp = -1.0; elseif (y <= 1e+36) tmp = 1.0; else tmp = -1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 4e-20) tmp = 1.0; elseif (y <= 0.2) tmp = -1.0; elseif (y <= 1e+36) tmp = 1.0; else tmp = -1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 4e-20], 1.0, If[LessEqual[y, 0.2], -1.0, If[LessEqual[y, 1e+36], 1.0, -1.0]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4 \cdot 10^{-20}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 0.2:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq 10^{+36}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\end{array}
if y < 3.99999999999999978e-20 or 0.20000000000000001 < y < 1.00000000000000004e36Initial program 57.3%
Taylor expanded in x around inf 63.6%
if 3.99999999999999978e-20 < y < 0.20000000000000001 or 1.00000000000000004e36 < y Initial program 26.5%
Taylor expanded in x around 0 90.5%
Final simplification70.3%
(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 49.6%
Taylor expanded in x around 0 50.0%
Final simplification50.0%
(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 2024029
(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))))