
(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 18 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}
(FPCore (x y z) :precision binary64 (let* ((t_0 (/ (sin y) y)) (t_1 (/ (* x t_0) z))) (if (or (<= t_1 -10000.0) (not (<= t_1 1e-201))) t_1 (* t_0 (/ x z)))))
double code(double x, double y, double z) {
double t_0 = sin(y) / y;
double t_1 = (x * t_0) / z;
double tmp;
if ((t_1 <= -10000.0) || !(t_1 <= 1e-201)) {
tmp = t_1;
} else {
tmp = t_0 * (x / z);
}
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 = sin(y) / y
t_1 = (x * t_0) / z
if ((t_1 <= (-10000.0d0)) .or. (.not. (t_1 <= 1d-201))) then
tmp = t_1
else
tmp = t_0 * (x / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.sin(y) / y;
double t_1 = (x * t_0) / z;
double tmp;
if ((t_1 <= -10000.0) || !(t_1 <= 1e-201)) {
tmp = t_1;
} else {
tmp = t_0 * (x / z);
}
return tmp;
}
def code(x, y, z): t_0 = math.sin(y) / y t_1 = (x * t_0) / z tmp = 0 if (t_1 <= -10000.0) or not (t_1 <= 1e-201): tmp = t_1 else: tmp = t_0 * (x / z) return tmp
function code(x, y, z) t_0 = Float64(sin(y) / y) t_1 = Float64(Float64(x * t_0) / z) tmp = 0.0 if ((t_1 <= -10000.0) || !(t_1 <= 1e-201)) tmp = t_1; else tmp = Float64(t_0 * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = sin(y) / y; t_1 = (x * t_0) / z; tmp = 0.0; if ((t_1 <= -10000.0) || ~((t_1 <= 1e-201))) tmp = t_1; else tmp = t_0 * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x * t$95$0), $MachinePrecision] / z), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -10000.0], N[Not[LessEqual[t$95$1, 1e-201]], $MachinePrecision]], t$95$1, N[(t$95$0 * N[(x / z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sin y}{y}\\
t_1 := \frac{x \cdot t_0}{z}\\
\mathbf{if}\;t_1 \leq -10000 \lor \neg \left(t_1 \leq 10^{-201}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \frac{x}{z}\\
\end{array}
\end{array}
if (/.f64 (*.f64 x (/.f64 (sin.f64 y) y)) z) < -1e4 or 9.99999999999999946e-202 < (/.f64 (*.f64 x (/.f64 (sin.f64 y) y)) z) Initial program 99.8%
if -1e4 < (/.f64 (*.f64 x (/.f64 (sin.f64 y) y)) z) < 9.99999999999999946e-202Initial program 90.1%
associate-/l*92.7%
associate-/r/83.8%
Simplified83.8%
*-un-lft-identity83.8%
frac-times81.2%
clear-num82.1%
frac-times88.2%
*-commutative88.2%
times-frac99.9%
Applied egg-rr99.9%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (if (or (<= z -2.25e-82) (not (<= z 4.1e-51))) (* (/ (sin y) y) (/ x z)) (* x (/ (/ (sin y) z) y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -2.25e-82) || !(z <= 4.1e-51)) {
tmp = (sin(y) / y) * (x / z);
} else {
tmp = x * ((sin(y) / z) / y);
}
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) :: tmp
if ((z <= (-2.25d-82)) .or. (.not. (z <= 4.1d-51))) then
tmp = (sin(y) / y) * (x / z)
else
tmp = x * ((sin(y) / z) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -2.25e-82) || !(z <= 4.1e-51)) {
tmp = (Math.sin(y) / y) * (x / z);
} else {
tmp = x * ((Math.sin(y) / z) / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -2.25e-82) or not (z <= 4.1e-51): tmp = (math.sin(y) / y) * (x / z) else: tmp = x * ((math.sin(y) / z) / y) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -2.25e-82) || !(z <= 4.1e-51)) tmp = Float64(Float64(sin(y) / y) * Float64(x / z)); else tmp = Float64(x * Float64(Float64(sin(y) / z) / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -2.25e-82) || ~((z <= 4.1e-51))) tmp = (sin(y) / y) * (x / z); else tmp = x * ((sin(y) / z) / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -2.25e-82], N[Not[LessEqual[z, 4.1e-51]], $MachinePrecision]], N[(N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(N[Sin[y], $MachinePrecision] / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.25 \cdot 10^{-82} \lor \neg \left(z \leq 4.1 \cdot 10^{-51}\right):\\
\;\;\;\;\frac{\sin y}{y} \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{\sin y}{z}}{y}\\
\end{array}
\end{array}
if z < -2.2499999999999999e-82 or 4.09999999999999973e-51 < z Initial program 99.8%
associate-/l*91.8%
associate-/r/81.3%
Simplified81.3%
*-un-lft-identity81.3%
frac-times83.3%
clear-num83.9%
frac-times87.3%
*-commutative87.3%
times-frac99.8%
Applied egg-rr99.8%
if -2.2499999999999999e-82 < z < 4.09999999999999973e-51Initial program 87.6%
associate-/l*99.6%
associate-/r/99.6%
Simplified99.6%
clear-num99.5%
associate-/r/99.5%
associate-/r*99.5%
clear-num99.6%
Applied egg-rr99.6%
Final simplification99.7%
(FPCore (x y z) :precision binary64 (if (or (<= z -500000000000.0) (not (<= z 1.5e+21))) (* (/ (sin y) y) (/ x z)) (/ x (* y (/ z (sin y))))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -500000000000.0) || !(z <= 1.5e+21)) {
tmp = (sin(y) / y) * (x / z);
} else {
tmp = x / (y * (z / sin(y)));
}
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) :: tmp
if ((z <= (-500000000000.0d0)) .or. (.not. (z <= 1.5d+21))) then
tmp = (sin(y) / y) * (x / z)
else
tmp = x / (y * (z / sin(y)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -500000000000.0) || !(z <= 1.5e+21)) {
tmp = (Math.sin(y) / y) * (x / z);
} else {
tmp = x / (y * (z / Math.sin(y)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -500000000000.0) or not (z <= 1.5e+21): tmp = (math.sin(y) / y) * (x / z) else: tmp = x / (y * (z / math.sin(y))) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -500000000000.0) || !(z <= 1.5e+21)) tmp = Float64(Float64(sin(y) / y) * Float64(x / z)); else tmp = Float64(x / Float64(y * Float64(z / sin(y)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -500000000000.0) || ~((z <= 1.5e+21))) tmp = (sin(y) / y) * (x / z); else tmp = x / (y * (z / sin(y))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -500000000000.0], N[Not[LessEqual[z, 1.5e+21]], $MachinePrecision]], N[(N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(z / N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -500000000000 \lor \neg \left(z \leq 1.5 \cdot 10^{+21}\right):\\
\;\;\;\;\frac{\sin y}{y} \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \frac{z}{\sin y}}\\
\end{array}
\end{array}
if z < -5e11 or 1.5e21 < z Initial program 99.8%
associate-/l*89.0%
associate-/r/74.9%
Simplified74.9%
*-un-lft-identity74.9%
frac-times81.5%
clear-num82.3%
frac-times86.3%
*-commutative86.3%
times-frac99.8%
Applied egg-rr99.8%
if -5e11 < z < 1.5e21Initial program 91.4%
associate-/l*99.7%
associate-/r/99.7%
Simplified99.7%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (if (<= z -3.3e+81) (/ (sin y) (/ y (/ x z))) (if (<= z 1.15e+22) (/ x (* y (/ z (sin y)))) (* (/ (sin y) y) (/ x z)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -3.3e+81) {
tmp = sin(y) / (y / (x / z));
} else if (z <= 1.15e+22) {
tmp = x / (y * (z / sin(y)));
} else {
tmp = (sin(y) / y) * (x / z);
}
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) :: tmp
if (z <= (-3.3d+81)) then
tmp = sin(y) / (y / (x / z))
else if (z <= 1.15d+22) then
tmp = x / (y * (z / sin(y)))
else
tmp = (sin(y) / y) * (x / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -3.3e+81) {
tmp = Math.sin(y) / (y / (x / z));
} else if (z <= 1.15e+22) {
tmp = x / (y * (z / Math.sin(y)));
} else {
tmp = (Math.sin(y) / y) * (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3.3e+81: tmp = math.sin(y) / (y / (x / z)) elif z <= 1.15e+22: tmp = x / (y * (z / math.sin(y))) else: tmp = (math.sin(y) / y) * (x / z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3.3e+81) tmp = Float64(sin(y) / Float64(y / Float64(x / z))); elseif (z <= 1.15e+22) tmp = Float64(x / Float64(y * Float64(z / sin(y)))); else tmp = Float64(Float64(sin(y) / y) * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3.3e+81) tmp = sin(y) / (y / (x / z)); elseif (z <= 1.15e+22) tmp = x / (y * (z / sin(y))); else tmp = (sin(y) / y) * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3.3e+81], N[(N[Sin[y], $MachinePrecision] / N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.15e+22], N[(x / N[(y * N[(z / N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+81}:\\
\;\;\;\;\frac{\sin y}{\frac{y}{\frac{x}{z}}}\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{+22}:\\
\;\;\;\;\frac{x}{y \cdot \frac{z}{\sin y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin y}{y} \cdot \frac{x}{z}\\
\end{array}
\end{array}
if z < -3.3e81Initial program 99.8%
associate-*l/99.8%
times-frac91.1%
*-commutative91.1%
associate-*r/91.7%
*-commutative91.7%
Simplified91.7%
clear-num91.7%
un-div-inv91.7%
associate-/l*99.9%
Applied egg-rr99.9%
if -3.3e81 < z < 1.1500000000000001e22Initial program 92.0%
associate-/l*99.7%
associate-/r/99.7%
Simplified99.7%
if 1.1500000000000001e22 < z Initial program 99.8%
associate-/l*85.1%
associate-/r/64.2%
Simplified64.2%
*-un-lft-identity64.2%
frac-times72.5%
clear-num73.3%
frac-times82.0%
*-commutative82.0%
times-frac99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (if (<= y 1.42e-19) (/ x z) (* (sin y) (/ x (* y z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= 1.42e-19) {
tmp = x / z;
} else {
tmp = sin(y) * (x / (y * z));
}
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) :: tmp
if (y <= 1.42d-19) then
tmp = x / z
else
tmp = sin(y) * (x / (y * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 1.42e-19) {
tmp = x / z;
} else {
tmp = Math.sin(y) * (x / (y * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 1.42e-19: tmp = x / z else: tmp = math.sin(y) * (x / (y * z)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 1.42e-19) tmp = Float64(x / z); else tmp = Float64(sin(y) * Float64(x / Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 1.42e-19) tmp = x / z; else tmp = sin(y) * (x / (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 1.42e-19], N[(x / z), $MachinePrecision], N[(N[Sin[y], $MachinePrecision] * N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.42 \cdot 10^{-19}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\sin y \cdot \frac{x}{y \cdot z}\\
\end{array}
\end{array}
if y < 1.42e-19Initial program 97.3%
associate-*l/96.3%
times-frac82.4%
*-commutative82.4%
associate-*r/79.5%
*-commutative79.5%
Simplified79.5%
Taylor expanded in y around 0 71.1%
if 1.42e-19 < y Initial program 90.1%
associate-*l/94.3%
times-frac91.5%
*-commutative91.5%
associate-*r/91.5%
*-commutative91.5%
Simplified91.5%
Final simplification76.6%
(FPCore (x y z) :precision binary64 (* (/ (sin y) y) (/ x z)))
double code(double x, double y, double z) {
return (sin(y) / 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 = (sin(y) / y) * (x / z)
end function
public static double code(double x, double y, double z) {
return (Math.sin(y) / y) * (x / z);
}
def code(x, y, z): return (math.sin(y) / y) * (x / z)
function code(x, y, z) return Float64(Float64(sin(y) / y) * Float64(x / z)) end
function tmp = code(x, y, z) tmp = (sin(y) / y) * (x / z); end
code[x_, y_, z_] := N[(N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin y}{y} \cdot \frac{x}{z}
\end{array}
Initial program 95.4%
associate-/l*94.6%
associate-/r/88.0%
Simplified88.0%
*-un-lft-identity88.0%
frac-times83.3%
clear-num83.7%
frac-times84.8%
*-commutative84.8%
times-frac95.8%
Applied egg-rr95.8%
Final simplification95.8%
(FPCore (x y z) :precision binary64 (if (<= y 275000000.0) (* (/ x z) (+ 1.0 (* -0.16666666666666666 (* y y)))) (* (/ x (* y z)) (/ 6.0 y))))
double code(double x, double y, double z) {
double tmp;
if (y <= 275000000.0) {
tmp = (x / z) * (1.0 + (-0.16666666666666666 * (y * y)));
} else {
tmp = (x / (y * z)) * (6.0 / y);
}
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) :: tmp
if (y <= 275000000.0d0) then
tmp = (x / z) * (1.0d0 + ((-0.16666666666666666d0) * (y * y)))
else
tmp = (x / (y * z)) * (6.0d0 / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 275000000.0) {
tmp = (x / z) * (1.0 + (-0.16666666666666666 * (y * y)));
} else {
tmp = (x / (y * z)) * (6.0 / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 275000000.0: tmp = (x / z) * (1.0 + (-0.16666666666666666 * (y * y))) else: tmp = (x / (y * z)) * (6.0 / y) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 275000000.0) tmp = Float64(Float64(x / z) * Float64(1.0 + Float64(-0.16666666666666666 * Float64(y * y)))); else tmp = Float64(Float64(x / Float64(y * z)) * Float64(6.0 / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 275000000.0) tmp = (x / z) * (1.0 + (-0.16666666666666666 * (y * y))); else tmp = (x / (y * z)) * (6.0 / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 275000000.0], N[(N[(x / z), $MachinePrecision] * N[(1.0 + N[(-0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision] * N[(6.0 / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 275000000:\\
\;\;\;\;\frac{x}{z} \cdot \left(1 + -0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot z} \cdot \frac{6}{y}\\
\end{array}
\end{array}
if y < 2.75e8Initial program 97.4%
associate-/l*96.0%
associate-/r/87.2%
Simplified87.2%
*-un-lft-identity87.2%
frac-times81.5%
clear-num82.0%
frac-times83.0%
*-commutative83.0%
times-frac96.5%
Applied egg-rr96.5%
Taylor expanded in y around 0 70.8%
unpow270.8%
Simplified70.8%
if 2.75e8 < y Initial program 89.1%
associate-/l*90.4%
associate-/r/90.5%
Simplified90.5%
Taylor expanded in y around 0 32.6%
Taylor expanded in y around inf 32.6%
associate-*r/32.6%
*-commutative32.6%
unpow232.6%
Simplified32.6%
*-commutative32.6%
associate-*r*32.6%
times-frac32.7%
*-commutative32.7%
Applied egg-rr32.7%
Final simplification61.6%
(FPCore (x y z) :precision binary64 (if (<= y 275000000.0) (* (/ x z) (+ 1.0 (* -0.16666666666666666 (* y y)))) (* (/ 1.0 (* y z)) (/ (* x 6.0) y))))
double code(double x, double y, double z) {
double tmp;
if (y <= 275000000.0) {
tmp = (x / z) * (1.0 + (-0.16666666666666666 * (y * y)));
} else {
tmp = (1.0 / (y * z)) * ((x * 6.0) / y);
}
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) :: tmp
if (y <= 275000000.0d0) then
tmp = (x / z) * (1.0d0 + ((-0.16666666666666666d0) * (y * y)))
else
tmp = (1.0d0 / (y * z)) * ((x * 6.0d0) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 275000000.0) {
tmp = (x / z) * (1.0 + (-0.16666666666666666 * (y * y)));
} else {
tmp = (1.0 / (y * z)) * ((x * 6.0) / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 275000000.0: tmp = (x / z) * (1.0 + (-0.16666666666666666 * (y * y))) else: tmp = (1.0 / (y * z)) * ((x * 6.0) / y) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 275000000.0) tmp = Float64(Float64(x / z) * Float64(1.0 + Float64(-0.16666666666666666 * Float64(y * y)))); else tmp = Float64(Float64(1.0 / Float64(y * z)) * Float64(Float64(x * 6.0) / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 275000000.0) tmp = (x / z) * (1.0 + (-0.16666666666666666 * (y * y))); else tmp = (1.0 / (y * z)) * ((x * 6.0) / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 275000000.0], N[(N[(x / z), $MachinePrecision] * N[(1.0 + N[(-0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(y * z), $MachinePrecision]), $MachinePrecision] * N[(N[(x * 6.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 275000000:\\
\;\;\;\;\frac{x}{z} \cdot \left(1 + -0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y \cdot z} \cdot \frac{x \cdot 6}{y}\\
\end{array}
\end{array}
if y < 2.75e8Initial program 97.4%
associate-/l*96.0%
associate-/r/87.2%
Simplified87.2%
*-un-lft-identity87.2%
frac-times81.5%
clear-num82.0%
frac-times83.0%
*-commutative83.0%
times-frac96.5%
Applied egg-rr96.5%
Taylor expanded in y around 0 70.8%
unpow270.8%
Simplified70.8%
if 2.75e8 < y Initial program 89.1%
associate-/l*90.4%
associate-/r/90.5%
Simplified90.5%
Taylor expanded in y around 0 32.6%
Taylor expanded in y around inf 32.6%
associate-*r/32.6%
*-commutative32.6%
unpow232.6%
Simplified32.6%
*-un-lft-identity32.6%
associate-*r*32.6%
times-frac32.7%
*-commutative32.7%
*-commutative32.7%
Applied egg-rr32.7%
Final simplification61.6%
(FPCore (x y z) :precision binary64 (if (<= y 1.75e+31) (/ x z) (* 6.0 (/ x (* z (* y y))))))
double code(double x, double y, double z) {
double tmp;
if (y <= 1.75e+31) {
tmp = x / z;
} else {
tmp = 6.0 * (x / (z * (y * y)));
}
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) :: tmp
if (y <= 1.75d+31) then
tmp = x / z
else
tmp = 6.0d0 * (x / (z * (y * y)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 1.75e+31) {
tmp = x / z;
} else {
tmp = 6.0 * (x / (z * (y * y)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 1.75e+31: tmp = x / z else: tmp = 6.0 * (x / (z * (y * y))) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 1.75e+31) tmp = Float64(x / z); else tmp = Float64(6.0 * Float64(x / Float64(z * Float64(y * y)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 1.75e+31) tmp = x / z; else tmp = 6.0 * (x / (z * (y * y))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 1.75e+31], N[(x / z), $MachinePrecision], N[(6.0 * N[(x / N[(z * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.75 \cdot 10^{+31}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \frac{x}{z \cdot \left(y \cdot y\right)}\\
\end{array}
\end{array}
if y < 1.75e31Initial program 97.4%
associate-*l/96.1%
times-frac83.5%
*-commutative83.5%
associate-*r/80.8%
*-commutative80.8%
Simplified80.8%
Taylor expanded in y around 0 70.4%
if 1.75e31 < y Initial program 87.9%
associate-/l*89.4%
associate-/r/89.5%
Simplified89.5%
Taylor expanded in y around 0 32.0%
Taylor expanded in y around inf 32.0%
*-commutative32.0%
unpow232.0%
Simplified32.0%
Final simplification62.0%
(FPCore (x y z) :precision binary64 (if (<= y 2.4) (/ x z) (* (/ x (* y z)) (/ 6.0 y))))
double code(double x, double y, double z) {
double tmp;
if (y <= 2.4) {
tmp = x / z;
} else {
tmp = (x / (y * z)) * (6.0 / y);
}
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) :: tmp
if (y <= 2.4d0) then
tmp = x / z
else
tmp = (x / (y * z)) * (6.0d0 / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 2.4) {
tmp = x / z;
} else {
tmp = (x / (y * z)) * (6.0 / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 2.4: tmp = x / z else: tmp = (x / (y * z)) * (6.0 / y) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 2.4) tmp = Float64(x / z); else tmp = Float64(Float64(x / Float64(y * z)) * Float64(6.0 / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 2.4) tmp = x / z; else tmp = (x / (y * z)) * (6.0 / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 2.4], N[(x / z), $MachinePrecision], N[(N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision] * N[(6.0 / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.4:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot z} \cdot \frac{6}{y}\\
\end{array}
\end{array}
if y < 2.39999999999999991Initial program 97.4%
associate-*l/96.4%
times-frac82.9%
*-commutative82.9%
associate-*r/80.0%
*-commutative80.0%
Simplified80.0%
Taylor expanded in y around 0 71.7%
if 2.39999999999999991 < y Initial program 89.4%
associate-/l*90.7%
associate-/r/90.8%
Simplified90.8%
Taylor expanded in y around 0 33.2%
Taylor expanded in y around inf 33.2%
associate-*r/33.2%
*-commutative33.2%
unpow233.2%
Simplified33.2%
*-commutative33.2%
associate-*r*33.2%
times-frac33.3%
*-commutative33.3%
Applied egg-rr33.3%
Final simplification62.1%
(FPCore (x y z) :precision binary64 (/ x (+ z (* y (* y (* z 0.16666666666666666))))))
double code(double x, double y, double z) {
return x / (z + (y * (y * (z * 0.16666666666666666))));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x / (z + (y * (y * (z * 0.16666666666666666d0))))
end function
public static double code(double x, double y, double z) {
return x / (z + (y * (y * (z * 0.16666666666666666))));
}
def code(x, y, z): return x / (z + (y * (y * (z * 0.16666666666666666))))
function code(x, y, z) return Float64(x / Float64(z + Float64(y * Float64(y * Float64(z * 0.16666666666666666))))) end
function tmp = code(x, y, z) tmp = x / (z + (y * (y * (z * 0.16666666666666666)))); end
code[x_, y_, z_] := N[(x / N[(z + N[(y * N[(y * N[(z * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{z + y \cdot \left(y \cdot \left(z \cdot 0.16666666666666666\right)\right)}
\end{array}
Initial program 95.4%
associate-/l*94.6%
associate-/r/88.0%
Simplified88.0%
Taylor expanded in y around 0 60.2%
*-commutative60.2%
distribute-rgt-in60.2%
*-commutative60.2%
associate-*l*60.2%
*-commutative60.2%
Applied egg-rr60.2%
Taylor expanded in y around 0 66.9%
Final simplification66.9%
(FPCore (x y z) :precision binary64 (if (<= y 7e-9) (/ x z) (* (/ x y) (/ y z))))
double code(double x, double y, double z) {
double tmp;
if (y <= 7e-9) {
tmp = x / z;
} else {
tmp = (x / y) * (y / z);
}
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) :: tmp
if (y <= 7d-9) then
tmp = x / z
else
tmp = (x / y) * (y / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 7e-9) {
tmp = x / z;
} else {
tmp = (x / y) * (y / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 7e-9: tmp = x / z else: tmp = (x / y) * (y / z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 7e-9) tmp = Float64(x / z); else tmp = Float64(Float64(x / y) * Float64(y / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 7e-9) tmp = x / z; else tmp = (x / y) * (y / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 7e-9], N[(x / z), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7 \cdot 10^{-9}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{y}{z}\\
\end{array}
\end{array}
if y < 6.9999999999999998e-9Initial program 97.3%
associate-*l/96.4%
times-frac82.7%
*-commutative82.7%
associate-*r/79.8%
*-commutative79.8%
Simplified79.8%
Taylor expanded in y around 0 71.6%
if 6.9999999999999998e-9 < y Initial program 89.7%
associate-*r/89.6%
associate-/l/91.1%
*-commutative91.1%
times-frac89.7%
Simplified89.7%
Taylor expanded in y around 0 25.7%
Final simplification59.8%
(FPCore (x y z) :precision binary64 (if (<= y 1e-20) (/ x z) (/ x (/ (* y z) y))))
double code(double x, double y, double z) {
double tmp;
if (y <= 1e-20) {
tmp = x / z;
} else {
tmp = x / ((y * z) / y);
}
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) :: tmp
if (y <= 1d-20) then
tmp = x / z
else
tmp = x / ((y * z) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 1e-20) {
tmp = x / z;
} else {
tmp = x / ((y * z) / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 1e-20: tmp = x / z else: tmp = x / ((y * z) / y) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 1e-20) tmp = Float64(x / z); else tmp = Float64(x / Float64(Float64(y * z) / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 1e-20) tmp = x / z; else tmp = x / ((y * z) / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 1e-20], N[(x / z), $MachinePrecision], N[(x / N[(N[(y * z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 10^{-20}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{y \cdot z}{y}}\\
\end{array}
\end{array}
if y < 9.99999999999999945e-21Initial program 97.3%
associate-*l/96.3%
times-frac82.4%
*-commutative82.4%
associate-*r/79.5%
*-commutative79.5%
Simplified79.5%
Taylor expanded in y around 0 71.1%
if 9.99999999999999945e-21 < y Initial program 90.1%
associate-/l*91.3%
associate-/r/91.4%
Simplified91.4%
Taylor expanded in y around 0 26.1%
associate-*l/33.3%
*-commutative33.3%
Applied egg-rr33.3%
Final simplification61.0%
(FPCore (x y z) :precision binary64 (if (<= y 7e-9) (/ x z) (/ y (* z (/ y x)))))
double code(double x, double y, double z) {
double tmp;
if (y <= 7e-9) {
tmp = x / z;
} else {
tmp = y / (z * (y / x));
}
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) :: tmp
if (y <= 7d-9) then
tmp = x / z
else
tmp = y / (z * (y / x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 7e-9) {
tmp = x / z;
} else {
tmp = y / (z * (y / x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 7e-9: tmp = x / z else: tmp = y / (z * (y / x)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 7e-9) tmp = Float64(x / z); else tmp = Float64(y / Float64(z * Float64(y / x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 7e-9) tmp = x / z; else tmp = y / (z * (y / x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 7e-9], N[(x / z), $MachinePrecision], N[(y / N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7 \cdot 10^{-9}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot \frac{y}{x}}\\
\end{array}
\end{array}
if y < 6.9999999999999998e-9Initial program 97.3%
associate-*l/96.4%
times-frac82.7%
*-commutative82.7%
associate-*r/79.8%
*-commutative79.8%
Simplified79.8%
Taylor expanded in y around 0 71.6%
if 6.9999999999999998e-9 < y Initial program 89.7%
associate-*r/89.6%
associate-/l/91.1%
*-commutative91.1%
times-frac89.7%
Simplified89.7%
Taylor expanded in y around 0 25.7%
*-commutative25.7%
clear-num27.1%
frac-times34.0%
*-un-lft-identity34.0%
Applied egg-rr34.0%
Final simplification61.9%
(FPCore (x y z) :precision binary64 (if (<= y 2e-14) (/ x z) (/ y (/ z (/ x y)))))
double code(double x, double y, double z) {
double tmp;
if (y <= 2e-14) {
tmp = x / z;
} else {
tmp = y / (z / (x / y));
}
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) :: tmp
if (y <= 2d-14) then
tmp = x / z
else
tmp = y / (z / (x / y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 2e-14) {
tmp = x / z;
} else {
tmp = y / (z / (x / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 2e-14: tmp = x / z else: tmp = y / (z / (x / y)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 2e-14) tmp = Float64(x / z); else tmp = Float64(y / Float64(z / Float64(x / y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 2e-14) tmp = x / z; else tmp = y / (z / (x / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 2e-14], N[(x / z), $MachinePrecision], N[(y / N[(z / N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2 \cdot 10^{-14}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{z}{\frac{x}{y}}}\\
\end{array}
\end{array}
if y < 2e-14Initial program 97.3%
associate-*l/96.3%
times-frac82.4%
*-commutative82.4%
associate-*r/79.5%
*-commutative79.5%
Simplified79.5%
Taylor expanded in y around 0 71.1%
if 2e-14 < y Initial program 90.1%
associate-*r/90.1%
associate-/l/91.5%
*-commutative91.5%
times-frac90.2%
Simplified90.2%
Taylor expanded in y around 0 28.9%
associate-*l/31.0%
associate-/l*36.8%
Applied egg-rr36.8%
Final simplification61.9%
(FPCore (x y z) :precision binary64 (if (<= y 2e-14) (/ x z) (/ y (/ (* y z) x))))
double code(double x, double y, double z) {
double tmp;
if (y <= 2e-14) {
tmp = x / z;
} else {
tmp = y / ((y * z) / x);
}
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) :: tmp
if (y <= 2d-14) then
tmp = x / z
else
tmp = y / ((y * z) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 2e-14) {
tmp = x / z;
} else {
tmp = y / ((y * z) / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 2e-14: tmp = x / z else: tmp = y / ((y * z) / x) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 2e-14) tmp = Float64(x / z); else tmp = Float64(y / Float64(Float64(y * z) / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 2e-14) tmp = x / z; else tmp = y / ((y * z) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 2e-14], N[(x / z), $MachinePrecision], N[(y / N[(N[(y * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2 \cdot 10^{-14}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{y \cdot z}{x}}\\
\end{array}
\end{array}
if y < 2e-14Initial program 97.3%
associate-*l/96.3%
times-frac82.4%
*-commutative82.4%
associate-*r/79.5%
*-commutative79.5%
Simplified79.5%
Taylor expanded in y around 0 71.1%
if 2e-14 < y Initial program 90.1%
associate-*r/90.1%
associate-/l/91.5%
*-commutative91.5%
times-frac90.2%
Simplified90.2%
Taylor expanded in y around 0 28.9%
frac-times32.9%
associate-/l*36.7%
*-commutative36.7%
Applied egg-rr36.7%
Final simplification61.9%
(FPCore (x y z) :precision binary64 (/ 1.0 (/ z x)))
double code(double x, double y, double z) {
return 1.0 / (z / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 1.0d0 / (z / x)
end function
public static double code(double x, double y, double z) {
return 1.0 / (z / x);
}
def code(x, y, z): return 1.0 / (z / x)
function code(x, y, z) return Float64(1.0 / Float64(z / x)) end
function tmp = code(x, y, z) tmp = 1.0 / (z / x); end
code[x_, y_, z_] := N[(1.0 / N[(z / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\frac{z}{x}}
\end{array}
Initial program 95.4%
associate-/l*94.6%
associate-/r/88.0%
Simplified88.0%
clear-num87.8%
associate-/r/87.8%
associate-/r*88.3%
clear-num88.8%
Applied egg-rr88.8%
Taylor expanded in y around 0 58.9%
associate-*l/59.1%
*-un-lft-identity59.1%
clear-num59.1%
Applied egg-rr59.1%
Final simplification59.1%
(FPCore (x y z) :precision binary64 (/ x z))
double code(double x, double y, double z) {
return 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 = x / z
end function
public static double code(double x, double y, double z) {
return x / z;
}
def code(x, y, z): return x / z
function code(x, y, z) return Float64(x / z) end
function tmp = code(x, y, z) tmp = x / z; end
code[x_, y_, z_] := N[(x / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{z}
\end{array}
Initial program 95.4%
associate-*l/95.8%
times-frac84.8%
*-commutative84.8%
associate-*r/82.7%
*-commutative82.7%
Simplified82.7%
Taylor expanded in y around 0 59.1%
Final simplification59.1%
(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 2023202
(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))