
(FPCore (x y z) :precision binary64 (/ (* x (/ (sin y) y)) z))
double code(double x, double y, double z) {
return (x * (sin(y) / y)) / z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * (sin(y) / y)) / z
end function
public static double code(double x, double y, double z) {
return (x * (Math.sin(y) / y)) / z;
}
def code(x, y, z): return (x * (math.sin(y) / y)) / z
function code(x, y, z) return Float64(Float64(x * Float64(sin(y) / y)) / z) end
function tmp = code(x, y, z) tmp = (x * (sin(y) / y)) / z; end
code[x_, y_, z_] := N[(N[(x * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \frac{\sin y}{y}}{z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (* x (/ (sin y) y)) z))
double code(double x, double y, double z) {
return (x * (sin(y) / y)) / z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * (sin(y) / y)) / z
end function
public static double code(double x, double y, double z) {
return (x * (Math.sin(y) / y)) / z;
}
def code(x, y, z): return (x * (math.sin(y) / y)) / z
function code(x, y, z) return Float64(Float64(x * Float64(sin(y) / y)) / z) end
function tmp = code(x, y, z) tmp = (x * (sin(y) / y)) / z; end
code[x_, y_, z_] := N[(N[(x * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \frac{\sin y}{y}}{z}
\end{array}
z_m = (fabs.f64 z) z_s = (copysign.f64 1 z) (FPCore (z_s x y z_m) :precision binary64 (let* ((t_0 (/ (sin y) y))) (* z_s (if (<= z_m 1e+63) (/ x (/ z_m t_0)) (/ (* x t_0) z_m)))))
z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m) {
double t_0 = sin(y) / y;
double tmp;
if (z_m <= 1e+63) {
tmp = x / (z_m / t_0);
} else {
tmp = (x * t_0) / z_m;
}
return z_s * tmp;
}
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8) :: t_0
real(8) :: tmp
t_0 = sin(y) / y
if (z_m <= 1d+63) then
tmp = x / (z_m / t_0)
else
tmp = (x * t_0) / z_m
end if
code = z_s * tmp
end function
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m) {
double t_0 = Math.sin(y) / y;
double tmp;
if (z_m <= 1e+63) {
tmp = x / (z_m / t_0);
} else {
tmp = (x * t_0) / z_m;
}
return z_s * tmp;
}
z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x, y, z_m): t_0 = math.sin(y) / y tmp = 0 if z_m <= 1e+63: tmp = x / (z_m / t_0) else: tmp = (x * t_0) / z_m return z_s * tmp
z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x, y, z_m) t_0 = Float64(sin(y) / y) tmp = 0.0 if (z_m <= 1e+63) tmp = Float64(x / Float64(z_m / t_0)); else tmp = Float64(Float64(x * t_0) / z_m); end return Float64(z_s * tmp) end
z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m) t_0 = sin(y) / y; tmp = 0.0; if (z_m <= 1e+63) tmp = x / (z_m / t_0); else tmp = (x * t_0) / z_m; end tmp_2 = z_s * tmp; end
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_] := Block[{t$95$0 = N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]}, N[(z$95$s * If[LessEqual[z$95$m, 1e+63], N[(x / N[(z$95$m / t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(x * t$95$0), $MachinePrecision] / z$95$m), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
\begin{array}{l}
t_0 := \frac{\sin y}{y}\\
z_s \cdot \begin{array}{l}
\mathbf{if}\;z_m \leq 10^{+63}:\\
\;\;\;\;\frac{x}{\frac{z_m}{t_0}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot t_0}{z_m}\\
\end{array}
\end{array}
\end{array}
if z < 1.00000000000000006e63Initial program 96.9%
associate-/l*97.6%
Simplified97.6%
if 1.00000000000000006e63 < z Initial program 99.9%
Final simplification98.0%
z_m = (fabs.f64 z) z_s = (copysign.f64 1 z) (FPCore (z_s x y z_m) :precision binary64 (let* ((t_0 (/ (sin y) y))) (* z_s (if (<= t_0 5e-223) (* (sin y) (/ (/ x y) z_m)) (* t_0 (/ x z_m))))))
z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m) {
double t_0 = sin(y) / y;
double tmp;
if (t_0 <= 5e-223) {
tmp = sin(y) * ((x / y) / z_m);
} else {
tmp = t_0 * (x / z_m);
}
return z_s * tmp;
}
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8) :: t_0
real(8) :: tmp
t_0 = sin(y) / y
if (t_0 <= 5d-223) then
tmp = sin(y) * ((x / y) / z_m)
else
tmp = t_0 * (x / z_m)
end if
code = z_s * tmp
end function
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m) {
double t_0 = Math.sin(y) / y;
double tmp;
if (t_0 <= 5e-223) {
tmp = Math.sin(y) * ((x / y) / z_m);
} else {
tmp = t_0 * (x / z_m);
}
return z_s * tmp;
}
z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x, y, z_m): t_0 = math.sin(y) / y tmp = 0 if t_0 <= 5e-223: tmp = math.sin(y) * ((x / y) / z_m) else: tmp = t_0 * (x / z_m) return z_s * tmp
z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x, y, z_m) t_0 = Float64(sin(y) / y) tmp = 0.0 if (t_0 <= 5e-223) tmp = Float64(sin(y) * Float64(Float64(x / y) / z_m)); else tmp = Float64(t_0 * Float64(x / z_m)); end return Float64(z_s * tmp) end
z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m) t_0 = sin(y) / y; tmp = 0.0; if (t_0 <= 5e-223) tmp = sin(y) * ((x / y) / z_m); else tmp = t_0 * (x / z_m); end tmp_2 = z_s * tmp; end
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_] := Block[{t$95$0 = N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]}, N[(z$95$s * If[LessEqual[t$95$0, 5e-223], N[(N[Sin[y], $MachinePrecision] * N[(N[(x / y), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(x / z$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
\begin{array}{l}
t_0 := \frac{\sin y}{y}\\
z_s \cdot \begin{array}{l}
\mathbf{if}\;t_0 \leq 5 \cdot 10^{-223}:\\
\;\;\;\;\sin y \cdot \frac{\frac{x}{y}}{z_m}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \frac{x}{z_m}\\
\end{array}
\end{array}
\end{array}
if (/.f64 (sin.f64 y) y) < 5.00000000000000024e-223Initial program 96.1%
*-lft-identity96.1%
metadata-eval96.1%
times-frac96.1%
neg-mul-196.1%
distribute-lft-neg-out96.1%
associate-*r/96.1%
associate-*l/96.2%
*-commutative96.2%
times-frac95.1%
remove-double-neg95.1%
distribute-frac-neg95.1%
sin-neg95.1%
sin-neg95.1%
neg-mul-195.1%
associate-/l*95.0%
associate-/r/95.1%
distribute-lft-neg-in95.1%
metadata-eval95.1%
metadata-eval95.1%
neg-mul-195.1%
sin-neg95.1%
*-commutative95.1%
Simplified95.1%
if 5.00000000000000024e-223 < (/.f64 (sin.f64 y) y) Initial program 97.9%
*-commutative97.9%
associate-*r/98.8%
Simplified98.8%
Final simplification97.7%
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x y z_m)
:precision binary64
(*
z_s
(if (<= y 1.5e-8)
(/ x z_m)
(if (<= y 6e+205)
(* x (/ (sin y) (* z_m y)))
(* (sin y) (/ (/ x y) z_m))))))z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m) {
double tmp;
if (y <= 1.5e-8) {
tmp = x / z_m;
} else if (y <= 6e+205) {
tmp = x * (sin(y) / (z_m * y));
} else {
tmp = sin(y) * ((x / y) / z_m);
}
return z_s * tmp;
}
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8) :: tmp
if (y <= 1.5d-8) then
tmp = x / z_m
else if (y <= 6d+205) then
tmp = x * (sin(y) / (z_m * y))
else
tmp = sin(y) * ((x / y) / z_m)
end if
code = z_s * tmp
end function
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m) {
double tmp;
if (y <= 1.5e-8) {
tmp = x / z_m;
} else if (y <= 6e+205) {
tmp = x * (Math.sin(y) / (z_m * y));
} else {
tmp = Math.sin(y) * ((x / y) / z_m);
}
return z_s * tmp;
}
z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x, y, z_m): tmp = 0 if y <= 1.5e-8: tmp = x / z_m elif y <= 6e+205: tmp = x * (math.sin(y) / (z_m * y)) else: tmp = math.sin(y) * ((x / y) / z_m) return z_s * tmp
z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x, y, z_m) tmp = 0.0 if (y <= 1.5e-8) tmp = Float64(x / z_m); elseif (y <= 6e+205) tmp = Float64(x * Float64(sin(y) / Float64(z_m * y))); else tmp = Float64(sin(y) * Float64(Float64(x / y) / z_m)); end return Float64(z_s * tmp) end
z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m) tmp = 0.0; if (y <= 1.5e-8) tmp = x / z_m; elseif (y <= 6e+205) tmp = x * (sin(y) / (z_m * y)); else tmp = sin(y) * ((x / y) / z_m); end tmp_2 = z_s * tmp; end
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_] := N[(z$95$s * If[LessEqual[y, 1.5e-8], N[(x / z$95$m), $MachinePrecision], If[LessEqual[y, 6e+205], N[(x * N[(N[Sin[y], $MachinePrecision] / N[(z$95$m * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[y], $MachinePrecision] * N[(N[(x / y), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
z_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq 1.5 \cdot 10^{-8}:\\
\;\;\;\;\frac{x}{z_m}\\
\mathbf{elif}\;y \leq 6 \cdot 10^{+205}:\\
\;\;\;\;x \cdot \frac{\sin y}{z_m \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\sin y \cdot \frac{\frac{x}{y}}{z_m}\\
\end{array}
\end{array}
if y < 1.49999999999999987e-8Initial program 98.1%
Taylor expanded in y around 0 77.2%
if 1.49999999999999987e-8 < y < 5.9999999999999999e205Initial program 97.1%
associate-*r/99.5%
associate-/l/99.8%
*-commutative99.8%
Simplified99.8%
if 5.9999999999999999e205 < y Initial program 92.4%
*-lft-identity92.4%
metadata-eval92.4%
times-frac92.4%
neg-mul-192.4%
distribute-lft-neg-out92.4%
associate-*r/92.2%
associate-*l/92.6%
*-commutative92.6%
times-frac92.5%
remove-double-neg92.5%
distribute-frac-neg92.5%
sin-neg92.5%
sin-neg92.5%
neg-mul-192.5%
associate-/l*92.5%
associate-/r/92.5%
distribute-lft-neg-in92.5%
metadata-eval92.5%
metadata-eval92.5%
neg-mul-192.5%
sin-neg92.5%
*-commutative92.5%
Simplified92.5%
Final simplification82.2%
z_m = (fabs.f64 z) z_s = (copysign.f64 1 z) (FPCore (z_s x y z_m) :precision binary64 (* z_s (if (<= y 2.2e-8) (/ x z_m) (* x (/ (sin y) (* z_m y))))))
z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m) {
double tmp;
if (y <= 2.2e-8) {
tmp = x / z_m;
} else {
tmp = x * (sin(y) / (z_m * y));
}
return z_s * tmp;
}
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8) :: tmp
if (y <= 2.2d-8) then
tmp = x / z_m
else
tmp = x * (sin(y) / (z_m * y))
end if
code = z_s * tmp
end function
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m) {
double tmp;
if (y <= 2.2e-8) {
tmp = x / z_m;
} else {
tmp = x * (Math.sin(y) / (z_m * y));
}
return z_s * tmp;
}
z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x, y, z_m): tmp = 0 if y <= 2.2e-8: tmp = x / z_m else: tmp = x * (math.sin(y) / (z_m * y)) return z_s * tmp
z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x, y, z_m) tmp = 0.0 if (y <= 2.2e-8) tmp = Float64(x / z_m); else tmp = Float64(x * Float64(sin(y) / Float64(z_m * y))); end return Float64(z_s * tmp) end
z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m) tmp = 0.0; if (y <= 2.2e-8) tmp = x / z_m; else tmp = x * (sin(y) / (z_m * y)); end tmp_2 = z_s * tmp; end
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_] := N[(z$95$s * If[LessEqual[y, 2.2e-8], N[(x / z$95$m), $MachinePrecision], N[(x * N[(N[Sin[y], $MachinePrecision] / N[(z$95$m * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
z_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq 2.2 \cdot 10^{-8}:\\
\;\;\;\;\frac{x}{z_m}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\sin y}{z_m \cdot y}\\
\end{array}
\end{array}
if y < 2.1999999999999998e-8Initial program 98.1%
Taylor expanded in y around 0 77.2%
if 2.1999999999999998e-8 < y Initial program 95.4%
associate-*r/93.7%
associate-/l/93.8%
*-commutative93.8%
Simplified93.8%
Final simplification81.3%
z_m = (fabs.f64 z) z_s = (copysign.f64 1 z) (FPCore (z_s x y z_m) :precision binary64 (let* ((t_0 (/ (sin y) y))) (* z_s (if (<= z_m 2e+52) (/ x (/ z_m t_0)) (* t_0 (/ x z_m))))))
z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m) {
double t_0 = sin(y) / y;
double tmp;
if (z_m <= 2e+52) {
tmp = x / (z_m / t_0);
} else {
tmp = t_0 * (x / z_m);
}
return z_s * tmp;
}
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8) :: t_0
real(8) :: tmp
t_0 = sin(y) / y
if (z_m <= 2d+52) then
tmp = x / (z_m / t_0)
else
tmp = t_0 * (x / z_m)
end if
code = z_s * tmp
end function
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m) {
double t_0 = Math.sin(y) / y;
double tmp;
if (z_m <= 2e+52) {
tmp = x / (z_m / t_0);
} else {
tmp = t_0 * (x / z_m);
}
return z_s * tmp;
}
z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x, y, z_m): t_0 = math.sin(y) / y tmp = 0 if z_m <= 2e+52: tmp = x / (z_m / t_0) else: tmp = t_0 * (x / z_m) return z_s * tmp
z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x, y, z_m) t_0 = Float64(sin(y) / y) tmp = 0.0 if (z_m <= 2e+52) tmp = Float64(x / Float64(z_m / t_0)); else tmp = Float64(t_0 * Float64(x / z_m)); end return Float64(z_s * tmp) end
z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m) t_0 = sin(y) / y; tmp = 0.0; if (z_m <= 2e+52) tmp = x / (z_m / t_0); else tmp = t_0 * (x / z_m); end tmp_2 = z_s * tmp; end
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_] := Block[{t$95$0 = N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]}, N[(z$95$s * If[LessEqual[z$95$m, 2e+52], N[(x / N[(z$95$m / t$95$0), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(x / z$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
\begin{array}{l}
t_0 := \frac{\sin y}{y}\\
z_s \cdot \begin{array}{l}
\mathbf{if}\;z_m \leq 2 \cdot 10^{+52}:\\
\;\;\;\;\frac{x}{\frac{z_m}{t_0}}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \frac{x}{z_m}\\
\end{array}
\end{array}
\end{array}
if z < 2e52Initial program 96.9%
associate-/l*97.5%
Simplified97.5%
if 2e52 < z Initial program 99.9%
*-commutative99.9%
associate-*r/99.9%
Simplified99.9%
Final simplification97.9%
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x y z_m)
:precision binary64
(*
z_s
(if (<= y 3.8e-24)
(/ x z_m)
(/ x (* y (* z_m (+ (* y 0.16666666666666666) (/ 1.0 y))))))))z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m) {
double tmp;
if (y <= 3.8e-24) {
tmp = x / z_m;
} else {
tmp = x / (y * (z_m * ((y * 0.16666666666666666) + (1.0 / y))));
}
return z_s * tmp;
}
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8) :: tmp
if (y <= 3.8d-24) then
tmp = x / z_m
else
tmp = x / (y * (z_m * ((y * 0.16666666666666666d0) + (1.0d0 / y))))
end if
code = z_s * tmp
end function
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m) {
double tmp;
if (y <= 3.8e-24) {
tmp = x / z_m;
} else {
tmp = x / (y * (z_m * ((y * 0.16666666666666666) + (1.0 / y))));
}
return z_s * tmp;
}
z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x, y, z_m): tmp = 0 if y <= 3.8e-24: tmp = x / z_m else: tmp = x / (y * (z_m * ((y * 0.16666666666666666) + (1.0 / y)))) return z_s * tmp
z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x, y, z_m) tmp = 0.0 if (y <= 3.8e-24) tmp = Float64(x / z_m); else tmp = Float64(x / Float64(y * Float64(z_m * Float64(Float64(y * 0.16666666666666666) + Float64(1.0 / y))))); end return Float64(z_s * tmp) end
z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m) tmp = 0.0; if (y <= 3.8e-24) tmp = x / z_m; else tmp = x / (y * (z_m * ((y * 0.16666666666666666) + (1.0 / y)))); end tmp_2 = z_s * tmp; end
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_] := N[(z$95$s * If[LessEqual[y, 3.8e-24], N[(x / z$95$m), $MachinePrecision], N[(x / N[(y * N[(z$95$m * N[(N[(y * 0.16666666666666666), $MachinePrecision] + N[(1.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
z_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq 3.8 \cdot 10^{-24}:\\
\;\;\;\;\frac{x}{z_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(z_m \cdot \left(y \cdot 0.16666666666666666 + \frac{1}{y}\right)\right)}\\
\end{array}
\end{array}
if y < 3.80000000000000026e-24Initial program 98.0%
Taylor expanded in y around 0 76.7%
if 3.80000000000000026e-24 < y Initial program 95.7%
associate-*r/94.1%
associate-/l/94.2%
*-commutative94.2%
Simplified94.2%
associate-/r*94.1%
clear-num93.9%
div-inv94.0%
associate-/r/93.9%
associate-/r*91.7%
Applied egg-rr91.7%
Taylor expanded in y around 0 35.2%
Taylor expanded in z around 0 33.8%
Final simplification65.3%
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x y z_m)
:precision binary64
(*
z_s
(if (<= y 4.1e-14)
(/ x z_m)
(/ (/ x (+ (* (* z_m y) 0.16666666666666666) (/ z_m y))) y))))z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m) {
double tmp;
if (y <= 4.1e-14) {
tmp = x / z_m;
} else {
tmp = (x / (((z_m * y) * 0.16666666666666666) + (z_m / y))) / y;
}
return z_s * tmp;
}
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8) :: tmp
if (y <= 4.1d-14) then
tmp = x / z_m
else
tmp = (x / (((z_m * y) * 0.16666666666666666d0) + (z_m / y))) / y
end if
code = z_s * tmp
end function
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m) {
double tmp;
if (y <= 4.1e-14) {
tmp = x / z_m;
} else {
tmp = (x / (((z_m * y) * 0.16666666666666666) + (z_m / y))) / y;
}
return z_s * tmp;
}
z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x, y, z_m): tmp = 0 if y <= 4.1e-14: tmp = x / z_m else: tmp = (x / (((z_m * y) * 0.16666666666666666) + (z_m / y))) / y return z_s * tmp
z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x, y, z_m) tmp = 0.0 if (y <= 4.1e-14) tmp = Float64(x / z_m); else tmp = Float64(Float64(x / Float64(Float64(Float64(z_m * y) * 0.16666666666666666) + Float64(z_m / y))) / y); end return Float64(z_s * tmp) end
z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m) tmp = 0.0; if (y <= 4.1e-14) tmp = x / z_m; else tmp = (x / (((z_m * y) * 0.16666666666666666) + (z_m / y))) / y; end tmp_2 = z_s * tmp; end
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_] := N[(z$95$s * If[LessEqual[y, 4.1e-14], N[(x / z$95$m), $MachinePrecision], N[(N[(x / N[(N[(N[(z$95$m * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision] + N[(z$95$m / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
z_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq 4.1 \cdot 10^{-14}:\\
\;\;\;\;\frac{x}{z_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{\left(z_m \cdot y\right) \cdot 0.16666666666666666 + \frac{z_m}{y}}}{y}\\
\end{array}
\end{array}
if y < 4.1000000000000002e-14Initial program 98.1%
Taylor expanded in y around 0 77.2%
if 4.1000000000000002e-14 < y Initial program 95.4%
associate-*r/93.7%
associate-/l/93.8%
*-commutative93.8%
Simplified93.8%
associate-/r*93.7%
clear-num93.6%
div-inv93.6%
associate-/r/93.6%
associate-/r*91.2%
Applied egg-rr91.2%
Taylor expanded in y around 0 31.2%
Final simplification65.7%
z_m = (fabs.f64 z) z_s = (copysign.f64 1 z) (FPCore (z_s x y z_m) :precision binary64 (* z_s (if (<= y 2.5) (/ x z_m) (/ (* 6.0 (/ x (* z_m y))) y))))
z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m) {
double tmp;
if (y <= 2.5) {
tmp = x / z_m;
} else {
tmp = (6.0 * (x / (z_m * y))) / y;
}
return z_s * tmp;
}
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8) :: tmp
if (y <= 2.5d0) then
tmp = x / z_m
else
tmp = (6.0d0 * (x / (z_m * y))) / y
end if
code = z_s * tmp
end function
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m) {
double tmp;
if (y <= 2.5) {
tmp = x / z_m;
} else {
tmp = (6.0 * (x / (z_m * y))) / y;
}
return z_s * tmp;
}
z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x, y, z_m): tmp = 0 if y <= 2.5: tmp = x / z_m else: tmp = (6.0 * (x / (z_m * y))) / y return z_s * tmp
z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x, y, z_m) tmp = 0.0 if (y <= 2.5) tmp = Float64(x / z_m); else tmp = Float64(Float64(6.0 * Float64(x / Float64(z_m * y))) / y); end return Float64(z_s * tmp) end
z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m) tmp = 0.0; if (y <= 2.5) tmp = x / z_m; else tmp = (6.0 * (x / (z_m * y))) / y; end tmp_2 = z_s * tmp; end
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_] := N[(z$95$s * If[LessEqual[y, 2.5], N[(x / z$95$m), $MachinePrecision], N[(N[(6.0 * N[(x / N[(z$95$m * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
z_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq 2.5:\\
\;\;\;\;\frac{x}{z_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{6 \cdot \frac{x}{z_m \cdot y}}{y}\\
\end{array}
\end{array}
if y < 2.5Initial program 98.1%
Taylor expanded in y around 0 77.0%
if 2.5 < y Initial program 95.3%
associate-*r/93.5%
associate-/l/93.6%
*-commutative93.6%
Simplified93.6%
associate-/r*93.5%
clear-num93.3%
div-inv93.4%
associate-/r/93.4%
associate-/r*90.9%
Applied egg-rr90.9%
Taylor expanded in y around 0 29.3%
Taylor expanded in y around inf 29.3%
Final simplification65.5%
z_m = (fabs.f64 z) z_s = (copysign.f64 1 z) (FPCore (z_s x y z_m) :precision binary64 (* z_s (if (<= y 3.05e-9) (/ x z_m) (* y (/ x (* z_m y))))))
z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m) {
double tmp;
if (y <= 3.05e-9) {
tmp = x / z_m;
} else {
tmp = y * (x / (z_m * y));
}
return z_s * tmp;
}
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8) :: tmp
if (y <= 3.05d-9) then
tmp = x / z_m
else
tmp = y * (x / (z_m * y))
end if
code = z_s * tmp
end function
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m) {
double tmp;
if (y <= 3.05e-9) {
tmp = x / z_m;
} else {
tmp = y * (x / (z_m * y));
}
return z_s * tmp;
}
z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x, y, z_m): tmp = 0 if y <= 3.05e-9: tmp = x / z_m else: tmp = y * (x / (z_m * y)) return z_s * tmp
z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x, y, z_m) tmp = 0.0 if (y <= 3.05e-9) tmp = Float64(x / z_m); else tmp = Float64(y * Float64(x / Float64(z_m * y))); end return Float64(z_s * tmp) end
z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m) tmp = 0.0; if (y <= 3.05e-9) tmp = x / z_m; else tmp = y * (x / (z_m * y)); end tmp_2 = z_s * tmp; end
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_] := N[(z$95$s * If[LessEqual[y, 3.05e-9], N[(x / z$95$m), $MachinePrecision], N[(y * N[(x / N[(z$95$m * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
z_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq 3.05 \cdot 10^{-9}:\\
\;\;\;\;\frac{x}{z_m}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z_m \cdot y}\\
\end{array}
\end{array}
if y < 3.05e-9Initial program 98.1%
Taylor expanded in y around 0 77.2%
if 3.05e-9 < y Initial program 95.4%
associate-*r/93.7%
associate-/l/93.8%
*-commutative93.8%
Simplified93.8%
Taylor expanded in y around 0 20.6%
un-div-inv20.6%
clear-num20.6%
Applied egg-rr20.6%
*-un-lft-identity20.6%
*-inverses20.6%
times-frac23.3%
associate-/r*23.7%
clear-num23.7%
associate-/r/29.5%
Applied egg-rr29.5%
Final simplification65.2%
z_m = (fabs.f64 z) z_s = (copysign.f64 1 z) (FPCore (z_s x y z_m) :precision binary64 (* z_s (if (<= y 0.00037) (/ x z_m) (/ y (* y (/ z_m x))))))
z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m) {
double tmp;
if (y <= 0.00037) {
tmp = x / z_m;
} else {
tmp = y / (y * (z_m / x));
}
return z_s * tmp;
}
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8) :: tmp
if (y <= 0.00037d0) then
tmp = x / z_m
else
tmp = y / (y * (z_m / x))
end if
code = z_s * tmp
end function
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m) {
double tmp;
if (y <= 0.00037) {
tmp = x / z_m;
} else {
tmp = y / (y * (z_m / x));
}
return z_s * tmp;
}
z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x, y, z_m): tmp = 0 if y <= 0.00037: tmp = x / z_m else: tmp = y / (y * (z_m / x)) return z_s * tmp
z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x, y, z_m) tmp = 0.0 if (y <= 0.00037) tmp = Float64(x / z_m); else tmp = Float64(y / Float64(y * Float64(z_m / x))); end return Float64(z_s * tmp) end
z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m) tmp = 0.0; if (y <= 0.00037) tmp = x / z_m; else tmp = y / (y * (z_m / x)); end tmp_2 = z_s * tmp; end
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_] := N[(z$95$s * If[LessEqual[y, 0.00037], N[(x / z$95$m), $MachinePrecision], N[(y / N[(y * N[(z$95$m / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
z_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq 0.00037:\\
\;\;\;\;\frac{x}{z_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{y \cdot \frac{z_m}{x}}\\
\end{array}
\end{array}
if y < 3.6999999999999999e-4Initial program 98.1%
Taylor expanded in y around 0 77.2%
if 3.6999999999999999e-4 < y Initial program 95.4%
associate-*r/93.6%
associate-/l/93.7%
*-commutative93.7%
Simplified93.7%
Taylor expanded in y around 0 19.7%
un-div-inv19.7%
clear-num19.7%
Applied egg-rr19.7%
*-un-lft-identity19.7%
*-inverses19.7%
times-frac22.5%
associate-/r*22.8%
clear-num22.8%
associate-/r/28.7%
Applied egg-rr28.7%
*-commutative28.7%
clear-num29.1%
un-div-inv29.1%
*-un-lft-identity29.1%
times-frac28.9%
/-rgt-identity28.9%
Applied egg-rr28.9%
Final simplification65.3%
z_m = (fabs.f64 z) z_s = (copysign.f64 1 z) (FPCore (z_s x y z_m) :precision binary64 (* z_s (if (<= y 2.1e-8) (/ x z_m) (/ y (* z_m (/ y x))))))
z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m) {
double tmp;
if (y <= 2.1e-8) {
tmp = x / z_m;
} else {
tmp = y / (z_m * (y / x));
}
return z_s * tmp;
}
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8) :: tmp
if (y <= 2.1d-8) then
tmp = x / z_m
else
tmp = y / (z_m * (y / x))
end if
code = z_s * tmp
end function
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m) {
double tmp;
if (y <= 2.1e-8) {
tmp = x / z_m;
} else {
tmp = y / (z_m * (y / x));
}
return z_s * tmp;
}
z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x, y, z_m): tmp = 0 if y <= 2.1e-8: tmp = x / z_m else: tmp = y / (z_m * (y / x)) return z_s * tmp
z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x, y, z_m) tmp = 0.0 if (y <= 2.1e-8) tmp = Float64(x / z_m); else tmp = Float64(y / Float64(z_m * Float64(y / x))); end return Float64(z_s * tmp) end
z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m) tmp = 0.0; if (y <= 2.1e-8) tmp = x / z_m; else tmp = y / (z_m * (y / x)); end tmp_2 = z_s * tmp; end
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_] := N[(z$95$s * If[LessEqual[y, 2.1e-8], N[(x / z$95$m), $MachinePrecision], N[(y / N[(z$95$m * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
z_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq 2.1 \cdot 10^{-8}:\\
\;\;\;\;\frac{x}{z_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z_m \cdot \frac{y}{x}}\\
\end{array}
\end{array}
if y < 2.09999999999999994e-8Initial program 98.1%
Taylor expanded in y around 0 77.2%
if 2.09999999999999994e-8 < y Initial program 95.4%
associate-*r/93.7%
associate-/l/93.8%
*-commutative93.8%
Simplified93.8%
Taylor expanded in y around 0 20.6%
un-div-inv20.6%
clear-num20.6%
Applied egg-rr20.6%
*-un-lft-identity20.6%
*-inverses20.6%
times-frac23.3%
associate-/r*23.7%
clear-num23.7%
associate-/r/29.5%
Applied egg-rr29.5%
associate-*l/23.3%
*-commutative23.3%
associate-/l/20.4%
associate-*l/20.4%
associate-/l*23.3%
associate-/l/29.8%
Applied egg-rr29.8%
Final simplification65.3%
z_m = (fabs.f64 z) z_s = (copysign.f64 1 z) (FPCore (z_s x y z_m) :precision binary64 (* z_s (/ x z_m)))
z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m) {
return z_s * (x / z_m);
}
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
code = z_s * (x / z_m)
end function
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m) {
return z_s * (x / z_m);
}
z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x, y, z_m): return z_s * (x / z_m)
z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x, y, z_m) return Float64(z_s * Float64(x / z_m)) end
z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp = code(z_s, x, y, z_m) tmp = z_s * (x / z_m); end
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_] := N[(z$95$s * N[(x / z$95$m), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
z_s \cdot \frac{x}{z_m}
\end{array}
Initial program 97.4%
Taylor expanded in y around 0 63.0%
Final simplification63.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ y (sin y))) (t_1 (/ (* x (/ 1.0 t_0)) z)))
(if (< z -4.2173720203427147e-29)
t_1
(if (< z 4.446702369113811e+64) (/ x (* z t_0)) t_1))))
double code(double x, double y, double z) {
double t_0 = y / sin(y);
double t_1 = (x * (1.0 / t_0)) / z;
double tmp;
if (z < -4.2173720203427147e-29) {
tmp = t_1;
} else if (z < 4.446702369113811e+64) {
tmp = x / (z * t_0);
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_0 = y / sin(y)
t_1 = (x * (1.0d0 / t_0)) / z
if (z < (-4.2173720203427147d-29)) then
tmp = t_1
else if (z < 4.446702369113811d+64) then
tmp = x / (z * t_0)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y / Math.sin(y);
double t_1 = (x * (1.0 / t_0)) / z;
double tmp;
if (z < -4.2173720203427147e-29) {
tmp = t_1;
} else if (z < 4.446702369113811e+64) {
tmp = x / (z * t_0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = y / math.sin(y) t_1 = (x * (1.0 / t_0)) / z tmp = 0 if z < -4.2173720203427147e-29: tmp = t_1 elif z < 4.446702369113811e+64: tmp = x / (z * t_0) else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(y / sin(y)) t_1 = Float64(Float64(x * Float64(1.0 / t_0)) / z) tmp = 0.0 if (z < -4.2173720203427147e-29) tmp = t_1; elseif (z < 4.446702369113811e+64) tmp = Float64(x / Float64(z * t_0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = y / sin(y); t_1 = (x * (1.0 / t_0)) / z; tmp = 0.0; if (z < -4.2173720203427147e-29) tmp = t_1; elseif (z < 4.446702369113811e+64) tmp = x / (z * t_0); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y / N[Sin[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x * N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]}, If[Less[z, -4.2173720203427147e-29], t$95$1, If[Less[z, 4.446702369113811e+64], N[(x / N[(z * t$95$0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{\sin y}\\
t_1 := \frac{x \cdot \frac{1}{t_0}}{z}\\
\mathbf{if}\;z < -4.2173720203427147 \cdot 10^{-29}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z < 4.446702369113811 \cdot 10^{+64}:\\
\;\;\;\;\frac{x}{z \cdot t_0}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
herbie shell --seed 2024024
(FPCore (x y z)
:name "Linear.Quaternion:$ctanh from linear-1.19.1.3"
:precision binary64
:herbie-target
(if (< z -4.2173720203427147e-29) (/ (* x (/ 1.0 (/ y (sin y)))) z) (if (< z 4.446702369113811e+64) (/ x (* z (/ y (sin y)))) (/ (* x (/ 1.0 (/ y (sin y)))) z)))
(/ (* x (/ (sin y) y)) z))