
(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 11 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))) (if (<= z 5e-54) (/ x (/ z t_0)) (/ (* x t_0) z))))
double code(double x, double y, double z) {
double t_0 = sin(y) / y;
double tmp;
if (z <= 5e-54) {
tmp = x / (z / t_0);
} else {
tmp = (x * t_0) / 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) :: tmp
t_0 = sin(y) / y
if (z <= 5d-54) then
tmp = x / (z / t_0)
else
tmp = (x * t_0) / 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 tmp;
if (z <= 5e-54) {
tmp = x / (z / t_0);
} else {
tmp = (x * t_0) / z;
}
return tmp;
}
def code(x, y, z): t_0 = math.sin(y) / y tmp = 0 if z <= 5e-54: tmp = x / (z / t_0) else: tmp = (x * t_0) / z return tmp
function code(x, y, z) t_0 = Float64(sin(y) / y) tmp = 0.0 if (z <= 5e-54) tmp = Float64(x / Float64(z / t_0)); else tmp = Float64(Float64(x * t_0) / z); end return tmp end
function tmp_2 = code(x, y, z) t_0 = sin(y) / y; tmp = 0.0; if (z <= 5e-54) tmp = x / (z / t_0); else tmp = (x * t_0) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[z, 5e-54], N[(x / N[(z / t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(x * t$95$0), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sin y}{y}\\
\mathbf{if}\;z \leq 5 \cdot 10^{-54}:\\
\;\;\;\;\frac{x}{\frac{z}{t_0}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot t_0}{z}\\
\end{array}
\end{array}
if z < 5.00000000000000015e-54Initial program 94.5%
associate-/l*98.8%
Simplified98.8%
if 5.00000000000000015e-54 < z Initial program 99.8%
Final simplification99.1%
(FPCore (x y z) :precision binary64 (if (<= y 7.2e-21) (/ x z) (* (sin y) (/ x (* z y)))))
double code(double x, double y, double z) {
double tmp;
if (y <= 7.2e-21) {
tmp = x / z;
} else {
tmp = sin(y) * (x / (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 <= 7.2d-21) then
tmp = x / z
else
tmp = sin(y) * (x / (z * y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 7.2e-21) {
tmp = x / z;
} else {
tmp = Math.sin(y) * (x / (z * y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 7.2e-21: tmp = x / z else: tmp = math.sin(y) * (x / (z * y)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 7.2e-21) tmp = Float64(x / z); else tmp = Float64(sin(y) * Float64(x / Float64(z * y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 7.2e-21) tmp = x / z; else tmp = sin(y) * (x / (z * y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 7.2e-21], N[(x / z), $MachinePrecision], N[(N[Sin[y], $MachinePrecision] * N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7.2 \cdot 10^{-21}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\sin y \cdot \frac{x}{z \cdot y}\\
\end{array}
\end{array}
if y < 7.19999999999999979e-21Initial program 98.8%
Taylor expanded in y around 0 76.0%
if 7.19999999999999979e-21 < y Initial program 89.7%
associate-*l/91.3%
times-frac92.7%
*-commutative92.7%
associate-*r/92.7%
*-commutative92.7%
Simplified92.7%
Final simplification81.2%
(FPCore (x y z) :precision binary64 (if (<= y 1.8e-8) (/ x z) (* (/ (sin y) z) (/ x y))))
double code(double x, double y, double z) {
double tmp;
if (y <= 1.8e-8) {
tmp = x / z;
} else {
tmp = (sin(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 <= 1.8d-8) then
tmp = x / z
else
tmp = (sin(y) / z) * (x / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 1.8e-8) {
tmp = x / z;
} else {
tmp = (Math.sin(y) / z) * (x / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 1.8e-8: tmp = x / z else: tmp = (math.sin(y) / z) * (x / y) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 1.8e-8) tmp = Float64(x / z); else tmp = Float64(Float64(sin(y) / z) * Float64(x / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 1.8e-8) tmp = x / z; else tmp = (sin(y) / z) * (x / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 1.8e-8], N[(x / z), $MachinePrecision], N[(N[(N[Sin[y], $MachinePrecision] / z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.8 \cdot 10^{-8}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin y}{z} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if y < 1.79999999999999991e-8Initial program 98.8%
Taylor expanded in y around 0 76.4%
if 1.79999999999999991e-8 < y Initial program 89.3%
associate-*r/89.4%
associate-/l/92.4%
*-commutative92.4%
times-frac89.4%
Simplified89.4%
Final simplification80.3%
(FPCore (x y z) :precision binary64 (/ x (* z (/ y (sin y)))))
double code(double x, double y, double z) {
return x / (z * (y / sin(y)));
}
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 / sin(y)))
end function
public static double code(double x, double y, double z) {
return x / (z * (y / Math.sin(y)));
}
def code(x, y, z): return x / (z * (y / math.sin(y)))
function code(x, y, z) return Float64(x / Float64(z * Float64(y / sin(y)))) end
function tmp = code(x, y, z) tmp = x / (z * (y / sin(y))); end
code[x_, y_, z_] := N[(x / N[(z * N[(y / N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{z \cdot \frac{y}{\sin y}}
\end{array}
Initial program 96.0%
associate-/l*95.4%
Simplified95.4%
clear-num95.4%
associate-/r/95.5%
clear-num95.4%
Applied egg-rr95.4%
Final simplification95.4%
(FPCore (x y z) :precision binary64 (/ x (/ z (/ (sin y) y))))
double code(double x, double y, double z) {
return x / (z / (sin(y) / y));
}
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 / (sin(y) / y))
end function
public static double code(double x, double y, double z) {
return x / (z / (Math.sin(y) / y));
}
def code(x, y, z): return x / (z / (math.sin(y) / y))
function code(x, y, z) return Float64(x / Float64(z / Float64(sin(y) / y))) end
function tmp = code(x, y, z) tmp = x / (z / (sin(y) / y)); end
code[x_, y_, z_] := N[(x / N[(z / N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\frac{z}{\frac{\sin y}{y}}}
\end{array}
Initial program 96.0%
associate-/l*95.4%
Simplified95.4%
Final simplification95.4%
(FPCore (x y z) :precision binary64 (if (<= y 3.2e+24) (/ x (/ z (+ 1.0 (* -0.16666666666666666 (* y y))))) (/ y (* z (/ y x)))))
double code(double x, double y, double z) {
double tmp;
if (y <= 3.2e+24) {
tmp = x / (z / (1.0 + (-0.16666666666666666 * (y * y))));
} 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 <= 3.2d+24) then
tmp = x / (z / (1.0d0 + ((-0.16666666666666666d0) * (y * y))))
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 <= 3.2e+24) {
tmp = x / (z / (1.0 + (-0.16666666666666666 * (y * y))));
} else {
tmp = y / (z * (y / x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 3.2e+24: tmp = x / (z / (1.0 + (-0.16666666666666666 * (y * y)))) else: tmp = y / (z * (y / x)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 3.2e+24) tmp = Float64(x / Float64(z / Float64(1.0 + Float64(-0.16666666666666666 * Float64(y * y))))); 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 <= 3.2e+24) tmp = x / (z / (1.0 + (-0.16666666666666666 * (y * y)))); else tmp = y / (z * (y / x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 3.2e+24], N[(x / N[(z / N[(1.0 + N[(-0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.2 \cdot 10^{+24}:\\
\;\;\;\;\frac{x}{\frac{z}{1 + -0.16666666666666666 \cdot \left(y \cdot y\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot \frac{y}{x}}\\
\end{array}
\end{array}
if y < 3.1999999999999997e24Initial program 98.9%
associate-/l*96.9%
Simplified96.9%
Taylor expanded in y around 0 71.2%
unpow271.2%
Simplified71.2%
if 3.1999999999999997e24 < y Initial program 88.1%
associate-*r/88.2%
associate-/l/91.6%
*-commutative91.6%
times-frac88.1%
Simplified88.1%
Taylor expanded in y around 0 22.4%
*-commutative22.4%
clear-num22.4%
frac-times34.3%
*-un-lft-identity34.3%
Applied egg-rr34.3%
Final simplification61.4%
(FPCore (x y z) :precision binary64 (/ x (* z (+ 1.0 (* (* y y) 0.16666666666666666)))))
double code(double x, double y, double z) {
return x / (z * (1.0 + ((y * y) * 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 * (1.0d0 + ((y * y) * 0.16666666666666666d0)))
end function
public static double code(double x, double y, double z) {
return x / (z * (1.0 + ((y * y) * 0.16666666666666666)));
}
def code(x, y, z): return x / (z * (1.0 + ((y * y) * 0.16666666666666666)))
function code(x, y, z) return Float64(x / Float64(z * Float64(1.0 + Float64(Float64(y * y) * 0.16666666666666666)))) end
function tmp = code(x, y, z) tmp = x / (z * (1.0 + ((y * y) * 0.16666666666666666))); end
code[x_, y_, z_] := N[(x / N[(z * N[(1.0 + N[(N[(y * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{z \cdot \left(1 + \left(y \cdot y\right) \cdot 0.16666666666666666\right)}
\end{array}
Initial program 96.0%
associate-/l*95.4%
Simplified95.4%
clear-num95.4%
associate-/r/95.5%
clear-num95.4%
Applied egg-rr95.4%
Taylor expanded in y around 0 66.5%
*-commutative66.5%
unpow266.5%
Simplified66.5%
Final simplification66.5%
(FPCore (x y z) :precision binary64 (if (<= y 4.8e+146) (/ x z) (* (/ x y) (/ y z))))
double code(double x, double y, double z) {
double tmp;
if (y <= 4.8e+146) {
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 <= 4.8d+146) 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 <= 4.8e+146) {
tmp = x / z;
} else {
tmp = (x / y) * (y / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 4.8e+146: tmp = x / z else: tmp = (x / y) * (y / z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 4.8e+146) 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 <= 4.8e+146) tmp = x / z; else tmp = (x / y) * (y / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 4.8e+146], N[(x / z), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.8 \cdot 10^{+146}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{y}{z}\\
\end{array}
\end{array}
if y < 4.8000000000000004e146Initial program 98.1%
Taylor expanded in y around 0 66.5%
if 4.8000000000000004e146 < y Initial program 84.5%
associate-*r/84.6%
associate-/l/92.9%
*-commutative92.9%
times-frac84.5%
Simplified84.5%
Taylor expanded in y around 0 25.1%
Final simplification60.2%
(FPCore (x y z) :precision binary64 (if (<= y 2e+53) (/ x z) (/ x (/ (* z y) y))))
double code(double x, double y, double z) {
double tmp;
if (y <= 2e+53) {
tmp = x / z;
} else {
tmp = 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 <= 2d+53) then
tmp = x / z
else
tmp = x / ((z * y) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 2e+53) {
tmp = x / z;
} else {
tmp = x / ((z * y) / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 2e+53: tmp = x / z else: tmp = x / ((z * y) / y) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 2e+53) tmp = Float64(x / z); else tmp = Float64(x / Float64(Float64(z * y) / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 2e+53) tmp = x / z; else tmp = x / ((z * y) / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 2e+53], N[(x / z), $MachinePrecision], N[(x / N[(N[(z * y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2 \cdot 10^{+53}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z \cdot y}{y}}\\
\end{array}
\end{array}
if y < 2e53Initial program 98.9%
Taylor expanded in y around 0 72.5%
if 2e53 < y Initial program 86.6%
associate-/l*92.0%
associate-/r/92.0%
Simplified92.0%
Taylor expanded in y around 0 15.3%
*-commutative15.3%
associate-*r/26.4%
Applied egg-rr26.4%
Final simplification61.7%
(FPCore (x y z) :precision binary64 (if (<= y 5000.0) (/ x z) (/ y (* z (/ y x)))))
double code(double x, double y, double z) {
double tmp;
if (y <= 5000.0) {
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 <= 5000.0d0) 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 <= 5000.0) {
tmp = x / z;
} else {
tmp = y / (z * (y / x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 5000.0: tmp = x / z else: tmp = y / (z * (y / x)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 5000.0) 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 <= 5000.0) tmp = x / z; else tmp = y / (z * (y / x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 5000.0], N[(x / z), $MachinePrecision], N[(y / N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5000:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot \frac{y}{x}}\\
\end{array}
\end{array}
if y < 5e3Initial program 98.8%
Taylor expanded in y around 0 76.4%
if 5e3 < y Initial program 89.3%
associate-*r/89.4%
associate-/l/92.4%
*-commutative92.4%
times-frac89.4%
Simplified89.4%
Taylor expanded in y around 0 21.7%
*-commutative21.7%
clear-num21.6%
frac-times32.3%
*-un-lft-identity32.3%
Applied egg-rr32.3%
Final simplification63.3%
(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 96.0%
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 2023200
(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))