
(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 12 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 (hypot x (* y 2.0)))) (* (/ (fma y 2.0 x) t_0) (/ (- x (* y 2.0)) t_0))))
double code(double x, double y) {
double t_0 = hypot(x, (y * 2.0));
return (fma(y, 2.0, x) / t_0) * ((x - (y * 2.0)) / t_0);
}
function code(x, y) t_0 = hypot(x, Float64(y * 2.0)) return Float64(Float64(fma(y, 2.0, x) / t_0) * Float64(Float64(x - Float64(y * 2.0)) / t_0)) end
code[x_, y_] := Block[{t$95$0 = N[Sqrt[x ^ 2 + N[(y * 2.0), $MachinePrecision] ^ 2], $MachinePrecision]}, N[(N[(N[(y * 2.0 + x), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[(x - N[(y * 2.0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{hypot}\left(x, y \cdot 2\right)\\
\frac{\mathsf{fma}\left(y, 2, x\right)}{t_0} \cdot \frac{x - y \cdot 2}{t_0}
\end{array}
\end{array}
Initial program 48.8%
add-sqr-sqrt48.8%
difference-of-squares48.8%
*-commutative48.8%
associate-*r*48.8%
sqrt-prod48.8%
sqrt-unprod20.2%
add-sqr-sqrt34.4%
metadata-eval34.4%
*-commutative34.4%
associate-*r*34.4%
sqrt-prod34.4%
sqrt-unprod20.2%
add-sqr-sqrt48.8%
metadata-eval48.8%
Applied egg-rr48.8%
add-sqr-sqrt48.8%
times-frac50.4%
+-commutative50.4%
fma-def50.4%
add-sqr-sqrt50.4%
hypot-def50.4%
sqrt-prod21.0%
*-commutative21.0%
sqrt-prod21.0%
metadata-eval21.0%
associate-*r*21.0%
add-sqr-sqrt50.4%
*-commutative50.4%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* y (* y 4.0))) (t_1 (hypot x (* y 2.0))))
(if (<= t_0 2000.0)
(* (/ (- x (* y 2.0)) t_1) (+ 1.0 (/ (* y 2.0) x)))
(if (<= t_0 5e+210)
(/ (fma y 2.0 x) (/ (pow t_1 2.0) (+ x (* y -2.0))))
(* (/ (fma y 2.0 x) t_1) (+ (* 0.5 (/ x y)) -1.0))))))
double code(double x, double y) {
double t_0 = y * (y * 4.0);
double t_1 = hypot(x, (y * 2.0));
double tmp;
if (t_0 <= 2000.0) {
tmp = ((x - (y * 2.0)) / t_1) * (1.0 + ((y * 2.0) / x));
} else if (t_0 <= 5e+210) {
tmp = fma(y, 2.0, x) / (pow(t_1, 2.0) / (x + (y * -2.0)));
} else {
tmp = (fma(y, 2.0, x) / t_1) * ((0.5 * (x / y)) + -1.0);
}
return tmp;
}
function code(x, y) t_0 = Float64(y * Float64(y * 4.0)) t_1 = hypot(x, Float64(y * 2.0)) tmp = 0.0 if (t_0 <= 2000.0) tmp = Float64(Float64(Float64(x - Float64(y * 2.0)) / t_1) * Float64(1.0 + Float64(Float64(y * 2.0) / x))); elseif (t_0 <= 5e+210) tmp = Float64(fma(y, 2.0, x) / Float64((t_1 ^ 2.0) / Float64(x + Float64(y * -2.0)))); else tmp = Float64(Float64(fma(y, 2.0, x) / t_1) * Float64(Float64(0.5 * 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[Sqrt[x ^ 2 + N[(y * 2.0), $MachinePrecision] ^ 2], $MachinePrecision]}, If[LessEqual[t$95$0, 2000.0], N[(N[(N[(x - N[(y * 2.0), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision] * N[(1.0 + N[(N[(y * 2.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+210], N[(N[(y * 2.0 + x), $MachinePrecision] / N[(N[Power[t$95$1, 2.0], $MachinePrecision] / N[(x + N[(y * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * 2.0 + x), $MachinePrecision] / t$95$1), $MachinePrecision] * N[(N[(0.5 * N[(x / y), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(y \cdot 4\right)\\
t_1 := \mathsf{hypot}\left(x, y \cdot 2\right)\\
\mathbf{if}\;t_0 \leq 2000:\\
\;\;\;\;\frac{x - y \cdot 2}{t_1} \cdot \left(1 + \frac{y \cdot 2}{x}\right)\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+210}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, 2, x\right)}{\frac{{t_1}^{2}}{x + y \cdot -2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, 2, x\right)}{t_1} \cdot \left(0.5 \cdot \frac{x}{y} + -1\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 4) y) < 2e3Initial program 57.0%
add-sqr-sqrt57.0%
difference-of-squares57.0%
*-commutative57.0%
associate-*r*57.0%
sqrt-prod57.0%
sqrt-unprod25.7%
add-sqr-sqrt50.6%
metadata-eval50.6%
*-commutative50.6%
associate-*r*50.6%
sqrt-prod50.6%
sqrt-unprod25.7%
add-sqr-sqrt57.0%
metadata-eval57.0%
Applied egg-rr57.0%
add-sqr-sqrt57.0%
times-frac58.3%
+-commutative58.3%
fma-def58.3%
add-sqr-sqrt58.3%
hypot-def58.3%
sqrt-prod26.2%
*-commutative26.2%
sqrt-prod26.2%
metadata-eval26.2%
associate-*r*26.2%
add-sqr-sqrt58.3%
*-commutative58.3%
Applied egg-rr99.9%
Taylor expanded in y around 0 48.0%
associate-*r/48.0%
*-commutative48.0%
Simplified48.0%
if 2e3 < (*.f64 (*.f64 y 4) y) < 4.9999999999999998e210Initial program 81.5%
add-sqr-sqrt81.5%
difference-of-squares81.6%
*-commutative81.6%
associate-*r*81.6%
sqrt-prod81.6%
sqrt-unprod26.3%
add-sqr-sqrt35.2%
metadata-eval35.2%
*-commutative35.2%
associate-*r*35.2%
sqrt-prod35.2%
sqrt-unprod26.3%
add-sqr-sqrt81.6%
metadata-eval81.6%
Applied egg-rr81.6%
associate-/l*82.0%
div-inv82.0%
+-commutative82.0%
fma-def82.0%
*-commutative82.0%
associate-*r*82.0%
metadata-eval82.0%
swap-sqr82.0%
pow182.0%
metadata-eval82.0%
sqrt-pow282.0%
hypot-udef82.0%
Applied egg-rr82.0%
associate-*r/82.0%
*-rgt-identity82.0%
*-commutative82.0%
cancel-sign-sub-inv82.0%
metadata-eval82.0%
*-commutative82.0%
Simplified82.0%
if 4.9999999999999998e210 < (*.f64 (*.f64 y 4) y) Initial program 15.2%
add-sqr-sqrt15.2%
difference-of-squares15.2%
*-commutative15.2%
associate-*r*15.2%
sqrt-prod15.2%
sqrt-unprod7.5%
add-sqr-sqrt7.7%
metadata-eval7.7%
*-commutative7.7%
associate-*r*7.7%
sqrt-prod7.7%
sqrt-unprod7.5%
add-sqr-sqrt15.2%
metadata-eval15.2%
Applied egg-rr15.2%
add-sqr-sqrt15.2%
times-frac17.8%
+-commutative17.8%
fma-def17.8%
add-sqr-sqrt17.8%
hypot-def17.8%
sqrt-prod9.3%
*-commutative9.3%
sqrt-prod9.3%
metadata-eval9.3%
associate-*r*9.3%
add-sqr-sqrt17.8%
*-commutative17.8%
Applied egg-rr100.0%
Taylor expanded in x around 0 55.6%
Final simplification56.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* y (* y 4.0))) (t_1 (- x (* y 2.0))) (t_2 (hypot x (* y 2.0))))
(if (<= t_0 2000.0)
(* (/ t_1 t_2) (+ 1.0 (/ (* y 2.0) x)))
(if (<= t_0 5e+210)
(/ (* t_1 (+ x (* y 2.0))) (+ t_0 (* x x)))
(* (/ (fma y 2.0 x) t_2) (+ (* 0.5 (/ x y)) -1.0))))))
double code(double x, double y) {
double t_0 = y * (y * 4.0);
double t_1 = x - (y * 2.0);
double t_2 = hypot(x, (y * 2.0));
double tmp;
if (t_0 <= 2000.0) {
tmp = (t_1 / t_2) * (1.0 + ((y * 2.0) / x));
} else if (t_0 <= 5e+210) {
tmp = (t_1 * (x + (y * 2.0))) / (t_0 + (x * x));
} else {
tmp = (fma(y, 2.0, x) / t_2) * ((0.5 * (x / y)) + -1.0);
}
return tmp;
}
function code(x, y) t_0 = Float64(y * Float64(y * 4.0)) t_1 = Float64(x - Float64(y * 2.0)) t_2 = hypot(x, Float64(y * 2.0)) tmp = 0.0 if (t_0 <= 2000.0) tmp = Float64(Float64(t_1 / t_2) * Float64(1.0 + Float64(Float64(y * 2.0) / x))); elseif (t_0 <= 5e+210) tmp = Float64(Float64(t_1 * Float64(x + Float64(y * 2.0))) / Float64(t_0 + Float64(x * x))); else tmp = Float64(Float64(fma(y, 2.0, x) / t_2) * Float64(Float64(0.5 * 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[(x - N[(y * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[x ^ 2 + N[(y * 2.0), $MachinePrecision] ^ 2], $MachinePrecision]}, If[LessEqual[t$95$0, 2000.0], N[(N[(t$95$1 / t$95$2), $MachinePrecision] * N[(1.0 + N[(N[(y * 2.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+210], N[(N[(t$95$1 * N[(x + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * 2.0 + x), $MachinePrecision] / t$95$2), $MachinePrecision] * N[(N[(0.5 * N[(x / y), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(y \cdot 4\right)\\
t_1 := x - y \cdot 2\\
t_2 := \mathsf{hypot}\left(x, y \cdot 2\right)\\
\mathbf{if}\;t_0 \leq 2000:\\
\;\;\;\;\frac{t_1}{t_2} \cdot \left(1 + \frac{y \cdot 2}{x}\right)\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+210}:\\
\;\;\;\;\frac{t_1 \cdot \left(x + y \cdot 2\right)}{t_0 + x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, 2, x\right)}{t_2} \cdot \left(0.5 \cdot \frac{x}{y} + -1\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 4) y) < 2e3Initial program 57.0%
add-sqr-sqrt57.0%
difference-of-squares57.0%
*-commutative57.0%
associate-*r*57.0%
sqrt-prod57.0%
sqrt-unprod25.7%
add-sqr-sqrt50.6%
metadata-eval50.6%
*-commutative50.6%
associate-*r*50.6%
sqrt-prod50.6%
sqrt-unprod25.7%
add-sqr-sqrt57.0%
metadata-eval57.0%
Applied egg-rr57.0%
add-sqr-sqrt57.0%
times-frac58.3%
+-commutative58.3%
fma-def58.3%
add-sqr-sqrt58.3%
hypot-def58.3%
sqrt-prod26.2%
*-commutative26.2%
sqrt-prod26.2%
metadata-eval26.2%
associate-*r*26.2%
add-sqr-sqrt58.3%
*-commutative58.3%
Applied egg-rr99.9%
Taylor expanded in y around 0 48.0%
associate-*r/48.0%
*-commutative48.0%
Simplified48.0%
if 2e3 < (*.f64 (*.f64 y 4) y) < 4.9999999999999998e210Initial program 81.5%
add-sqr-sqrt81.5%
difference-of-squares81.6%
*-commutative81.6%
associate-*r*81.6%
sqrt-prod81.6%
sqrt-unprod26.3%
add-sqr-sqrt35.2%
metadata-eval35.2%
*-commutative35.2%
associate-*r*35.2%
sqrt-prod35.2%
sqrt-unprod26.3%
add-sqr-sqrt81.6%
metadata-eval81.6%
Applied egg-rr81.6%
if 4.9999999999999998e210 < (*.f64 (*.f64 y 4) y) Initial program 15.2%
add-sqr-sqrt15.2%
difference-of-squares15.2%
*-commutative15.2%
associate-*r*15.2%
sqrt-prod15.2%
sqrt-unprod7.5%
add-sqr-sqrt7.7%
metadata-eval7.7%
*-commutative7.7%
associate-*r*7.7%
sqrt-prod7.7%
sqrt-unprod7.5%
add-sqr-sqrt15.2%
metadata-eval15.2%
Applied egg-rr15.2%
add-sqr-sqrt15.2%
times-frac17.8%
+-commutative17.8%
fma-def17.8%
add-sqr-sqrt17.8%
hypot-def17.8%
sqrt-prod9.3%
*-commutative9.3%
sqrt-prod9.3%
metadata-eval9.3%
associate-*r*9.3%
add-sqr-sqrt17.8%
*-commutative17.8%
Applied egg-rr100.0%
Taylor expanded in x around 0 55.6%
Final simplification56.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* y (* y 4.0))) (t_1 (- x (* y 2.0))))
(if (<= t_0 2000.0)
(+ 1.0 (/ -6.0 (pow (/ x y) 2.0)))
(if (<= t_0 5e+210)
(/ (* t_1 (+ x (* y 2.0))) (+ t_0 (* x x)))
(* (/ t_1 (hypot x (* y 2.0))) (+ 1.0 (* 0.5 (/ x y))))))))
double code(double x, double y) {
double t_0 = y * (y * 4.0);
double t_1 = x - (y * 2.0);
double tmp;
if (t_0 <= 2000.0) {
tmp = 1.0 + (-6.0 / pow((x / y), 2.0));
} else if (t_0 <= 5e+210) {
tmp = (t_1 * (x + (y * 2.0))) / (t_0 + (x * x));
} else {
tmp = (t_1 / hypot(x, (y * 2.0))) * (1.0 + (0.5 * (x / y)));
}
return tmp;
}
public static double code(double x, double y) {
double t_0 = y * (y * 4.0);
double t_1 = x - (y * 2.0);
double tmp;
if (t_0 <= 2000.0) {
tmp = 1.0 + (-6.0 / Math.pow((x / y), 2.0));
} else if (t_0 <= 5e+210) {
tmp = (t_1 * (x + (y * 2.0))) / (t_0 + (x * x));
} else {
tmp = (t_1 / Math.hypot(x, (y * 2.0))) * (1.0 + (0.5 * (x / y)));
}
return tmp;
}
def code(x, y): t_0 = y * (y * 4.0) t_1 = x - (y * 2.0) tmp = 0 if t_0 <= 2000.0: tmp = 1.0 + (-6.0 / math.pow((x / y), 2.0)) elif t_0 <= 5e+210: tmp = (t_1 * (x + (y * 2.0))) / (t_0 + (x * x)) else: tmp = (t_1 / math.hypot(x, (y * 2.0))) * (1.0 + (0.5 * (x / y))) return tmp
function code(x, y) t_0 = Float64(y * Float64(y * 4.0)) t_1 = Float64(x - Float64(y * 2.0)) tmp = 0.0 if (t_0 <= 2000.0) tmp = Float64(1.0 + Float64(-6.0 / (Float64(x / y) ^ 2.0))); elseif (t_0 <= 5e+210) tmp = Float64(Float64(t_1 * Float64(x + Float64(y * 2.0))) / Float64(t_0 + Float64(x * x))); else tmp = Float64(Float64(t_1 / hypot(x, Float64(y * 2.0))) * Float64(1.0 + Float64(0.5 * Float64(x / y)))); end return tmp end
function tmp_2 = code(x, y) t_0 = y * (y * 4.0); t_1 = x - (y * 2.0); tmp = 0.0; if (t_0 <= 2000.0) tmp = 1.0 + (-6.0 / ((x / y) ^ 2.0)); elseif (t_0 <= 5e+210) tmp = (t_1 * (x + (y * 2.0))) / (t_0 + (x * x)); else tmp = (t_1 / hypot(x, (y * 2.0))) * (1.0 + (0.5 * (x / y))); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(y * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x - N[(y * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2000.0], N[(1.0 + N[(-6.0 / N[Power[N[(x / y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+210], N[(N[(t$95$1 * N[(x + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 / N[Sqrt[x ^ 2 + N[(y * 2.0), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(0.5 * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(y \cdot 4\right)\\
t_1 := x - y \cdot 2\\
\mathbf{if}\;t_0 \leq 2000:\\
\;\;\;\;1 + \frac{-6}{{\left(\frac{x}{y}\right)}^{2}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+210}:\\
\;\;\;\;\frac{t_1 \cdot \left(x + y \cdot 2\right)}{t_0 + x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1}{\mathsf{hypot}\left(x, y \cdot 2\right)} \cdot \left(1 + 0.5 \cdot \frac{x}{y}\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 4) y) < 2e3Initial program 57.0%
add-sqr-sqrt57.0%
difference-of-squares57.0%
*-commutative57.0%
associate-*r*57.0%
sqrt-prod57.0%
sqrt-unprod25.7%
add-sqr-sqrt50.6%
metadata-eval50.6%
*-commutative50.6%
associate-*r*50.6%
sqrt-prod50.6%
sqrt-unprod25.7%
add-sqr-sqrt57.0%
metadata-eval57.0%
Applied egg-rr57.0%
add-sqr-sqrt57.0%
times-frac58.3%
+-commutative58.3%
fma-def58.3%
add-sqr-sqrt58.3%
hypot-def58.3%
sqrt-prod26.2%
*-commutative26.2%
sqrt-prod26.2%
metadata-eval26.2%
associate-*r*26.2%
add-sqr-sqrt58.3%
*-commutative58.3%
Applied egg-rr99.9%
Taylor expanded in y around 0 48.0%
associate-*r/48.0%
*-commutative48.0%
Simplified48.0%
Taylor expanded in y around 0 77.0%
associate-*r/77.0%
associate-/l*77.0%
unpow277.0%
unpow277.0%
times-frac83.0%
unpow283.0%
Simplified83.0%
if 2e3 < (*.f64 (*.f64 y 4) y) < 4.9999999999999998e210Initial program 81.5%
add-sqr-sqrt81.5%
difference-of-squares81.6%
*-commutative81.6%
associate-*r*81.6%
sqrt-prod81.6%
sqrt-unprod26.3%
add-sqr-sqrt35.2%
metadata-eval35.2%
*-commutative35.2%
associate-*r*35.2%
sqrt-prod35.2%
sqrt-unprod26.3%
add-sqr-sqrt81.6%
metadata-eval81.6%
Applied egg-rr81.6%
if 4.9999999999999998e210 < (*.f64 (*.f64 y 4) y) Initial program 15.2%
add-sqr-sqrt15.2%
difference-of-squares15.2%
*-commutative15.2%
associate-*r*15.2%
sqrt-prod15.2%
sqrt-unprod7.5%
add-sqr-sqrt7.7%
metadata-eval7.7%
*-commutative7.7%
associate-*r*7.7%
sqrt-prod7.7%
sqrt-unprod7.5%
add-sqr-sqrt15.2%
metadata-eval15.2%
Applied egg-rr15.2%
add-sqr-sqrt15.2%
times-frac17.8%
+-commutative17.8%
fma-def17.8%
add-sqr-sqrt17.8%
hypot-def17.8%
sqrt-prod9.3%
*-commutative9.3%
sqrt-prod9.3%
metadata-eval9.3%
associate-*r*9.3%
add-sqr-sqrt17.8%
*-commutative17.8%
Applied egg-rr100.0%
Taylor expanded in y around inf 55.6%
Final simplification74.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* y (* y 4.0)))
(t_1 (- x (* y 2.0)))
(t_2 (/ t_1 (hypot x (* y 2.0)))))
(if (<= t_0 2000.0)
(* t_2 (+ 1.0 (/ (* y 2.0) x)))
(if (<= t_0 5e+210)
(/ (* t_1 (+ x (* y 2.0))) (+ t_0 (* x x)))
(* t_2 (+ 1.0 (* 0.5 (/ x y))))))))
double code(double x, double y) {
double t_0 = y * (y * 4.0);
double t_1 = x - (y * 2.0);
double t_2 = t_1 / hypot(x, (y * 2.0));
double tmp;
if (t_0 <= 2000.0) {
tmp = t_2 * (1.0 + ((y * 2.0) / x));
} else if (t_0 <= 5e+210) {
tmp = (t_1 * (x + (y * 2.0))) / (t_0 + (x * x));
} else {
tmp = t_2 * (1.0 + (0.5 * (x / y)));
}
return tmp;
}
public static double code(double x, double y) {
double t_0 = y * (y * 4.0);
double t_1 = x - (y * 2.0);
double t_2 = t_1 / Math.hypot(x, (y * 2.0));
double tmp;
if (t_0 <= 2000.0) {
tmp = t_2 * (1.0 + ((y * 2.0) / x));
} else if (t_0 <= 5e+210) {
tmp = (t_1 * (x + (y * 2.0))) / (t_0 + (x * x));
} else {
tmp = t_2 * (1.0 + (0.5 * (x / y)));
}
return tmp;
}
def code(x, y): t_0 = y * (y * 4.0) t_1 = x - (y * 2.0) t_2 = t_1 / math.hypot(x, (y * 2.0)) tmp = 0 if t_0 <= 2000.0: tmp = t_2 * (1.0 + ((y * 2.0) / x)) elif t_0 <= 5e+210: tmp = (t_1 * (x + (y * 2.0))) / (t_0 + (x * x)) else: tmp = t_2 * (1.0 + (0.5 * (x / y))) return tmp
function code(x, y) t_0 = Float64(y * Float64(y * 4.0)) t_1 = Float64(x - Float64(y * 2.0)) t_2 = Float64(t_1 / hypot(x, Float64(y * 2.0))) tmp = 0.0 if (t_0 <= 2000.0) tmp = Float64(t_2 * Float64(1.0 + Float64(Float64(y * 2.0) / x))); elseif (t_0 <= 5e+210) tmp = Float64(Float64(t_1 * Float64(x + Float64(y * 2.0))) / Float64(t_0 + Float64(x * x))); else tmp = Float64(t_2 * Float64(1.0 + Float64(0.5 * Float64(x / y)))); end return tmp end
function tmp_2 = code(x, y) t_0 = y * (y * 4.0); t_1 = x - (y * 2.0); t_2 = t_1 / hypot(x, (y * 2.0)); tmp = 0.0; if (t_0 <= 2000.0) tmp = t_2 * (1.0 + ((y * 2.0) / x)); elseif (t_0 <= 5e+210) tmp = (t_1 * (x + (y * 2.0))) / (t_0 + (x * x)); else tmp = t_2 * (1.0 + (0.5 * (x / y))); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(y * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x - N[(y * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[Sqrt[x ^ 2 + N[(y * 2.0), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2000.0], N[(t$95$2 * N[(1.0 + N[(N[(y * 2.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+210], N[(N[(t$95$1 * N[(x + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(1.0 + N[(0.5 * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(y \cdot 4\right)\\
t_1 := x - y \cdot 2\\
t_2 := \frac{t_1}{\mathsf{hypot}\left(x, y \cdot 2\right)}\\
\mathbf{if}\;t_0 \leq 2000:\\
\;\;\;\;t_2 \cdot \left(1 + \frac{y \cdot 2}{x}\right)\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+210}:\\
\;\;\;\;\frac{t_1 \cdot \left(x + y \cdot 2\right)}{t_0 + x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \left(1 + 0.5 \cdot \frac{x}{y}\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 4) y) < 2e3Initial program 57.0%
add-sqr-sqrt57.0%
difference-of-squares57.0%
*-commutative57.0%
associate-*r*57.0%
sqrt-prod57.0%
sqrt-unprod25.7%
add-sqr-sqrt50.6%
metadata-eval50.6%
*-commutative50.6%
associate-*r*50.6%
sqrt-prod50.6%
sqrt-unprod25.7%
add-sqr-sqrt57.0%
metadata-eval57.0%
Applied egg-rr57.0%
add-sqr-sqrt57.0%
times-frac58.3%
+-commutative58.3%
fma-def58.3%
add-sqr-sqrt58.3%
hypot-def58.3%
sqrt-prod26.2%
*-commutative26.2%
sqrt-prod26.2%
metadata-eval26.2%
associate-*r*26.2%
add-sqr-sqrt58.3%
*-commutative58.3%
Applied egg-rr99.9%
Taylor expanded in y around 0 48.0%
associate-*r/48.0%
*-commutative48.0%
Simplified48.0%
if 2e3 < (*.f64 (*.f64 y 4) y) < 4.9999999999999998e210Initial program 81.5%
add-sqr-sqrt81.5%
difference-of-squares81.6%
*-commutative81.6%
associate-*r*81.6%
sqrt-prod81.6%
sqrt-unprod26.3%
add-sqr-sqrt35.2%
metadata-eval35.2%
*-commutative35.2%
associate-*r*35.2%
sqrt-prod35.2%
sqrt-unprod26.3%
add-sqr-sqrt81.6%
metadata-eval81.6%
Applied egg-rr81.6%
if 4.9999999999999998e210 < (*.f64 (*.f64 y 4) y) Initial program 15.2%
add-sqr-sqrt15.2%
difference-of-squares15.2%
*-commutative15.2%
associate-*r*15.2%
sqrt-prod15.2%
sqrt-unprod7.5%
add-sqr-sqrt7.7%
metadata-eval7.7%
*-commutative7.7%
associate-*r*7.7%
sqrt-prod7.7%
sqrt-unprod7.5%
add-sqr-sqrt15.2%
metadata-eval15.2%
Applied egg-rr15.2%
add-sqr-sqrt15.2%
times-frac17.8%
+-commutative17.8%
fma-def17.8%
add-sqr-sqrt17.8%
hypot-def17.8%
sqrt-prod9.3%
*-commutative9.3%
sqrt-prod9.3%
metadata-eval9.3%
associate-*r*9.3%
add-sqr-sqrt17.8%
*-commutative17.8%
Applied egg-rr100.0%
Taylor expanded in y around inf 55.6%
Final simplification56.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* y (* y 4.0))) (t_1 (* 0.5 (/ x y))))
(if (<= t_0 2000.0)
(+ 1.0 (/ -6.0 (pow (/ x y) 2.0)))
(if (<= t_0 5e+210)
(/ (* (- x (* y 2.0)) (+ x (* y 2.0))) (+ t_0 (* x x)))
(* (+ t_1 -1.0) (+ 1.0 t_1))))))
double code(double x, double y) {
double t_0 = y * (y * 4.0);
double t_1 = 0.5 * (x / y);
double tmp;
if (t_0 <= 2000.0) {
tmp = 1.0 + (-6.0 / pow((x / y), 2.0));
} else if (t_0 <= 5e+210) {
tmp = ((x - (y * 2.0)) * (x + (y * 2.0))) / (t_0 + (x * x));
} else {
tmp = (t_1 + -1.0) * (1.0 + t_1);
}
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) :: tmp
t_0 = y * (y * 4.0d0)
t_1 = 0.5d0 * (x / y)
if (t_0 <= 2000.0d0) then
tmp = 1.0d0 + ((-6.0d0) / ((x / y) ** 2.0d0))
else if (t_0 <= 5d+210) then
tmp = ((x - (y * 2.0d0)) * (x + (y * 2.0d0))) / (t_0 + (x * x))
else
tmp = (t_1 + (-1.0d0)) * (1.0d0 + t_1)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y * (y * 4.0);
double t_1 = 0.5 * (x / y);
double tmp;
if (t_0 <= 2000.0) {
tmp = 1.0 + (-6.0 / Math.pow((x / y), 2.0));
} else if (t_0 <= 5e+210) {
tmp = ((x - (y * 2.0)) * (x + (y * 2.0))) / (t_0 + (x * x));
} else {
tmp = (t_1 + -1.0) * (1.0 + t_1);
}
return tmp;
}
def code(x, y): t_0 = y * (y * 4.0) t_1 = 0.5 * (x / y) tmp = 0 if t_0 <= 2000.0: tmp = 1.0 + (-6.0 / math.pow((x / y), 2.0)) elif t_0 <= 5e+210: tmp = ((x - (y * 2.0)) * (x + (y * 2.0))) / (t_0 + (x * x)) else: tmp = (t_1 + -1.0) * (1.0 + t_1) return tmp
function code(x, y) t_0 = Float64(y * Float64(y * 4.0)) t_1 = Float64(0.5 * Float64(x / y)) tmp = 0.0 if (t_0 <= 2000.0) tmp = Float64(1.0 + Float64(-6.0 / (Float64(x / y) ^ 2.0))); elseif (t_0 <= 5e+210) tmp = Float64(Float64(Float64(x - Float64(y * 2.0)) * Float64(x + Float64(y * 2.0))) / Float64(t_0 + Float64(x * x))); else tmp = Float64(Float64(t_1 + -1.0) * Float64(1.0 + t_1)); end return tmp end
function tmp_2 = code(x, y) t_0 = y * (y * 4.0); t_1 = 0.5 * (x / y); tmp = 0.0; if (t_0 <= 2000.0) tmp = 1.0 + (-6.0 / ((x / y) ^ 2.0)); elseif (t_0 <= 5e+210) tmp = ((x - (y * 2.0)) * (x + (y * 2.0))) / (t_0 + (x * x)); else tmp = (t_1 + -1.0) * (1.0 + t_1); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(y * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.5 * N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2000.0], N[(1.0 + N[(-6.0 / N[Power[N[(x / y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+210], N[(N[(N[(x - N[(y * 2.0), $MachinePrecision]), $MachinePrecision] * N[(x + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 + -1.0), $MachinePrecision] * N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(y \cdot 4\right)\\
t_1 := 0.5 \cdot \frac{x}{y}\\
\mathbf{if}\;t_0 \leq 2000:\\
\;\;\;\;1 + \frac{-6}{{\left(\frac{x}{y}\right)}^{2}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+210}:\\
\;\;\;\;\frac{\left(x - y \cdot 2\right) \cdot \left(x + y \cdot 2\right)}{t_0 + x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\left(t_1 + -1\right) \cdot \left(1 + t_1\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 4) y) < 2e3Initial program 57.0%
add-sqr-sqrt57.0%
difference-of-squares57.0%
*-commutative57.0%
associate-*r*57.0%
sqrt-prod57.0%
sqrt-unprod25.7%
add-sqr-sqrt50.6%
metadata-eval50.6%
*-commutative50.6%
associate-*r*50.6%
sqrt-prod50.6%
sqrt-unprod25.7%
add-sqr-sqrt57.0%
metadata-eval57.0%
Applied egg-rr57.0%
add-sqr-sqrt57.0%
times-frac58.3%
+-commutative58.3%
fma-def58.3%
add-sqr-sqrt58.3%
hypot-def58.3%
sqrt-prod26.2%
*-commutative26.2%
sqrt-prod26.2%
metadata-eval26.2%
associate-*r*26.2%
add-sqr-sqrt58.3%
*-commutative58.3%
Applied egg-rr99.9%
Taylor expanded in y around 0 48.0%
associate-*r/48.0%
*-commutative48.0%
Simplified48.0%
Taylor expanded in y around 0 77.0%
associate-*r/77.0%
associate-/l*77.0%
unpow277.0%
unpow277.0%
times-frac83.0%
unpow283.0%
Simplified83.0%
if 2e3 < (*.f64 (*.f64 y 4) y) < 4.9999999999999998e210Initial program 81.5%
add-sqr-sqrt81.5%
difference-of-squares81.6%
*-commutative81.6%
associate-*r*81.6%
sqrt-prod81.6%
sqrt-unprod26.3%
add-sqr-sqrt35.2%
metadata-eval35.2%
*-commutative35.2%
associate-*r*35.2%
sqrt-prod35.2%
sqrt-unprod26.3%
add-sqr-sqrt81.6%
metadata-eval81.6%
Applied egg-rr81.6%
if 4.9999999999999998e210 < (*.f64 (*.f64 y 4) y) Initial program 15.2%
add-sqr-sqrt15.2%
difference-of-squares15.2%
*-commutative15.2%
associate-*r*15.2%
sqrt-prod15.2%
sqrt-unprod7.5%
add-sqr-sqrt7.7%
metadata-eval7.7%
*-commutative7.7%
associate-*r*7.7%
sqrt-prod7.7%
sqrt-unprod7.5%
add-sqr-sqrt15.2%
metadata-eval15.2%
Applied egg-rr15.2%
add-sqr-sqrt15.2%
times-frac17.8%
+-commutative17.8%
fma-def17.8%
add-sqr-sqrt17.8%
hypot-def17.8%
sqrt-prod9.3%
*-commutative9.3%
sqrt-prod9.3%
metadata-eval9.3%
associate-*r*9.3%
add-sqr-sqrt17.8%
*-commutative17.8%
Applied egg-rr100.0%
Taylor expanded in y around inf 55.6%
Taylor expanded in x around 0 88.8%
Final simplification84.5%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 0.5 (/ x y))))
(if (<= y 19.0)
(* (+ 1.0 (/ (* y 2.0) x)) (+ 1.0 (/ (* y -2.0) x)))
(if (<= y 5.7e+109)
(/ (* (- x (* y 2.0)) (+ x (* y 2.0))) (+ (* y (* y 4.0)) (* x x)))
(* (+ t_0 -1.0) (+ 1.0 t_0))))))
double code(double x, double y) {
double t_0 = 0.5 * (x / y);
double tmp;
if (y <= 19.0) {
tmp = (1.0 + ((y * 2.0) / x)) * (1.0 + ((y * -2.0) / x));
} else if (y <= 5.7e+109) {
tmp = ((x - (y * 2.0)) * (x + (y * 2.0))) / ((y * (y * 4.0)) + (x * x));
} else {
tmp = (t_0 + -1.0) * (1.0 + 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 = 0.5d0 * (x / y)
if (y <= 19.0d0) then
tmp = (1.0d0 + ((y * 2.0d0) / x)) * (1.0d0 + ((y * (-2.0d0)) / x))
else if (y <= 5.7d+109) then
tmp = ((x - (y * 2.0d0)) * (x + (y * 2.0d0))) / ((y * (y * 4.0d0)) + (x * x))
else
tmp = (t_0 + (-1.0d0)) * (1.0d0 + t_0)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 0.5 * (x / y);
double tmp;
if (y <= 19.0) {
tmp = (1.0 + ((y * 2.0) / x)) * (1.0 + ((y * -2.0) / x));
} else if (y <= 5.7e+109) {
tmp = ((x - (y * 2.0)) * (x + (y * 2.0))) / ((y * (y * 4.0)) + (x * x));
} else {
tmp = (t_0 + -1.0) * (1.0 + t_0);
}
return tmp;
}
def code(x, y): t_0 = 0.5 * (x / y) tmp = 0 if y <= 19.0: tmp = (1.0 + ((y * 2.0) / x)) * (1.0 + ((y * -2.0) / x)) elif y <= 5.7e+109: tmp = ((x - (y * 2.0)) * (x + (y * 2.0))) / ((y * (y * 4.0)) + (x * x)) else: tmp = (t_0 + -1.0) * (1.0 + t_0) return tmp
function code(x, y) t_0 = Float64(0.5 * Float64(x / y)) tmp = 0.0 if (y <= 19.0) tmp = Float64(Float64(1.0 + Float64(Float64(y * 2.0) / x)) * Float64(1.0 + Float64(Float64(y * -2.0) / x))); elseif (y <= 5.7e+109) tmp = Float64(Float64(Float64(x - Float64(y * 2.0)) * Float64(x + Float64(y * 2.0))) / Float64(Float64(y * Float64(y * 4.0)) + Float64(x * x))); else tmp = Float64(Float64(t_0 + -1.0) * Float64(1.0 + t_0)); end return tmp end
function tmp_2 = code(x, y) t_0 = 0.5 * (x / y); tmp = 0.0; if (y <= 19.0) tmp = (1.0 + ((y * 2.0) / x)) * (1.0 + ((y * -2.0) / x)); elseif (y <= 5.7e+109) tmp = ((x - (y * 2.0)) * (x + (y * 2.0))) / ((y * (y * 4.0)) + (x * x)); else tmp = (t_0 + -1.0) * (1.0 + t_0); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(0.5 * N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 19.0], N[(N[(1.0 + N[(N[(y * 2.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(y * -2.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.7e+109], N[(N[(N[(x - N[(y * 2.0), $MachinePrecision]), $MachinePrecision] * N[(x + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(y * N[(y * 4.0), $MachinePrecision]), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 + -1.0), $MachinePrecision] * N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \frac{x}{y}\\
\mathbf{if}\;y \leq 19:\\
\;\;\;\;\left(1 + \frac{y \cdot 2}{x}\right) \cdot \left(1 + \frac{y \cdot -2}{x}\right)\\
\mathbf{elif}\;y \leq 5.7 \cdot 10^{+109}:\\
\;\;\;\;\frac{\left(x - y \cdot 2\right) \cdot \left(x + y \cdot 2\right)}{y \cdot \left(y \cdot 4\right) + x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\left(t_0 + -1\right) \cdot \left(1 + t_0\right)\\
\end{array}
\end{array}
if y < 19Initial program 56.7%
add-sqr-sqrt56.7%
difference-of-squares56.7%
*-commutative56.7%
associate-*r*56.7%
sqrt-prod56.7%
sqrt-unprod17.6%
add-sqr-sqrt36.9%
metadata-eval36.9%
*-commutative36.9%
associate-*r*36.9%
sqrt-prod36.9%
sqrt-unprod17.6%
add-sqr-sqrt56.7%
metadata-eval56.7%
Applied egg-rr56.7%
add-sqr-sqrt56.7%
times-frac58.0%
+-commutative58.0%
fma-def58.0%
add-sqr-sqrt58.0%
hypot-def58.0%
sqrt-prod17.9%
*-commutative17.9%
sqrt-prod17.9%
metadata-eval17.9%
associate-*r*17.9%
add-sqr-sqrt58.0%
*-commutative58.0%
Applied egg-rr99.9%
Taylor expanded in y around 0 35.9%
associate-*r/35.9%
*-commutative35.9%
Simplified35.9%
Taylor expanded in x around inf 62.7%
associate-*r/62.7%
*-commutative62.7%
Simplified62.7%
if 19 < y < 5.7000000000000002e109Initial program 68.4%
add-sqr-sqrt68.4%
difference-of-squares68.4%
*-commutative68.4%
associate-*r*68.4%
sqrt-prod68.4%
sqrt-unprod67.8%
add-sqr-sqrt68.4%
metadata-eval68.4%
*-commutative68.4%
associate-*r*68.4%
sqrt-prod68.4%
sqrt-unprod67.8%
add-sqr-sqrt68.4%
metadata-eval68.4%
Applied egg-rr68.4%
if 5.7000000000000002e109 < y Initial program 12.0%
add-sqr-sqrt12.0%
difference-of-squares12.0%
*-commutative12.0%
associate-*r*12.0%
sqrt-prod12.0%
sqrt-unprod11.9%
add-sqr-sqrt12.0%
metadata-eval12.0%
*-commutative12.0%
associate-*r*12.0%
sqrt-prod12.0%
sqrt-unprod11.9%
add-sqr-sqrt12.0%
metadata-eval12.0%
Applied egg-rr12.0%
add-sqr-sqrt12.0%
times-frac14.8%
+-commutative14.8%
fma-def14.8%
add-sqr-sqrt14.8%
hypot-def14.8%
sqrt-prod14.7%
*-commutative14.7%
sqrt-prod14.7%
metadata-eval14.7%
associate-*r*14.7%
add-sqr-sqrt14.8%
*-commutative14.8%
Applied egg-rr100.0%
Taylor expanded in y around inf 86.9%
Taylor expanded in x around 0 86.7%
Final simplification67.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* y (* y 4.0))) (t_1 (* 0.5 (/ x y))))
(if (<= y 115.0)
(* (+ 1.0 (/ (* y 2.0) x)) (+ 1.0 (/ (* y -2.0) x)))
(if (<= y 5.7e+109)
(/ (- (* x x) t_0) (+ t_0 (* x x)))
(* (+ t_1 -1.0) (+ 1.0 t_1))))))
double code(double x, double y) {
double t_0 = y * (y * 4.0);
double t_1 = 0.5 * (x / y);
double tmp;
if (y <= 115.0) {
tmp = (1.0 + ((y * 2.0) / x)) * (1.0 + ((y * -2.0) / x));
} else if (y <= 5.7e+109) {
tmp = ((x * x) - t_0) / (t_0 + (x * x));
} else {
tmp = (t_1 + -1.0) * (1.0 + t_1);
}
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) :: tmp
t_0 = y * (y * 4.0d0)
t_1 = 0.5d0 * (x / y)
if (y <= 115.0d0) then
tmp = (1.0d0 + ((y * 2.0d0) / x)) * (1.0d0 + ((y * (-2.0d0)) / x))
else if (y <= 5.7d+109) then
tmp = ((x * x) - t_0) / (t_0 + (x * x))
else
tmp = (t_1 + (-1.0d0)) * (1.0d0 + t_1)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y * (y * 4.0);
double t_1 = 0.5 * (x / y);
double tmp;
if (y <= 115.0) {
tmp = (1.0 + ((y * 2.0) / x)) * (1.0 + ((y * -2.0) / x));
} else if (y <= 5.7e+109) {
tmp = ((x * x) - t_0) / (t_0 + (x * x));
} else {
tmp = (t_1 + -1.0) * (1.0 + t_1);
}
return tmp;
}
def code(x, y): t_0 = y * (y * 4.0) t_1 = 0.5 * (x / y) tmp = 0 if y <= 115.0: tmp = (1.0 + ((y * 2.0) / x)) * (1.0 + ((y * -2.0) / x)) elif y <= 5.7e+109: tmp = ((x * x) - t_0) / (t_0 + (x * x)) else: tmp = (t_1 + -1.0) * (1.0 + t_1) return tmp
function code(x, y) t_0 = Float64(y * Float64(y * 4.0)) t_1 = Float64(0.5 * Float64(x / y)) tmp = 0.0 if (y <= 115.0) tmp = Float64(Float64(1.0 + Float64(Float64(y * 2.0) / x)) * Float64(1.0 + Float64(Float64(y * -2.0) / x))); elseif (y <= 5.7e+109) tmp = Float64(Float64(Float64(x * x) - t_0) / Float64(t_0 + Float64(x * x))); else tmp = Float64(Float64(t_1 + -1.0) * Float64(1.0 + t_1)); end return tmp end
function tmp_2 = code(x, y) t_0 = y * (y * 4.0); t_1 = 0.5 * (x / y); tmp = 0.0; if (y <= 115.0) tmp = (1.0 + ((y * 2.0) / x)) * (1.0 + ((y * -2.0) / x)); elseif (y <= 5.7e+109) tmp = ((x * x) - t_0) / (t_0 + (x * x)); else tmp = (t_1 + -1.0) * (1.0 + t_1); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(y * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.5 * N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 115.0], N[(N[(1.0 + N[(N[(y * 2.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(y * -2.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.7e+109], N[(N[(N[(x * x), $MachinePrecision] - t$95$0), $MachinePrecision] / N[(t$95$0 + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 + -1.0), $MachinePrecision] * N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(y \cdot 4\right)\\
t_1 := 0.5 \cdot \frac{x}{y}\\
\mathbf{if}\;y \leq 115:\\
\;\;\;\;\left(1 + \frac{y \cdot 2}{x}\right) \cdot \left(1 + \frac{y \cdot -2}{x}\right)\\
\mathbf{elif}\;y \leq 5.7 \cdot 10^{+109}:\\
\;\;\;\;\frac{x \cdot x - t_0}{t_0 + x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\left(t_1 + -1\right) \cdot \left(1 + t_1\right)\\
\end{array}
\end{array}
if y < 115Initial program 56.7%
add-sqr-sqrt56.7%
difference-of-squares56.7%
*-commutative56.7%
associate-*r*56.7%
sqrt-prod56.7%
sqrt-unprod17.6%
add-sqr-sqrt36.9%
metadata-eval36.9%
*-commutative36.9%
associate-*r*36.9%
sqrt-prod36.9%
sqrt-unprod17.6%
add-sqr-sqrt56.7%
metadata-eval56.7%
Applied egg-rr56.7%
add-sqr-sqrt56.7%
times-frac58.0%
+-commutative58.0%
fma-def58.0%
add-sqr-sqrt58.0%
hypot-def58.0%
sqrt-prod17.9%
*-commutative17.9%
sqrt-prod17.9%
metadata-eval17.9%
associate-*r*17.9%
add-sqr-sqrt58.0%
*-commutative58.0%
Applied egg-rr99.9%
Taylor expanded in y around 0 35.9%
associate-*r/35.9%
*-commutative35.9%
Simplified35.9%
Taylor expanded in x around inf 62.7%
associate-*r/62.7%
*-commutative62.7%
Simplified62.7%
if 115 < y < 5.7000000000000002e109Initial program 68.4%
if 5.7000000000000002e109 < y Initial program 12.0%
add-sqr-sqrt12.0%
difference-of-squares12.0%
*-commutative12.0%
associate-*r*12.0%
sqrt-prod12.0%
sqrt-unprod11.9%
add-sqr-sqrt12.0%
metadata-eval12.0%
*-commutative12.0%
associate-*r*12.0%
sqrt-prod12.0%
sqrt-unprod11.9%
add-sqr-sqrt12.0%
metadata-eval12.0%
Applied egg-rr12.0%
add-sqr-sqrt12.0%
times-frac14.8%
+-commutative14.8%
fma-def14.8%
add-sqr-sqrt14.8%
hypot-def14.8%
sqrt-prod14.7%
*-commutative14.7%
sqrt-prod14.7%
metadata-eval14.7%
associate-*r*14.7%
add-sqr-sqrt14.8%
*-commutative14.8%
Applied egg-rr100.0%
Taylor expanded in y around inf 86.9%
Taylor expanded in x around 0 86.7%
Final simplification67.8%
(FPCore (x y) :precision binary64 (let* ((t_0 (* 0.5 (/ x y)))) (if (<= y 3600.0) 1.0 (* (+ t_0 -1.0) (+ 1.0 t_0)))))
double code(double x, double y) {
double t_0 = 0.5 * (x / y);
double tmp;
if (y <= 3600.0) {
tmp = 1.0;
} else {
tmp = (t_0 + -1.0) * (1.0 + 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 = 0.5d0 * (x / y)
if (y <= 3600.0d0) then
tmp = 1.0d0
else
tmp = (t_0 + (-1.0d0)) * (1.0d0 + t_0)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 0.5 * (x / y);
double tmp;
if (y <= 3600.0) {
tmp = 1.0;
} else {
tmp = (t_0 + -1.0) * (1.0 + t_0);
}
return tmp;
}
def code(x, y): t_0 = 0.5 * (x / y) tmp = 0 if y <= 3600.0: tmp = 1.0 else: tmp = (t_0 + -1.0) * (1.0 + t_0) return tmp
function code(x, y) t_0 = Float64(0.5 * Float64(x / y)) tmp = 0.0 if (y <= 3600.0) tmp = 1.0; else tmp = Float64(Float64(t_0 + -1.0) * Float64(1.0 + t_0)); end return tmp end
function tmp_2 = code(x, y) t_0 = 0.5 * (x / y); tmp = 0.0; if (y <= 3600.0) tmp = 1.0; else tmp = (t_0 + -1.0) * (1.0 + t_0); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(0.5 * N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 3600.0], 1.0, N[(N[(t$95$0 + -1.0), $MachinePrecision] * N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \frac{x}{y}\\
\mathbf{if}\;y \leq 3600:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\left(t_0 + -1\right) \cdot \left(1 + t_0\right)\\
\end{array}
\end{array}
if y < 3600Initial program 56.7%
Taylor expanded in x around inf 61.5%
if 3600 < y Initial program 27.5%
add-sqr-sqrt27.5%
difference-of-squares27.5%
*-commutative27.5%
associate-*r*27.5%
sqrt-prod27.5%
sqrt-unprod27.3%
add-sqr-sqrt27.5%
metadata-eval27.5%
*-commutative27.5%
associate-*r*27.5%
sqrt-prod27.5%
sqrt-unprod27.3%
add-sqr-sqrt27.5%
metadata-eval27.5%
Applied egg-rr27.5%
add-sqr-sqrt27.5%
times-frac29.8%
+-commutative29.8%
fma-def29.8%
add-sqr-sqrt29.8%
hypot-def29.8%
sqrt-prod29.5%
*-commutative29.5%
sqrt-prod29.5%
metadata-eval29.5%
associate-*r*29.5%
add-sqr-sqrt29.8%
*-commutative29.8%
Applied egg-rr100.0%
Taylor expanded in y around inf 80.9%
Taylor expanded in x around 0 80.6%
Final simplification66.7%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 0.5 (/ x y))))
(if (<= y 27000.0)
(* (+ 1.0 (/ (* y 2.0) x)) (+ 1.0 (/ (* y -2.0) x)))
(* (+ t_0 -1.0) (+ 1.0 t_0)))))
double code(double x, double y) {
double t_0 = 0.5 * (x / y);
double tmp;
if (y <= 27000.0) {
tmp = (1.0 + ((y * 2.0) / x)) * (1.0 + ((y * -2.0) / x));
} else {
tmp = (t_0 + -1.0) * (1.0 + 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 = 0.5d0 * (x / y)
if (y <= 27000.0d0) then
tmp = (1.0d0 + ((y * 2.0d0) / x)) * (1.0d0 + ((y * (-2.0d0)) / x))
else
tmp = (t_0 + (-1.0d0)) * (1.0d0 + t_0)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 0.5 * (x / y);
double tmp;
if (y <= 27000.0) {
tmp = (1.0 + ((y * 2.0) / x)) * (1.0 + ((y * -2.0) / x));
} else {
tmp = (t_0 + -1.0) * (1.0 + t_0);
}
return tmp;
}
def code(x, y): t_0 = 0.5 * (x / y) tmp = 0 if y <= 27000.0: tmp = (1.0 + ((y * 2.0) / x)) * (1.0 + ((y * -2.0) / x)) else: tmp = (t_0 + -1.0) * (1.0 + t_0) return tmp
function code(x, y) t_0 = Float64(0.5 * Float64(x / y)) tmp = 0.0 if (y <= 27000.0) tmp = Float64(Float64(1.0 + Float64(Float64(y * 2.0) / x)) * Float64(1.0 + Float64(Float64(y * -2.0) / x))); else tmp = Float64(Float64(t_0 + -1.0) * Float64(1.0 + t_0)); end return tmp end
function tmp_2 = code(x, y) t_0 = 0.5 * (x / y); tmp = 0.0; if (y <= 27000.0) tmp = (1.0 + ((y * 2.0) / x)) * (1.0 + ((y * -2.0) / x)); else tmp = (t_0 + -1.0) * (1.0 + t_0); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(0.5 * N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 27000.0], N[(N[(1.0 + N[(N[(y * 2.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(y * -2.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 + -1.0), $MachinePrecision] * N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \frac{x}{y}\\
\mathbf{if}\;y \leq 27000:\\
\;\;\;\;\left(1 + \frac{y \cdot 2}{x}\right) \cdot \left(1 + \frac{y \cdot -2}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_0 + -1\right) \cdot \left(1 + t_0\right)\\
\end{array}
\end{array}
if y < 27000Initial program 56.7%
add-sqr-sqrt56.7%
difference-of-squares56.7%
*-commutative56.7%
associate-*r*56.7%
sqrt-prod56.7%
sqrt-unprod17.6%
add-sqr-sqrt36.9%
metadata-eval36.9%
*-commutative36.9%
associate-*r*36.9%
sqrt-prod36.9%
sqrt-unprod17.6%
add-sqr-sqrt56.7%
metadata-eval56.7%
Applied egg-rr56.7%
add-sqr-sqrt56.7%
times-frac58.0%
+-commutative58.0%
fma-def58.0%
add-sqr-sqrt58.0%
hypot-def58.0%
sqrt-prod17.9%
*-commutative17.9%
sqrt-prod17.9%
metadata-eval17.9%
associate-*r*17.9%
add-sqr-sqrt58.0%
*-commutative58.0%
Applied egg-rr99.9%
Taylor expanded in y around 0 35.9%
associate-*r/35.9%
*-commutative35.9%
Simplified35.9%
Taylor expanded in x around inf 62.7%
associate-*r/62.7%
*-commutative62.7%
Simplified62.7%
if 27000 < y Initial program 27.5%
add-sqr-sqrt27.5%
difference-of-squares27.5%
*-commutative27.5%
associate-*r*27.5%
sqrt-prod27.5%
sqrt-unprod27.3%
add-sqr-sqrt27.5%
metadata-eval27.5%
*-commutative27.5%
associate-*r*27.5%
sqrt-prod27.5%
sqrt-unprod27.3%
add-sqr-sqrt27.5%
metadata-eval27.5%
Applied egg-rr27.5%
add-sqr-sqrt27.5%
times-frac29.8%
+-commutative29.8%
fma-def29.8%
add-sqr-sqrt29.8%
hypot-def29.8%
sqrt-prod29.5%
*-commutative29.5%
sqrt-prod29.5%
metadata-eval29.5%
associate-*r*29.5%
add-sqr-sqrt29.8%
*-commutative29.8%
Applied egg-rr100.0%
Taylor expanded in y around inf 80.9%
Taylor expanded in x around 0 80.6%
Final simplification67.5%
(FPCore (x y) :precision binary64 (if (<= y 21000.0) 1.0 -1.0))
double code(double x, double y) {
double tmp;
if (y <= 21000.0) {
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 <= 21000.0d0) 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 <= 21000.0) {
tmp = 1.0;
} else {
tmp = -1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 21000.0: tmp = 1.0 else: tmp = -1.0 return tmp
function code(x, y) tmp = 0.0 if (y <= 21000.0) tmp = 1.0; else tmp = -1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 21000.0) tmp = 1.0; else tmp = -1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 21000.0], 1.0, -1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 21000:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\end{array}
if y < 21000Initial program 56.7%
Taylor expanded in x around inf 61.5%
if 21000 < y Initial program 27.5%
Taylor expanded in x around 0 80.0%
Final simplification66.5%
(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 48.8%
Taylor expanded in x around 0 49.5%
Final simplification49.5%
(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 2024018
(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))))