
(FPCore (x y z) :precision binary64 (/ (* (cosh x) (/ y x)) z))
double code(double x, double y, double z) {
return (cosh(x) * (y / x)) / z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (cosh(x) * (y / x)) / z
end function
public static double code(double x, double y, double z) {
return (Math.cosh(x) * (y / x)) / z;
}
def code(x, y, z): return (math.cosh(x) * (y / x)) / z
function code(x, y, z) return Float64(Float64(cosh(x) * Float64(y / x)) / z) end
function tmp = code(x, y, z) tmp = (cosh(x) * (y / x)) / z; end
code[x_, y_, z_] := N[(N[(N[Cosh[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{\cosh x \cdot \frac{y}{x}}{z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (* (cosh x) (/ y x)) z))
double code(double x, double y, double z) {
return (cosh(x) * (y / x)) / z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (cosh(x) * (y / x)) / z
end function
public static double code(double x, double y, double z) {
return (Math.cosh(x) * (y / x)) / z;
}
def code(x, y, z): return (math.cosh(x) * (y / x)) / z
function code(x, y, z) return Float64(Float64(cosh(x) * Float64(y / x)) / z) end
function tmp = code(x, y, z) tmp = (cosh(x) * (y / x)) / z; end
code[x_, y_, z_] := N[(N[(N[Cosh[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{\cosh x \cdot \frac{y}{x}}{z}
\end{array}
y\_m = (fabs.f64 y) y\_s = (copysign.f64 #s(literal 1 binary64) y) (FPCore (y_s x y_m z) :precision binary64 (let* ((t_0 (/ (cosh x) x))) (* y_s (if (<= y_m 2.15e-24) (/ (* y_m t_0) z) (* t_0 (/ y_m z))))))
y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double t_0 = cosh(x) / x;
double tmp;
if (y_m <= 2.15e-24) {
tmp = (y_m * t_0) / z;
} else {
tmp = t_0 * (y_m / z);
}
return y_s * tmp;
}
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
real(8) function code(y_s, x, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = cosh(x) / x
if (y_m <= 2.15d-24) then
tmp = (y_m * t_0) / z
else
tmp = t_0 * (y_m / z)
end if
code = y_s * tmp
end function
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
double t_0 = Math.cosh(x) / x;
double tmp;
if (y_m <= 2.15e-24) {
tmp = (y_m * t_0) / z;
} else {
tmp = t_0 * (y_m / z);
}
return y_s * tmp;
}
y\_m = math.fabs(y) y\_s = math.copysign(1.0, y) def code(y_s, x, y_m, z): t_0 = math.cosh(x) / x tmp = 0 if y_m <= 2.15e-24: tmp = (y_m * t_0) / z else: tmp = t_0 * (y_m / z) return y_s * tmp
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) t_0 = Float64(cosh(x) / x) tmp = 0.0 if (y_m <= 2.15e-24) tmp = Float64(Float64(y_m * t_0) / z); else tmp = Float64(t_0 * Float64(y_m / z)); end return Float64(y_s * tmp) end
y\_m = abs(y); y\_s = sign(y) * abs(1.0); function tmp_2 = code(y_s, x, y_m, z) t_0 = cosh(x) / x; tmp = 0.0; if (y_m <= 2.15e-24) tmp = (y_m * t_0) / z; else tmp = t_0 * (y_m / z); end tmp_2 = y_s * tmp; end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := Block[{t$95$0 = N[(N[Cosh[x], $MachinePrecision] / x), $MachinePrecision]}, N[(y$95$s * If[LessEqual[y$95$m, 2.15e-24], N[(N[(y$95$m * t$95$0), $MachinePrecision] / z), $MachinePrecision], N[(t$95$0 * N[(y$95$m / z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
\begin{array}{l}
t_0 := \frac{\cosh x}{x}\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;y\_m \leq 2.15 \cdot 10^{-24}:\\
\;\;\;\;\frac{y\_m \cdot t\_0}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \frac{y\_m}{z}\\
\end{array}
\end{array}
\end{array}
if y < 2.1500000000000002e-24Initial program 78.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
div-invN/A
lower-/.f6496.8
Applied rewrites96.8%
if 2.1500000000000002e-24 < y Initial program 92.2%
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
associate-/l/N/A
*-commutativeN/A
times-fracN/A
div-invN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
div-invN/A
lower-/.f6499.9
Applied rewrites99.9%
Final simplification97.7%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= x 2.4e-217)
(/ (/ y_m z) x)
(if (<= x 7e+51)
(/ (* y_m (cosh x)) (* x z))
(/
(*
y_m
(/
(fma
(* x x)
(fma
x
(* x (fma (* x x) 0.001388888888888889 0.041666666666666664))
0.5)
1.0)
x))
z)))))y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 2.4e-217) {
tmp = (y_m / z) / x;
} else if (x <= 7e+51) {
tmp = (y_m * cosh(x)) / (x * z);
} else {
tmp = (y_m * (fma((x * x), fma(x, (x * fma((x * x), 0.001388888888888889, 0.041666666666666664)), 0.5), 1.0) / x)) / z;
}
return y_s * tmp;
}
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (x <= 2.4e-217) tmp = Float64(Float64(y_m / z) / x); elseif (x <= 7e+51) tmp = Float64(Float64(y_m * cosh(x)) / Float64(x * z)); else tmp = Float64(Float64(y_m * Float64(fma(Float64(x * x), fma(x, Float64(x * fma(Float64(x * x), 0.001388888888888889, 0.041666666666666664)), 0.5), 1.0) / x)) / z); end return Float64(y_s * tmp) end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[x, 2.4e-217], N[(N[(y$95$m / z), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 7e+51], N[(N[(y$95$m * N[Cosh[x], $MachinePrecision]), $MachinePrecision] / N[(x * z), $MachinePrecision]), $MachinePrecision], N[(N[(y$95$m * N[(N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * N[(N[(x * x), $MachinePrecision] * 0.001388888888888889 + 0.041666666666666664), $MachinePrecision]), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 2.4 \cdot 10^{-217}:\\
\;\;\;\;\frac{\frac{y\_m}{z}}{x}\\
\mathbf{elif}\;x \leq 7 \cdot 10^{+51}:\\
\;\;\;\;\frac{y\_m \cdot \cosh x}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y\_m \cdot \frac{\mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x, x \cdot \mathsf{fma}\left(x \cdot x, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)}{x}}{z}\\
\end{array}
\end{array}
if x < 2.3999999999999999e-217Initial program 84.6%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6457.3
Applied rewrites57.3%
Applied rewrites59.5%
if 2.3999999999999999e-217 < x < 7e51Initial program 95.2%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
div-invN/A
lower-/.f6495.2
Applied rewrites95.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
frac-timesN/A
lift-*.f64N/A
lower-/.f64N/A
lower-*.f6491.6
Applied rewrites91.6%
if 7e51 < x Initial program 65.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
div-invN/A
lower-/.f64100.0
Applied rewrites100.0%
Taylor expanded in x around 0
Applied rewrites5.4%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6495.3
Applied rewrites95.3%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64100.0
Applied rewrites100.0%
Final simplification76.9%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= y_m 4.5e-25)
(/
(*
y_m
(/
(fma
(* x x)
(fma
x
(* x (fma (* x x) 0.001388888888888889 0.041666666666666664))
0.5)
1.0)
x))
z)
(* (/ (cosh x) x) (/ y_m z)))))y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (y_m <= 4.5e-25) {
tmp = (y_m * (fma((x * x), fma(x, (x * fma((x * x), 0.001388888888888889, 0.041666666666666664)), 0.5), 1.0) / x)) / z;
} else {
tmp = (cosh(x) / x) * (y_m / z);
}
return y_s * tmp;
}
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (y_m <= 4.5e-25) tmp = Float64(Float64(y_m * Float64(fma(Float64(x * x), fma(x, Float64(x * fma(Float64(x * x), 0.001388888888888889, 0.041666666666666664)), 0.5), 1.0) / x)) / z); else tmp = Float64(Float64(cosh(x) / x) * Float64(y_m / z)); end return Float64(y_s * tmp) end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[y$95$m, 4.5e-25], N[(N[(y$95$m * N[(N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * N[(N[(x * x), $MachinePrecision] * 0.001388888888888889 + 0.041666666666666664), $MachinePrecision]), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(N[Cosh[x], $MachinePrecision] / x), $MachinePrecision] * N[(y$95$m / z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;y\_m \leq 4.5 \cdot 10^{-25}:\\
\;\;\;\;\frac{y\_m \cdot \frac{\mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x, x \cdot \mathsf{fma}\left(x \cdot x, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cosh x}{x} \cdot \frac{y\_m}{z}\\
\end{array}
\end{array}
if y < 4.5000000000000001e-25Initial program 78.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
div-invN/A
lower-/.f6496.8
Applied rewrites96.8%
Taylor expanded in x around 0
Applied rewrites53.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6488.5
Applied rewrites88.5%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6491.8
Applied rewrites91.8%
if 4.5000000000000001e-25 < y Initial program 92.2%
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
associate-/l/N/A
*-commutativeN/A
times-fracN/A
div-invN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
div-invN/A
lower-/.f6499.9
Applied rewrites99.9%
Final simplification94.1%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= y_m 3.4e-13)
(/
(*
y_m
(/
(fma
(* x x)
(fma
x
(* x (fma (* x x) 0.001388888888888889 0.041666666666666664))
0.5)
1.0)
x))
z)
(/
(/ (fma (* y_m x) (* x (fma x (* x 0.041666666666666664) 0.5)) y_m) z)
x))))y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (y_m <= 3.4e-13) {
tmp = (y_m * (fma((x * x), fma(x, (x * fma((x * x), 0.001388888888888889, 0.041666666666666664)), 0.5), 1.0) / x)) / z;
} else {
tmp = (fma((y_m * x), (x * fma(x, (x * 0.041666666666666664), 0.5)), y_m) / z) / x;
}
return y_s * tmp;
}
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (y_m <= 3.4e-13) tmp = Float64(Float64(y_m * Float64(fma(Float64(x * x), fma(x, Float64(x * fma(Float64(x * x), 0.001388888888888889, 0.041666666666666664)), 0.5), 1.0) / x)) / z); else tmp = Float64(Float64(fma(Float64(y_m * x), Float64(x * fma(x, Float64(x * 0.041666666666666664), 0.5)), y_m) / z) / x); end return Float64(y_s * tmp) end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[y$95$m, 3.4e-13], N[(N[(y$95$m * N[(N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * N[(N[(x * x), $MachinePrecision] * 0.001388888888888889 + 0.041666666666666664), $MachinePrecision]), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(N[(N[(y$95$m * x), $MachinePrecision] * N[(x * N[(x * N[(x * 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision] + y$95$m), $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;y\_m \leq 3.4 \cdot 10^{-13}:\\
\;\;\;\;\frac{y\_m \cdot \frac{\mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x, x \cdot \mathsf{fma}\left(x \cdot x, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(y\_m \cdot x, x \cdot \mathsf{fma}\left(x, x \cdot 0.041666666666666664, 0.5\right), y\_m\right)}{z}}{x}\\
\end{array}
\end{array}
if y < 3.40000000000000015e-13Initial program 79.0%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
div-invN/A
lower-/.f6496.8
Applied rewrites96.8%
Taylor expanded in x around 0
Applied rewrites53.4%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6488.1
Applied rewrites88.1%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6491.4
Applied rewrites91.4%
if 3.40000000000000015e-13 < y Initial program 92.0%
Taylor expanded in x around 0
Applied rewrites84.4%
Applied rewrites95.5%
Final simplification92.5%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= y_m 5e-9)
(/
(/
(fma
(* y_m x)
(*
x
(fma
x
(* x (fma x (* x 0.001388888888888889) 0.041666666666666664))
0.5))
y_m)
x)
z)
(/
(/ (fma (* y_m x) (* x (fma x (* x 0.041666666666666664) 0.5)) y_m) z)
x))))y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (y_m <= 5e-9) {
tmp = (fma((y_m * x), (x * fma(x, (x * fma(x, (x * 0.001388888888888889), 0.041666666666666664)), 0.5)), y_m) / x) / z;
} else {
tmp = (fma((y_m * x), (x * fma(x, (x * 0.041666666666666664), 0.5)), y_m) / z) / x;
}
return y_s * tmp;
}
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (y_m <= 5e-9) tmp = Float64(Float64(fma(Float64(y_m * x), Float64(x * fma(x, Float64(x * fma(x, Float64(x * 0.001388888888888889), 0.041666666666666664)), 0.5)), y_m) / x) / z); else tmp = Float64(Float64(fma(Float64(y_m * x), Float64(x * fma(x, Float64(x * 0.041666666666666664), 0.5)), y_m) / z) / x); end return Float64(y_s * tmp) end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[y$95$m, 5e-9], N[(N[(N[(N[(y$95$m * x), $MachinePrecision] * N[(x * N[(x * N[(x * N[(x * N[(x * 0.001388888888888889), $MachinePrecision] + 0.041666666666666664), $MachinePrecision]), $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision] + y$95$m), $MachinePrecision] / x), $MachinePrecision] / z), $MachinePrecision], N[(N[(N[(N[(y$95$m * x), $MachinePrecision] * N[(x * N[(x * N[(x * 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision] + y$95$m), $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;y\_m \leq 5 \cdot 10^{-9}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(y\_m \cdot x, x \cdot \mathsf{fma}\left(x, x \cdot \mathsf{fma}\left(x, x \cdot 0.001388888888888889, 0.041666666666666664\right), 0.5\right), y\_m\right)}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(y\_m \cdot x, x \cdot \mathsf{fma}\left(x, x \cdot 0.041666666666666664, 0.5\right), y\_m\right)}{z}}{x}\\
\end{array}
\end{array}
if y < 5.0000000000000001e-9Initial program 79.1%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
div-invN/A
lower-/.f6496.8
Applied rewrites96.8%
Taylor expanded in x around 0
lower-/.f64N/A
Applied rewrites89.4%
Applied rewrites90.4%
if 5.0000000000000001e-9 < y Initial program 91.9%
Taylor expanded in x around 0
Applied rewrites84.2%
Applied rewrites95.5%
Final simplification91.8%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= y_m 5e-9)
(/
(/
(fma
(* x x)
(*
y_m
(fma
x
(* x (fma x (* x 0.001388888888888889) 0.041666666666666664))
0.5))
y_m)
x)
z)
(/
(/ (fma (* y_m x) (* x (fma x (* x 0.041666666666666664) 0.5)) y_m) z)
x))))y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (y_m <= 5e-9) {
tmp = (fma((x * x), (y_m * fma(x, (x * fma(x, (x * 0.001388888888888889), 0.041666666666666664)), 0.5)), y_m) / x) / z;
} else {
tmp = (fma((y_m * x), (x * fma(x, (x * 0.041666666666666664), 0.5)), y_m) / z) / x;
}
return y_s * tmp;
}
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (y_m <= 5e-9) tmp = Float64(Float64(fma(Float64(x * x), Float64(y_m * fma(x, Float64(x * fma(x, Float64(x * 0.001388888888888889), 0.041666666666666664)), 0.5)), y_m) / x) / z); else tmp = Float64(Float64(fma(Float64(y_m * x), Float64(x * fma(x, Float64(x * 0.041666666666666664), 0.5)), y_m) / z) / x); end return Float64(y_s * tmp) end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[y$95$m, 5e-9], N[(N[(N[(N[(x * x), $MachinePrecision] * N[(y$95$m * N[(x * N[(x * N[(x * N[(x * 0.001388888888888889), $MachinePrecision] + 0.041666666666666664), $MachinePrecision]), $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision] + y$95$m), $MachinePrecision] / x), $MachinePrecision] / z), $MachinePrecision], N[(N[(N[(N[(y$95$m * x), $MachinePrecision] * N[(x * N[(x * N[(x * 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision] + y$95$m), $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;y\_m \leq 5 \cdot 10^{-9}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x \cdot x, y\_m \cdot \mathsf{fma}\left(x, x \cdot \mathsf{fma}\left(x, x \cdot 0.001388888888888889, 0.041666666666666664\right), 0.5\right), y\_m\right)}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(y\_m \cdot x, x \cdot \mathsf{fma}\left(x, x \cdot 0.041666666666666664, 0.5\right), y\_m\right)}{z}}{x}\\
\end{array}
\end{array}
if y < 5.0000000000000001e-9Initial program 79.1%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
div-invN/A
lower-/.f6496.8
Applied rewrites96.8%
Taylor expanded in x around 0
lower-/.f64N/A
Applied rewrites89.4%
if 5.0000000000000001e-9 < y Initial program 91.9%
Taylor expanded in x around 0
Applied rewrites84.2%
Applied rewrites95.5%
Final simplification91.1%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= y_m 5e-9)
(/
(/
(fma (* x x) (* y_m (* x (* x (* (* x x) 0.001388888888888889)))) y_m)
x)
z)
(/
(/ (fma (* y_m x) (* x (fma x (* x 0.041666666666666664) 0.5)) y_m) z)
x))))y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (y_m <= 5e-9) {
tmp = (fma((x * x), (y_m * (x * (x * ((x * x) * 0.001388888888888889)))), y_m) / x) / z;
} else {
tmp = (fma((y_m * x), (x * fma(x, (x * 0.041666666666666664), 0.5)), y_m) / z) / x;
}
return y_s * tmp;
}
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (y_m <= 5e-9) tmp = Float64(Float64(fma(Float64(x * x), Float64(y_m * Float64(x * Float64(x * Float64(Float64(x * x) * 0.001388888888888889)))), y_m) / x) / z); else tmp = Float64(Float64(fma(Float64(y_m * x), Float64(x * fma(x, Float64(x * 0.041666666666666664), 0.5)), y_m) / z) / x); end return Float64(y_s * tmp) end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[y$95$m, 5e-9], N[(N[(N[(N[(x * x), $MachinePrecision] * N[(y$95$m * N[(x * N[(x * N[(N[(x * x), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + y$95$m), $MachinePrecision] / x), $MachinePrecision] / z), $MachinePrecision], N[(N[(N[(N[(y$95$m * x), $MachinePrecision] * N[(x * N[(x * N[(x * 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision] + y$95$m), $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;y\_m \leq 5 \cdot 10^{-9}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x \cdot x, y\_m \cdot \left(x \cdot \left(x \cdot \left(\left(x \cdot x\right) \cdot 0.001388888888888889\right)\right)\right), y\_m\right)}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(y\_m \cdot x, x \cdot \mathsf{fma}\left(x, x \cdot 0.041666666666666664, 0.5\right), y\_m\right)}{z}}{x}\\
\end{array}
\end{array}
if y < 5.0000000000000001e-9Initial program 79.1%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
div-invN/A
lower-/.f6496.8
Applied rewrites96.8%
Taylor expanded in x around 0
lower-/.f64N/A
Applied rewrites89.4%
Taylor expanded in x around inf
Applied rewrites89.0%
if 5.0000000000000001e-9 < y Initial program 91.9%
Taylor expanded in x around 0
Applied rewrites84.2%
Applied rewrites95.5%
Final simplification90.8%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= x 2.4e-217)
(/ (/ y_m z) x)
(if (<= x 2.25e-121)
(/ y_m (* x z))
(/
(/ (fma x (* x (* x (* y_m (* x 0.041666666666666664)))) y_m) x)
z)))))y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 2.4e-217) {
tmp = (y_m / z) / x;
} else if (x <= 2.25e-121) {
tmp = y_m / (x * z);
} else {
tmp = (fma(x, (x * (x * (y_m * (x * 0.041666666666666664)))), y_m) / x) / z;
}
return y_s * tmp;
}
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (x <= 2.4e-217) tmp = Float64(Float64(y_m / z) / x); elseif (x <= 2.25e-121) tmp = Float64(y_m / Float64(x * z)); else tmp = Float64(Float64(fma(x, Float64(x * Float64(x * Float64(y_m * Float64(x * 0.041666666666666664)))), y_m) / x) / z); end return Float64(y_s * tmp) end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[x, 2.4e-217], N[(N[(y$95$m / z), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 2.25e-121], N[(y$95$m / N[(x * z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * N[(x * N[(x * N[(y$95$m * N[(x * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + y$95$m), $MachinePrecision] / x), $MachinePrecision] / z), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 2.4 \cdot 10^{-217}:\\
\;\;\;\;\frac{\frac{y\_m}{z}}{x}\\
\mathbf{elif}\;x \leq 2.25 \cdot 10^{-121}:\\
\;\;\;\;\frac{y\_m}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x, x \cdot \left(x \cdot \left(y\_m \cdot \left(x \cdot 0.041666666666666664\right)\right)\right), y\_m\right)}{x}}{z}\\
\end{array}
\end{array}
if x < 2.3999999999999999e-217Initial program 84.6%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6457.3
Applied rewrites57.3%
Applied rewrites59.5%
if 2.3999999999999999e-217 < x < 2.2500000000000002e-121Initial program 89.4%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6496.4
Applied rewrites96.4%
if 2.2500000000000002e-121 < x Initial program 78.0%
Taylor expanded in x around 0
lower-/.f64N/A
Applied rewrites90.1%
Taylor expanded in x around inf
Applied rewrites89.4%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= x 2.4e-217)
(/ (/ y_m z) x)
(if (<= x 2.8e+94)
(/
(* y_m (fma x (* x (fma x (* x 0.041666666666666664) 0.5)) 1.0))
(* x z))
(/ (* y_m (* x (* (* x x) 0.041666666666666664))) z)))))y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 2.4e-217) {
tmp = (y_m / z) / x;
} else if (x <= 2.8e+94) {
tmp = (y_m * fma(x, (x * fma(x, (x * 0.041666666666666664), 0.5)), 1.0)) / (x * z);
} else {
tmp = (y_m * (x * ((x * x) * 0.041666666666666664))) / z;
}
return y_s * tmp;
}
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (x <= 2.4e-217) tmp = Float64(Float64(y_m / z) / x); elseif (x <= 2.8e+94) tmp = Float64(Float64(y_m * fma(x, Float64(x * fma(x, Float64(x * 0.041666666666666664), 0.5)), 1.0)) / Float64(x * z)); else tmp = Float64(Float64(y_m * Float64(x * Float64(Float64(x * x) * 0.041666666666666664))) / z); end return Float64(y_s * tmp) end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[x, 2.4e-217], N[(N[(y$95$m / z), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 2.8e+94], N[(N[(y$95$m * N[(x * N[(x * N[(x * N[(x * 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x * z), $MachinePrecision]), $MachinePrecision], N[(N[(y$95$m * N[(x * N[(N[(x * x), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 2.4 \cdot 10^{-217}:\\
\;\;\;\;\frac{\frac{y\_m}{z}}{x}\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{+94}:\\
\;\;\;\;\frac{y\_m \cdot \mathsf{fma}\left(x, x \cdot \mathsf{fma}\left(x, x \cdot 0.041666666666666664, 0.5\right), 1\right)}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y\_m \cdot \left(x \cdot \left(\left(x \cdot x\right) \cdot 0.041666666666666664\right)\right)}{z}\\
\end{array}
\end{array}
if x < 2.3999999999999999e-217Initial program 84.6%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6457.3
Applied rewrites57.3%
Applied rewrites59.5%
if 2.3999999999999999e-217 < x < 2.79999999999999998e94Initial program 95.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
div-invN/A
lower-/.f6495.6
Applied rewrites95.6%
Taylor expanded in x around 0
Applied rewrites74.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6480.4
Applied rewrites80.4%
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l/N/A
lower-/.f64N/A
Applied rewrites81.4%
if 2.79999999999999998e94 < x Initial program 61.8%
Taylor expanded in x around 0
Applied rewrites58.2%
Taylor expanded in x around inf
Applied rewrites98.2%
Final simplification73.7%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= x 2.4e-217)
(/ (/ y_m z) x)
(if (<= x 2.8e+94)
(/
(fma (* (* x x) (fma x (* x 0.041666666666666664) 0.5)) y_m y_m)
(* x z))
(/ (* y_m (* x (* (* x x) 0.041666666666666664))) z)))))y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 2.4e-217) {
tmp = (y_m / z) / x;
} else if (x <= 2.8e+94) {
tmp = fma(((x * x) * fma(x, (x * 0.041666666666666664), 0.5)), y_m, y_m) / (x * z);
} else {
tmp = (y_m * (x * ((x * x) * 0.041666666666666664))) / z;
}
return y_s * tmp;
}
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (x <= 2.4e-217) tmp = Float64(Float64(y_m / z) / x); elseif (x <= 2.8e+94) tmp = Float64(fma(Float64(Float64(x * x) * fma(x, Float64(x * 0.041666666666666664), 0.5)), y_m, y_m) / Float64(x * z)); else tmp = Float64(Float64(y_m * Float64(x * Float64(Float64(x * x) * 0.041666666666666664))) / z); end return Float64(y_s * tmp) end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[x, 2.4e-217], N[(N[(y$95$m / z), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 2.8e+94], N[(N[(N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision] * y$95$m + y$95$m), $MachinePrecision] / N[(x * z), $MachinePrecision]), $MachinePrecision], N[(N[(y$95$m * N[(x * N[(N[(x * x), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 2.4 \cdot 10^{-217}:\\
\;\;\;\;\frac{\frac{y\_m}{z}}{x}\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{+94}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(x, x \cdot 0.041666666666666664, 0.5\right), y\_m, y\_m\right)}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y\_m \cdot \left(x \cdot \left(\left(x \cdot x\right) \cdot 0.041666666666666664\right)\right)}{z}\\
\end{array}
\end{array}
if x < 2.3999999999999999e-217Initial program 84.6%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6457.3
Applied rewrites57.3%
Applied rewrites59.5%
if 2.3999999999999999e-217 < x < 2.79999999999999998e94Initial program 95.6%
Taylor expanded in x around 0
Applied rewrites81.4%
Applied rewrites81.4%
if 2.79999999999999998e94 < x Initial program 61.8%
Taylor expanded in x around 0
Applied rewrites58.2%
Taylor expanded in x around inf
Applied rewrites98.2%
Final simplification73.7%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= x 2.4e-217)
(/ (/ y_m z) x)
(if (<= x 8.2e+92)
(/
(fma (* y_m (* x x)) (fma (* x x) 0.041666666666666664 0.5) y_m)
(* x z))
(/ (* y_m (* x (* (* x x) 0.041666666666666664))) z)))))y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 2.4e-217) {
tmp = (y_m / z) / x;
} else if (x <= 8.2e+92) {
tmp = fma((y_m * (x * x)), fma((x * x), 0.041666666666666664, 0.5), y_m) / (x * z);
} else {
tmp = (y_m * (x * ((x * x) * 0.041666666666666664))) / z;
}
return y_s * tmp;
}
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (x <= 2.4e-217) tmp = Float64(Float64(y_m / z) / x); elseif (x <= 8.2e+92) tmp = Float64(fma(Float64(y_m * Float64(x * x)), fma(Float64(x * x), 0.041666666666666664, 0.5), y_m) / Float64(x * z)); else tmp = Float64(Float64(y_m * Float64(x * Float64(Float64(x * x) * 0.041666666666666664))) / z); end return Float64(y_s * tmp) end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[x, 2.4e-217], N[(N[(y$95$m / z), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 8.2e+92], N[(N[(N[(y$95$m * N[(x * x), $MachinePrecision]), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * 0.041666666666666664 + 0.5), $MachinePrecision] + y$95$m), $MachinePrecision] / N[(x * z), $MachinePrecision]), $MachinePrecision], N[(N[(y$95$m * N[(x * N[(N[(x * x), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 2.4 \cdot 10^{-217}:\\
\;\;\;\;\frac{\frac{y\_m}{z}}{x}\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{+92}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y\_m \cdot \left(x \cdot x\right), \mathsf{fma}\left(x \cdot x, 0.041666666666666664, 0.5\right), y\_m\right)}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y\_m \cdot \left(x \cdot \left(\left(x \cdot x\right) \cdot 0.041666666666666664\right)\right)}{z}\\
\end{array}
\end{array}
if x < 2.3999999999999999e-217Initial program 84.6%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6457.3
Applied rewrites57.3%
Applied rewrites59.5%
if 2.3999999999999999e-217 < x < 8.20000000000000047e92Initial program 95.6%
Taylor expanded in x around 0
Applied rewrites84.8%
Taylor expanded in x around 0
Applied rewrites81.4%
if 8.20000000000000047e92 < x Initial program 61.8%
Taylor expanded in x around 0
Applied rewrites58.2%
Taylor expanded in x around inf
Applied rewrites98.2%
Final simplification73.7%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(let* ((t_0 (fma x (* x 0.041666666666666664) 0.5)))
(*
y_s
(if (<= y_m 2.9e-98)
(/ (* y_m (/ (fma (* x x) t_0 1.0) x)) z)
(/ (/ (fma (* y_m x) (* x t_0) y_m) z) x)))))y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double t_0 = fma(x, (x * 0.041666666666666664), 0.5);
double tmp;
if (y_m <= 2.9e-98) {
tmp = (y_m * (fma((x * x), t_0, 1.0) / x)) / z;
} else {
tmp = (fma((y_m * x), (x * t_0), y_m) / z) / x;
}
return y_s * tmp;
}
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) t_0 = fma(x, Float64(x * 0.041666666666666664), 0.5) tmp = 0.0 if (y_m <= 2.9e-98) tmp = Float64(Float64(y_m * Float64(fma(Float64(x * x), t_0, 1.0) / x)) / z); else tmp = Float64(Float64(fma(Float64(y_m * x), Float64(x * t_0), y_m) / z) / x); end return Float64(y_s * tmp) end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := Block[{t$95$0 = N[(x * N[(x * 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision]}, N[(y$95$s * If[LessEqual[y$95$m, 2.9e-98], N[(N[(y$95$m * N[(N[(N[(x * x), $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(N[(N[(y$95$m * x), $MachinePrecision] * N[(x * t$95$0), $MachinePrecision] + y$95$m), $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x, x \cdot 0.041666666666666664, 0.5\right)\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;y\_m \leq 2.9 \cdot 10^{-98}:\\
\;\;\;\;\frac{y\_m \cdot \frac{\mathsf{fma}\left(x \cdot x, t\_0, 1\right)}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(y\_m \cdot x, x \cdot t\_0, y\_m\right)}{z}}{x}\\
\end{array}
\end{array}
\end{array}
if y < 2.9e-98Initial program 78.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
div-invN/A
lower-/.f6496.5
Applied rewrites96.5%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6488.0
Applied rewrites88.0%
if 2.9e-98 < y Initial program 90.2%
Taylor expanded in x around 0
Applied rewrites84.3%
Applied rewrites94.2%
Final simplification90.2%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= y_m 2.7e-98)
(/ (* y_m (/ (fma (* x x) (* x (* x 0.041666666666666664)) 1.0) x)) z)
(/
(/ (fma (* y_m x) (* x (fma x (* x 0.041666666666666664) 0.5)) y_m) z)
x))))y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (y_m <= 2.7e-98) {
tmp = (y_m * (fma((x * x), (x * (x * 0.041666666666666664)), 1.0) / x)) / z;
} else {
tmp = (fma((y_m * x), (x * fma(x, (x * 0.041666666666666664), 0.5)), y_m) / z) / x;
}
return y_s * tmp;
}
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (y_m <= 2.7e-98) tmp = Float64(Float64(y_m * Float64(fma(Float64(x * x), Float64(x * Float64(x * 0.041666666666666664)), 1.0) / x)) / z); else tmp = Float64(Float64(fma(Float64(y_m * x), Float64(x * fma(x, Float64(x * 0.041666666666666664), 0.5)), y_m) / z) / x); end return Float64(y_s * tmp) end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[y$95$m, 2.7e-98], N[(N[(y$95$m * N[(N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * 0.041666666666666664), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(N[(N[(y$95$m * x), $MachinePrecision] * N[(x * N[(x * N[(x * 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision] + y$95$m), $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;y\_m \leq 2.7 \cdot 10^{-98}:\\
\;\;\;\;\frac{y\_m \cdot \frac{\mathsf{fma}\left(x \cdot x, x \cdot \left(x \cdot 0.041666666666666664\right), 1\right)}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(y\_m \cdot x, x \cdot \mathsf{fma}\left(x, x \cdot 0.041666666666666664, 0.5\right), y\_m\right)}{z}}{x}\\
\end{array}
\end{array}
if y < 2.6999999999999999e-98Initial program 78.5%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
div-invN/A
lower-/.f6496.5
Applied rewrites96.5%
Taylor expanded in x around 0
Applied rewrites53.0%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6488.0
Applied rewrites88.0%
Taylor expanded in x around inf
Applied rewrites87.8%
if 2.6999999999999999e-98 < y Initial program 90.3%
Taylor expanded in x around 0
Applied rewrites84.4%
Applied rewrites94.3%
Final simplification90.1%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(let* ((t_0 (* (* x x) 0.041666666666666664)))
(*
y_s
(if (<= x 2.4e-217)
(/ (/ y_m z) x)
(if (<= x 8.2e+92)
(/ (fma x (* x (* y_m t_0)) y_m) (* x z))
(/ (* y_m (* x t_0)) z))))))y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double t_0 = (x * x) * 0.041666666666666664;
double tmp;
if (x <= 2.4e-217) {
tmp = (y_m / z) / x;
} else if (x <= 8.2e+92) {
tmp = fma(x, (x * (y_m * t_0)), y_m) / (x * z);
} else {
tmp = (y_m * (x * t_0)) / z;
}
return y_s * tmp;
}
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) t_0 = Float64(Float64(x * x) * 0.041666666666666664) tmp = 0.0 if (x <= 2.4e-217) tmp = Float64(Float64(y_m / z) / x); elseif (x <= 8.2e+92) tmp = Float64(fma(x, Float64(x * Float64(y_m * t_0)), y_m) / Float64(x * z)); else tmp = Float64(Float64(y_m * Float64(x * t_0)) / z); end return Float64(y_s * tmp) end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := Block[{t$95$0 = N[(N[(x * x), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]}, N[(y$95$s * If[LessEqual[x, 2.4e-217], N[(N[(y$95$m / z), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 8.2e+92], N[(N[(x * N[(x * N[(y$95$m * t$95$0), $MachinePrecision]), $MachinePrecision] + y$95$m), $MachinePrecision] / N[(x * z), $MachinePrecision]), $MachinePrecision], N[(N[(y$95$m * N[(x * t$95$0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
\begin{array}{l}
t_0 := \left(x \cdot x\right) \cdot 0.041666666666666664\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 2.4 \cdot 10^{-217}:\\
\;\;\;\;\frac{\frac{y\_m}{z}}{x}\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{+92}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, x \cdot \left(y\_m \cdot t\_0\right), y\_m\right)}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y\_m \cdot \left(x \cdot t\_0\right)}{z}\\
\end{array}
\end{array}
\end{array}
if x < 2.3999999999999999e-217Initial program 84.6%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6457.3
Applied rewrites57.3%
Applied rewrites59.5%
if 2.3999999999999999e-217 < x < 8.20000000000000047e92Initial program 95.6%
Taylor expanded in x around 0
Applied rewrites81.4%
Taylor expanded in x around inf
Applied rewrites80.4%
if 8.20000000000000047e92 < x Initial program 61.8%
Taylor expanded in x around 0
Applied rewrites58.2%
Taylor expanded in x around inf
Applied rewrites98.2%
Final simplification73.4%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= y_m 7.2e+255)
(/ (* y_m (/ (fma (* x x) (* x (* x 0.041666666666666664)) 1.0) x)) z)
(/
(* y_m (fma x (* x (fma x (* x 0.041666666666666664) 0.5)) 1.0))
(* x z)))))y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (y_m <= 7.2e+255) {
tmp = (y_m * (fma((x * x), (x * (x * 0.041666666666666664)), 1.0) / x)) / z;
} else {
tmp = (y_m * fma(x, (x * fma(x, (x * 0.041666666666666664), 0.5)), 1.0)) / (x * z);
}
return y_s * tmp;
}
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (y_m <= 7.2e+255) tmp = Float64(Float64(y_m * Float64(fma(Float64(x * x), Float64(x * Float64(x * 0.041666666666666664)), 1.0) / x)) / z); else tmp = Float64(Float64(y_m * fma(x, Float64(x * fma(x, Float64(x * 0.041666666666666664), 0.5)), 1.0)) / Float64(x * z)); end return Float64(y_s * tmp) end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[y$95$m, 7.2e+255], N[(N[(y$95$m * N[(N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * 0.041666666666666664), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(y$95$m * N[(x * N[(x * N[(x * N[(x * 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x * z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;y\_m \leq 7.2 \cdot 10^{+255}:\\
\;\;\;\;\frac{y\_m \cdot \frac{\mathsf{fma}\left(x \cdot x, x \cdot \left(x \cdot 0.041666666666666664\right), 1\right)}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y\_m \cdot \mathsf{fma}\left(x, x \cdot \mathsf{fma}\left(x, x \cdot 0.041666666666666664, 0.5\right), 1\right)}{x \cdot z}\\
\end{array}
\end{array}
if y < 7.1999999999999998e255Initial program 82.5%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
div-invN/A
lower-/.f6496.0
Applied rewrites96.0%
Taylor expanded in x around 0
Applied rewrites51.0%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6487.5
Applied rewrites87.5%
Taylor expanded in x around inf
Applied rewrites87.2%
if 7.1999999999999998e255 < y Initial program 85.4%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
div-invN/A
lower-/.f6485.4
Applied rewrites85.4%
Taylor expanded in x around 0
Applied rewrites43.4%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6476.6
Applied rewrites76.6%
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l/N/A
lower-/.f64N/A
Applied rewrites90.8%
Final simplification87.4%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= x 2.2)
(* (/ y_m z) (/ 1.0 x))
(/ (* 0.041666666666666664 (* y_m (* x (* x x)))) z))))y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 2.2) {
tmp = (y_m / z) * (1.0 / x);
} else {
tmp = (0.041666666666666664 * (y_m * (x * (x * x)))) / z;
}
return y_s * tmp;
}
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
real(8) function code(y_s, x, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 2.2d0) then
tmp = (y_m / z) * (1.0d0 / x)
else
tmp = (0.041666666666666664d0 * (y_m * (x * (x * x)))) / z
end if
code = y_s * tmp
end function
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 2.2) {
tmp = (y_m / z) * (1.0 / x);
} else {
tmp = (0.041666666666666664 * (y_m * (x * (x * x)))) / z;
}
return y_s * tmp;
}
y\_m = math.fabs(y) y\_s = math.copysign(1.0, y) def code(y_s, x, y_m, z): tmp = 0 if x <= 2.2: tmp = (y_m / z) * (1.0 / x) else: tmp = (0.041666666666666664 * (y_m * (x * (x * x)))) / z return y_s * tmp
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (x <= 2.2) tmp = Float64(Float64(y_m / z) * Float64(1.0 / x)); else tmp = Float64(Float64(0.041666666666666664 * Float64(y_m * Float64(x * Float64(x * x)))) / z); end return Float64(y_s * tmp) end
y\_m = abs(y); y\_s = sign(y) * abs(1.0); function tmp_2 = code(y_s, x, y_m, z) tmp = 0.0; if (x <= 2.2) tmp = (y_m / z) * (1.0 / x); else tmp = (0.041666666666666664 * (y_m * (x * (x * x)))) / z; end tmp_2 = y_s * tmp; end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[x, 2.2], N[(N[(y$95$m / z), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(N[(0.041666666666666664 * N[(y$95$m * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 2.2:\\
\;\;\;\;\frac{y\_m}{z} \cdot \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.041666666666666664 \cdot \left(y\_m \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)}{z}\\
\end{array}
\end{array}
if x < 2.2000000000000002Initial program 87.4%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6466.7
Applied rewrites66.7%
Applied rewrites68.9%
if 2.2000000000000002 < x Initial program 69.6%
Taylor expanded in x around 0
lower-/.f64N/A
Applied rewrites87.4%
Taylor expanded in x around inf
Applied rewrites83.2%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= x 2.2)
(* (/ y_m z) (/ 1.0 x))
(/ (* y_m (* x (* (* x x) 0.041666666666666664))) z))))y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 2.2) {
tmp = (y_m / z) * (1.0 / x);
} else {
tmp = (y_m * (x * ((x * x) * 0.041666666666666664))) / z;
}
return y_s * tmp;
}
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
real(8) function code(y_s, x, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 2.2d0) then
tmp = (y_m / z) * (1.0d0 / x)
else
tmp = (y_m * (x * ((x * x) * 0.041666666666666664d0))) / z
end if
code = y_s * tmp
end function
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 2.2) {
tmp = (y_m / z) * (1.0 / x);
} else {
tmp = (y_m * (x * ((x * x) * 0.041666666666666664))) / z;
}
return y_s * tmp;
}
y\_m = math.fabs(y) y\_s = math.copysign(1.0, y) def code(y_s, x, y_m, z): tmp = 0 if x <= 2.2: tmp = (y_m / z) * (1.0 / x) else: tmp = (y_m * (x * ((x * x) * 0.041666666666666664))) / z return y_s * tmp
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (x <= 2.2) tmp = Float64(Float64(y_m / z) * Float64(1.0 / x)); else tmp = Float64(Float64(y_m * Float64(x * Float64(Float64(x * x) * 0.041666666666666664))) / z); end return Float64(y_s * tmp) end
y\_m = abs(y); y\_s = sign(y) * abs(1.0); function tmp_2 = code(y_s, x, y_m, z) tmp = 0.0; if (x <= 2.2) tmp = (y_m / z) * (1.0 / x); else tmp = (y_m * (x * ((x * x) * 0.041666666666666664))) / z; end tmp_2 = y_s * tmp; end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[x, 2.2], N[(N[(y$95$m / z), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(N[(y$95$m * N[(x * N[(N[(x * x), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 2.2:\\
\;\;\;\;\frac{y\_m}{z} \cdot \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{y\_m \cdot \left(x \cdot \left(\left(x \cdot x\right) \cdot 0.041666666666666664\right)\right)}{z}\\
\end{array}
\end{array}
if x < 2.2000000000000002Initial program 87.4%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6466.7
Applied rewrites66.7%
Applied rewrites68.9%
if 2.2000000000000002 < x Initial program 69.6%
Taylor expanded in x around 0
Applied rewrites55.5%
Taylor expanded in x around inf
Applied rewrites83.2%
Final simplification72.8%
y\_m = (fabs.f64 y) y\_s = (copysign.f64 #s(literal 1 binary64) y) (FPCore (y_s x y_m z) :precision binary64 (* y_s (if (<= x 1.4) (* (/ y_m z) (/ 1.0 x)) (/ (* 0.5 (* y_m x)) z))))
y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 1.4) {
tmp = (y_m / z) * (1.0 / x);
} else {
tmp = (0.5 * (y_m * x)) / z;
}
return y_s * tmp;
}
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
real(8) function code(y_s, x, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 1.4d0) then
tmp = (y_m / z) * (1.0d0 / x)
else
tmp = (0.5d0 * (y_m * x)) / z
end if
code = y_s * tmp
end function
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 1.4) {
tmp = (y_m / z) * (1.0 / x);
} else {
tmp = (0.5 * (y_m * x)) / z;
}
return y_s * tmp;
}
y\_m = math.fabs(y) y\_s = math.copysign(1.0, y) def code(y_s, x, y_m, z): tmp = 0 if x <= 1.4: tmp = (y_m / z) * (1.0 / x) else: tmp = (0.5 * (y_m * x)) / z return y_s * tmp
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (x <= 1.4) tmp = Float64(Float64(y_m / z) * Float64(1.0 / x)); else tmp = Float64(Float64(0.5 * Float64(y_m * x)) / z); end return Float64(y_s * tmp) end
y\_m = abs(y); y\_s = sign(y) * abs(1.0); function tmp_2 = code(y_s, x, y_m, z) tmp = 0.0; if (x <= 1.4) tmp = (y_m / z) * (1.0 / x); else tmp = (0.5 * (y_m * x)) / z; end tmp_2 = y_s * tmp; end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[x, 1.4], N[(N[(y$95$m / z), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[(y$95$m * x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 1.4:\\
\;\;\;\;\frac{y\_m}{z} \cdot \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5 \cdot \left(y\_m \cdot x\right)}{z}\\
\end{array}
\end{array}
if x < 1.3999999999999999Initial program 87.4%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6466.7
Applied rewrites66.7%
Applied rewrites68.9%
if 1.3999999999999999 < x Initial program 69.6%
Taylor expanded in x around 0
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
associate-/l*N/A
+-commutativeN/A
distribute-lft1-inN/A
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
associate-/l*N/A
unpow2N/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f6437.0
Applied rewrites37.0%
Taylor expanded in x around inf
Applied rewrites37.0%
y\_m = (fabs.f64 y) y\_s = (copysign.f64 #s(literal 1 binary64) y) (FPCore (y_s x y_m z) :precision binary64 (* y_s (if (<= x 1.4) (/ (/ y_m z) x) (/ (* 0.5 (* y_m x)) z))))
y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 1.4) {
tmp = (y_m / z) / x;
} else {
tmp = (0.5 * (y_m * x)) / z;
}
return y_s * tmp;
}
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
real(8) function code(y_s, x, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 1.4d0) then
tmp = (y_m / z) / x
else
tmp = (0.5d0 * (y_m * x)) / z
end if
code = y_s * tmp
end function
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 1.4) {
tmp = (y_m / z) / x;
} else {
tmp = (0.5 * (y_m * x)) / z;
}
return y_s * tmp;
}
y\_m = math.fabs(y) y\_s = math.copysign(1.0, y) def code(y_s, x, y_m, z): tmp = 0 if x <= 1.4: tmp = (y_m / z) / x else: tmp = (0.5 * (y_m * x)) / z return y_s * tmp
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (x <= 1.4) tmp = Float64(Float64(y_m / z) / x); else tmp = Float64(Float64(0.5 * Float64(y_m * x)) / z); end return Float64(y_s * tmp) end
y\_m = abs(y); y\_s = sign(y) * abs(1.0); function tmp_2 = code(y_s, x, y_m, z) tmp = 0.0; if (x <= 1.4) tmp = (y_m / z) / x; else tmp = (0.5 * (y_m * x)) / z; end tmp_2 = y_s * tmp; end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[x, 1.4], N[(N[(y$95$m / z), $MachinePrecision] / x), $MachinePrecision], N[(N[(0.5 * N[(y$95$m * x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 1.4:\\
\;\;\;\;\frac{\frac{y\_m}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5 \cdot \left(y\_m \cdot x\right)}{z}\\
\end{array}
\end{array}
if x < 1.3999999999999999Initial program 87.4%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6466.7
Applied rewrites66.7%
Applied rewrites68.9%
if 1.3999999999999999 < x Initial program 69.6%
Taylor expanded in x around 0
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
associate-/l*N/A
+-commutativeN/A
distribute-lft1-inN/A
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
associate-/l*N/A
unpow2N/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f6437.0
Applied rewrites37.0%
Taylor expanded in x around inf
Applied rewrites37.0%
y\_m = (fabs.f64 y) y\_s = (copysign.f64 #s(literal 1 binary64) y) (FPCore (y_s x y_m z) :precision binary64 (* y_s (if (<= x 1.4) (/ y_m (* x z)) (/ (* 0.5 (* y_m x)) z))))
y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 1.4) {
tmp = y_m / (x * z);
} else {
tmp = (0.5 * (y_m * x)) / z;
}
return y_s * tmp;
}
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
real(8) function code(y_s, x, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 1.4d0) then
tmp = y_m / (x * z)
else
tmp = (0.5d0 * (y_m * x)) / z
end if
code = y_s * tmp
end function
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 1.4) {
tmp = y_m / (x * z);
} else {
tmp = (0.5 * (y_m * x)) / z;
}
return y_s * tmp;
}
y\_m = math.fabs(y) y\_s = math.copysign(1.0, y) def code(y_s, x, y_m, z): tmp = 0 if x <= 1.4: tmp = y_m / (x * z) else: tmp = (0.5 * (y_m * x)) / z return y_s * tmp
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (x <= 1.4) tmp = Float64(y_m / Float64(x * z)); else tmp = Float64(Float64(0.5 * Float64(y_m * x)) / z); end return Float64(y_s * tmp) end
y\_m = abs(y); y\_s = sign(y) * abs(1.0); function tmp_2 = code(y_s, x, y_m, z) tmp = 0.0; if (x <= 1.4) tmp = y_m / (x * z); else tmp = (0.5 * (y_m * x)) / z; end tmp_2 = y_s * tmp; end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[x, 1.4], N[(y$95$m / N[(x * z), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[(y$95$m * x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 1.4:\\
\;\;\;\;\frac{y\_m}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5 \cdot \left(y\_m \cdot x\right)}{z}\\
\end{array}
\end{array}
if x < 1.3999999999999999Initial program 87.4%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6466.7
Applied rewrites66.7%
if 1.3999999999999999 < x Initial program 69.6%
Taylor expanded in x around 0
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
associate-/l*N/A
+-commutativeN/A
distribute-lft1-inN/A
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
associate-/l*N/A
unpow2N/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f6437.0
Applied rewrites37.0%
Taylor expanded in x around inf
Applied rewrites37.0%
y\_m = (fabs.f64 y) y\_s = (copysign.f64 #s(literal 1 binary64) y) (FPCore (y_s x y_m z) :precision binary64 (* y_s (/ y_m (* x z))))
y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
return y_s * (y_m / (x * z));
}
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
real(8) function code(y_s, x, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
code = y_s * (y_m / (x * z))
end function
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
return y_s * (y_m / (x * z));
}
y\_m = math.fabs(y) y\_s = math.copysign(1.0, y) def code(y_s, x, y_m, z): return y_s * (y_m / (x * z))
y\_m = abs(y) y\_s = copysign(1.0, y) function code(y_s, x, y_m, z) return Float64(y_s * Float64(y_m / Float64(x * z))) end
y\_m = abs(y); y\_s = sign(y) * abs(1.0); function tmp = code(y_s, x, y_m, z) tmp = y_s * (y_m / (x * z)); end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * N[(y$95$m / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \frac{y\_m}{x \cdot z}
\end{array}
Initial program 82.6%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f6450.1
Applied rewrites50.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (/ (/ y z) x) (cosh x))))
(if (< y -4.618902267687042e-52)
t_0
(if (< y 1.038530535935153e-39) (/ (/ (* (cosh x) y) x) z) t_0))))
double code(double x, double y, double z) {
double t_0 = ((y / z) / x) * cosh(x);
double tmp;
if (y < -4.618902267687042e-52) {
tmp = t_0;
} else if (y < 1.038530535935153e-39) {
tmp = ((cosh(x) * y) / x) / z;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = ((y / z) / x) * cosh(x)
if (y < (-4.618902267687042d-52)) then
tmp = t_0
else if (y < 1.038530535935153d-39) then
tmp = ((cosh(x) * y) / x) / z
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = ((y / z) / x) * Math.cosh(x);
double tmp;
if (y < -4.618902267687042e-52) {
tmp = t_0;
} else if (y < 1.038530535935153e-39) {
tmp = ((Math.cosh(x) * y) / x) / z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = ((y / z) / x) * math.cosh(x) tmp = 0 if y < -4.618902267687042e-52: tmp = t_0 elif y < 1.038530535935153e-39: tmp = ((math.cosh(x) * y) / x) / z else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(y / z) / x) * cosh(x)) tmp = 0.0 if (y < -4.618902267687042e-52) tmp = t_0; elseif (y < 1.038530535935153e-39) tmp = Float64(Float64(Float64(cosh(x) * y) / x) / z); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = ((y / z) / x) * cosh(x); tmp = 0.0; if (y < -4.618902267687042e-52) tmp = t_0; elseif (y < 1.038530535935153e-39) tmp = ((cosh(x) * y) / x) / z; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision] * N[Cosh[x], $MachinePrecision]), $MachinePrecision]}, If[Less[y, -4.618902267687042e-52], t$95$0, If[Less[y, 1.038530535935153e-39], N[(N[(N[(N[Cosh[x], $MachinePrecision] * y), $MachinePrecision] / x), $MachinePrecision] / z), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{y}{z}}{x} \cdot \cosh x\\
\mathbf{if}\;y < -4.618902267687042 \cdot 10^{-52}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y < 1.038530535935153 \cdot 10^{-39}:\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
herbie shell --seed 2024219
(FPCore (x y z)
:name "Linear.Quaternion:$ctan from linear-1.19.1.3"
:precision binary64
:alt
(! :herbie-platform default (if (< y -2309451133843521/5000000000000000000000000000000000000000000000000000000000000000000) (* (/ (/ y z) x) (cosh x)) (if (< y 1038530535935153/1000000000000000000000000000000000000000000000000000000) (/ (/ (* (cosh x) y) x) z) (* (/ (/ y z) x) (cosh x)))))
(/ (* (cosh x) (/ y x)) z))