
(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 17 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 (<= t_0 1e-227) (/ (* t_0 x) z) (/ x (/ 1.0 (/ t_0 z))))))
double code(double x, double y, double z) {
double t_0 = sin(y) / y;
double tmp;
if (t_0 <= 1e-227) {
tmp = (t_0 * x) / z;
} else {
tmp = x / (1.0 / (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 (t_0 <= 1d-227) then
tmp = (t_0 * x) / z
else
tmp = x / (1.0d0 / (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 (t_0 <= 1e-227) {
tmp = (t_0 * x) / z;
} else {
tmp = x / (1.0 / (t_0 / z));
}
return tmp;
}
def code(x, y, z): t_0 = math.sin(y) / y tmp = 0 if t_0 <= 1e-227: tmp = (t_0 * x) / z else: tmp = x / (1.0 / (t_0 / z)) return tmp
function code(x, y, z) t_0 = Float64(sin(y) / y) tmp = 0.0 if (t_0 <= 1e-227) tmp = Float64(Float64(t_0 * x) / z); else tmp = Float64(x / Float64(1.0 / Float64(t_0 / z))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = sin(y) / y; tmp = 0.0; if (t_0 <= 1e-227) tmp = (t_0 * x) / z; else tmp = x / (1.0 / (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[t$95$0, 1e-227], N[(N[(t$95$0 * x), $MachinePrecision] / z), $MachinePrecision], N[(x / N[(1.0 / N[(t$95$0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sin y}{y}\\
\mathbf{if}\;t_0 \leq 10^{-227}:\\
\;\;\;\;\frac{t_0 \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{1}{\frac{t_0}{z}}}\\
\end{array}
\end{array}
if (/.f64 (sin.f64 y) y) < 9.99999999999999945e-228Initial program 99.0%
if 9.99999999999999945e-228 < (/.f64 (sin.f64 y) y) Initial program 96.6%
associate-/l*99.3%
associate-/r/84.3%
Simplified84.3%
associate-/r/99.3%
clear-num99.1%
Applied egg-rr99.1%
Final simplification99.1%
(FPCore (x y z) :precision binary64 (if (or (<= y -0.00152) (not (<= y 2.55e-11))) (* (sin y) (/ x (* y z))) (/ x z)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -0.00152) || !(y <= 2.55e-11)) {
tmp = sin(y) * (x / (y * z));
} else {
tmp = 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 ((y <= (-0.00152d0)) .or. (.not. (y <= 2.55d-11))) then
tmp = sin(y) * (x / (y * z))
else
tmp = x / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -0.00152) || !(y <= 2.55e-11)) {
tmp = Math.sin(y) * (x / (y * z));
} else {
tmp = x / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -0.00152) or not (y <= 2.55e-11): tmp = math.sin(y) * (x / (y * z)) else: tmp = x / z return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -0.00152) || !(y <= 2.55e-11)) tmp = Float64(sin(y) * Float64(x / Float64(y * z))); else tmp = Float64(x / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -0.00152) || ~((y <= 2.55e-11))) tmp = sin(y) * (x / (y * z)); else tmp = x / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -0.00152], N[Not[LessEqual[y, 2.55e-11]], $MachinePrecision]], N[(N[Sin[y], $MachinePrecision] * N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00152 \lor \neg \left(y \leq 2.55 \cdot 10^{-11}\right):\\
\;\;\;\;\sin y \cdot \frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z}\\
\end{array}
\end{array}
if y < -0.0015200000000000001 or 2.54999999999999992e-11 < y Initial program 95.2%
associate-*l/92.7%
times-frac92.4%
*-commutative92.4%
associate-*r/92.5%
*-commutative92.5%
Simplified92.5%
if -0.0015200000000000001 < y < 2.54999999999999992e-11Initial program 100.0%
associate-*l/100.0%
times-frac78.8%
*-commutative78.8%
associate-*r/76.4%
*-commutative76.4%
Simplified76.4%
Taylor expanded in y around 0 100.0%
Final simplification96.0%
(FPCore (x y z) :precision binary64 (if (<= y -0.00152) (* (/ (sin y) z) (/ x y)) (if (<= y 2.55e-11) (/ x z) (* (sin y) (/ x (* y z))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -0.00152) {
tmp = (sin(y) / z) * (x / y);
} else if (y <= 2.55e-11) {
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 <= (-0.00152d0)) then
tmp = (sin(y) / z) * (x / y)
else if (y <= 2.55d-11) 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 <= -0.00152) {
tmp = (Math.sin(y) / z) * (x / y);
} else if (y <= 2.55e-11) {
tmp = x / z;
} else {
tmp = Math.sin(y) * (x / (y * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -0.00152: tmp = (math.sin(y) / z) * (x / y) elif y <= 2.55e-11: tmp = x / z else: tmp = math.sin(y) * (x / (y * z)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -0.00152) tmp = Float64(Float64(sin(y) / z) * Float64(x / y)); elseif (y <= 2.55e-11) 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 <= -0.00152) tmp = (sin(y) / z) * (x / y); elseif (y <= 2.55e-11) tmp = x / z; else tmp = sin(y) * (x / (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -0.00152], N[(N[(N[Sin[y], $MachinePrecision] / z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.55e-11], 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 -0.00152:\\
\;\;\;\;\frac{\sin y}{z} \cdot \frac{x}{y}\\
\mathbf{elif}\;y \leq 2.55 \cdot 10^{-11}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\sin y \cdot \frac{x}{y \cdot z}\\
\end{array}
\end{array}
if y < -0.0015200000000000001Initial program 95.9%
associate-*r/95.8%
associate-/l/90.8%
*-commutative90.8%
times-frac96.0%
Simplified96.0%
if -0.0015200000000000001 < y < 2.54999999999999992e-11Initial program 100.0%
associate-*l/100.0%
times-frac78.8%
*-commutative78.8%
associate-*r/76.4%
*-commutative76.4%
Simplified76.4%
Taylor expanded in y around 0 100.0%
if 2.54999999999999992e-11 < y Initial program 94.2%
associate-*l/94.6%
times-frac94.5%
*-commutative94.5%
associate-*r/94.7%
*-commutative94.7%
Simplified94.7%
Final simplification97.6%
(FPCore (x y z) :precision binary64 (if (<= y -0.00152) (* (/ (sin y) z) (/ x y)) (if (<= y 3e-17) (/ x z) (/ x (* y (/ z (sin y)))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -0.00152) {
tmp = (sin(y) / z) * (x / y);
} else if (y <= 3e-17) {
tmp = 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 (y <= (-0.00152d0)) then
tmp = (sin(y) / z) * (x / y)
else if (y <= 3d-17) then
tmp = 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 (y <= -0.00152) {
tmp = (Math.sin(y) / z) * (x / y);
} else if (y <= 3e-17) {
tmp = x / z;
} else {
tmp = x / (y * (z / Math.sin(y)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -0.00152: tmp = (math.sin(y) / z) * (x / y) elif y <= 3e-17: tmp = x / z else: tmp = x / (y * (z / math.sin(y))) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -0.00152) tmp = Float64(Float64(sin(y) / z) * Float64(x / y)); elseif (y <= 3e-17) tmp = 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 (y <= -0.00152) tmp = (sin(y) / z) * (x / y); elseif (y <= 3e-17) tmp = x / z; else tmp = x / (y * (z / sin(y))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -0.00152], N[(N[(N[Sin[y], $MachinePrecision] / z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3e-17], N[(x / z), $MachinePrecision], N[(x / N[(y * N[(z / N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00152:\\
\;\;\;\;\frac{\sin y}{z} \cdot \frac{x}{y}\\
\mathbf{elif}\;y \leq 3 \cdot 10^{-17}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \frac{z}{\sin y}}\\
\end{array}
\end{array}
if y < -0.0015200000000000001Initial program 95.9%
associate-*r/95.8%
associate-/l/90.8%
*-commutative90.8%
times-frac96.0%
Simplified96.0%
if -0.0015200000000000001 < y < 3.00000000000000006e-17Initial program 100.0%
associate-*l/100.0%
times-frac78.3%
*-commutative78.3%
associate-*r/75.8%
*-commutative75.8%
Simplified75.8%
Taylor expanded in y around 0 100.0%
if 3.00000000000000006e-17 < y Initial program 94.5%
associate-/l*95.0%
associate-/r/95.0%
Simplified95.0%
Final simplification97.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(Float64(sin(y) / y) * x) / z) end
function tmp = code(x, y, z) tmp = ((sin(y) / y) * x) / z; end
code[x_, y_, z_] := N[(N[(N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\sin y}{y} \cdot x}{z}
\end{array}
Initial program 97.4%
Final simplification97.4%
(FPCore (x y z)
:precision binary64
(if (<= y -2.35)
(* (/ x (* y z)) (/ 6.0 y))
(if (<= y 1.06e+32)
(/ (* x (+ 1.0 (* (* y y) -0.16666666666666666))) z)
(/ (/ (* x (/ 6.0 y)) y) z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -2.35) {
tmp = (x / (y * z)) * (6.0 / y);
} else if (y <= 1.06e+32) {
tmp = (x * (1.0 + ((y * y) * -0.16666666666666666))) / z;
} else {
tmp = ((x * (6.0 / 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 <= (-2.35d0)) then
tmp = (x / (y * z)) * (6.0d0 / y)
else if (y <= 1.06d+32) then
tmp = (x * (1.0d0 + ((y * y) * (-0.16666666666666666d0)))) / z
else
tmp = ((x * (6.0d0 / y)) / y) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -2.35) {
tmp = (x / (y * z)) * (6.0 / y);
} else if (y <= 1.06e+32) {
tmp = (x * (1.0 + ((y * y) * -0.16666666666666666))) / z;
} else {
tmp = ((x * (6.0 / y)) / y) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2.35: tmp = (x / (y * z)) * (6.0 / y) elif y <= 1.06e+32: tmp = (x * (1.0 + ((y * y) * -0.16666666666666666))) / z else: tmp = ((x * (6.0 / y)) / y) / z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2.35) tmp = Float64(Float64(x / Float64(y * z)) * Float64(6.0 / y)); elseif (y <= 1.06e+32) tmp = Float64(Float64(x * Float64(1.0 + Float64(Float64(y * y) * -0.16666666666666666))) / z); else tmp = Float64(Float64(Float64(x * Float64(6.0 / y)) / y) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -2.35) tmp = (x / (y * z)) * (6.0 / y); elseif (y <= 1.06e+32) tmp = (x * (1.0 + ((y * y) * -0.16666666666666666))) / z; else tmp = ((x * (6.0 / y)) / y) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2.35], N[(N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision] * N[(6.0 / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.06e+32], N[(N[(x * N[(1.0 + N[(N[(y * y), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(N[(x * N[(6.0 / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.35:\\
\;\;\;\;\frac{x}{y \cdot z} \cdot \frac{6}{y}\\
\mathbf{elif}\;y \leq 1.06 \cdot 10^{+32}:\\
\;\;\;\;\frac{x \cdot \left(1 + \left(y \cdot y\right) \cdot -0.16666666666666666\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x \cdot \frac{6}{y}}{y}}{z}\\
\end{array}
\end{array}
if y < -2.35000000000000009Initial program 95.9%
associate-/l*90.9%
associate-/r/90.9%
Simplified90.9%
Taylor expanded in y around 0 31.6%
Taylor expanded in y around inf 31.7%
*-commutative31.7%
associate-*l/31.7%
unpow231.7%
associate-*l*31.6%
Simplified31.6%
*-commutative31.6%
times-frac32.8%
Applied egg-rr32.8%
if -2.35000000000000009 < y < 1.0600000000000001e32Initial program 100.0%
Taylor expanded in y around 0 96.3%
unpow296.3%
Simplified96.3%
if 1.0600000000000001e32 < y Initial program 93.2%
associate-/l*93.8%
associate-/r/93.9%
Simplified93.9%
Taylor expanded in y around 0 30.0%
Taylor expanded in y around inf 29.9%
*-commutative29.9%
unpow229.9%
Simplified29.9%
associate-*r/29.9%
*-commutative29.9%
*-commutative29.9%
associate-*r*30.0%
associate-/r*30.0%
associate-/r*30.1%
*-un-lft-identity30.1%
times-frac30.1%
/-rgt-identity30.1%
Applied egg-rr30.1%
Final simplification64.3%
(FPCore (x y z) :precision binary64 (if (or (<= y -2.4) (not (<= y 2.4))) (* (/ x (* y z)) (/ 6.0 y)) (/ x z)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -2.4) || !(y <= 2.4)) {
tmp = (x / (y * z)) * (6.0 / y);
} else {
tmp = 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 ((y <= (-2.4d0)) .or. (.not. (y <= 2.4d0))) then
tmp = (x / (y * z)) * (6.0d0 / y)
else
tmp = x / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -2.4) || !(y <= 2.4)) {
tmp = (x / (y * z)) * (6.0 / y);
} else {
tmp = x / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -2.4) or not (y <= 2.4): tmp = (x / (y * z)) * (6.0 / y) else: tmp = x / z return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -2.4) || !(y <= 2.4)) tmp = Float64(Float64(x / Float64(y * z)) * Float64(6.0 / y)); else tmp = Float64(x / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -2.4) || ~((y <= 2.4))) tmp = (x / (y * z)) * (6.0 / y); else tmp = x / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -2.4], N[Not[LessEqual[y, 2.4]], $MachinePrecision]], N[(N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision] * N[(6.0 / y), $MachinePrecision]), $MachinePrecision], N[(x / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \lor \neg \left(y \leq 2.4\right):\\
\;\;\;\;\frac{x}{y \cdot z} \cdot \frac{6}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z}\\
\end{array}
\end{array}
if y < -2.39999999999999991 or 2.39999999999999991 < y Initial program 95.1%
associate-/l*92.3%
associate-/r/92.3%
Simplified92.3%
Taylor expanded in y around 0 29.9%
Taylor expanded in y around inf 30.0%
*-commutative30.0%
associate-*l/30.0%
unpow230.0%
associate-*l*29.9%
Simplified29.9%
*-commutative29.9%
times-frac30.6%
Applied egg-rr30.6%
if -2.39999999999999991 < y < 2.39999999999999991Initial program 100.0%
associate-*l/100.0%
times-frac79.4%
*-commutative79.4%
associate-*r/77.1%
*-commutative77.1%
Simplified77.1%
Taylor expanded in y around 0 98.6%
Final simplification63.6%
(FPCore (x y z) :precision binary64 (if (<= y -2000000.0) (/ y (/ (* y z) x)) (if (<= y 1.46e+51) (/ x z) (* 6.0 (/ x (* z (* y y)))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -2000000.0) {
tmp = y / ((y * z) / x);
} else if (y <= 1.46e+51) {
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 <= (-2000000.0d0)) then
tmp = y / ((y * z) / x)
else if (y <= 1.46d+51) 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 <= -2000000.0) {
tmp = y / ((y * z) / x);
} else if (y <= 1.46e+51) {
tmp = x / z;
} else {
tmp = 6.0 * (x / (z * (y * y)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2000000.0: tmp = y / ((y * z) / x) elif y <= 1.46e+51: tmp = x / z else: tmp = 6.0 * (x / (z * (y * y))) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2000000.0) tmp = Float64(y / Float64(Float64(y * z) / x)); elseif (y <= 1.46e+51) 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 <= -2000000.0) tmp = y / ((y * z) / x); elseif (y <= 1.46e+51) tmp = x / z; else tmp = 6.0 * (x / (z * (y * y))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2000000.0], N[(y / N[(N[(y * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.46e+51], 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 -2000000:\\
\;\;\;\;\frac{y}{\frac{y \cdot z}{x}}\\
\mathbf{elif}\;y \leq 1.46 \cdot 10^{+51}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \frac{x}{z \cdot \left(y \cdot y\right)}\\
\end{array}
\end{array}
if y < -2e6Initial program 95.8%
associate-*r/95.7%
associate-/l/90.6%
*-commutative90.6%
times-frac95.9%
Simplified95.9%
Taylor expanded in y around 0 26.0%
frac-times18.6%
*-commutative18.6%
associate-/l*33.1%
Applied egg-rr33.1%
if -2e6 < y < 1.4600000000000001e51Initial program 100.0%
associate-*l/99.9%
times-frac81.3%
*-commutative81.3%
associate-*r/79.2%
*-commutative79.2%
Simplified79.2%
Taylor expanded in y around 0 90.3%
if 1.4600000000000001e51 < y Initial program 92.3%
associate-/l*93.0%
associate-/r/93.0%
Simplified93.0%
Taylor expanded in y around 0 31.3%
Taylor expanded in y around inf 31.3%
*-commutative31.3%
unpow231.3%
Simplified31.3%
Final simplification63.4%
(FPCore (x y z) :precision binary64 (if (<= y -100000.0) (/ y (/ (* y z) x)) (if (<= y 2.4) (/ x z) (* 6.0 (/ (/ x y) (* y z))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -100000.0) {
tmp = y / ((y * z) / x);
} else if (y <= 2.4) {
tmp = x / z;
} else {
tmp = 6.0 * ((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 <= (-100000.0d0)) then
tmp = y / ((y * z) / x)
else if (y <= 2.4d0) then
tmp = x / z
else
tmp = 6.0d0 * ((x / y) / (y * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -100000.0) {
tmp = y / ((y * z) / x);
} else if (y <= 2.4) {
tmp = x / z;
} else {
tmp = 6.0 * ((x / y) / (y * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -100000.0: tmp = y / ((y * z) / x) elif y <= 2.4: tmp = x / z else: tmp = 6.0 * ((x / y) / (y * z)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -100000.0) tmp = Float64(y / Float64(Float64(y * z) / x)); elseif (y <= 2.4) tmp = Float64(x / z); else tmp = Float64(6.0 * Float64(Float64(x / y) / Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -100000.0) tmp = y / ((y * z) / x); elseif (y <= 2.4) tmp = x / z; else tmp = 6.0 * ((x / y) / (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -100000.0], N[(y / N[(N[(y * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.4], N[(x / z), $MachinePrecision], N[(6.0 * N[(N[(x / y), $MachinePrecision] / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -100000:\\
\;\;\;\;\frac{y}{\frac{y \cdot z}{x}}\\
\mathbf{elif}\;y \leq 2.4:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \frac{\frac{x}{y}}{y \cdot z}\\
\end{array}
\end{array}
if y < -1e5Initial program 95.8%
associate-*r/95.7%
associate-/l/90.6%
*-commutative90.6%
times-frac95.9%
Simplified95.9%
Taylor expanded in y around 0 26.0%
frac-times18.6%
*-commutative18.6%
associate-/l*33.1%
Applied egg-rr33.1%
if -1e5 < y < 2.39999999999999991Initial program 100.0%
associate-*l/100.0%
times-frac79.7%
*-commutative79.7%
associate-*r/77.5%
*-commutative77.5%
Simplified77.5%
Taylor expanded in y around 0 97.1%
if 2.39999999999999991 < y Initial program 93.8%
associate-/l*94.4%
associate-/r/94.4%
Simplified94.4%
Taylor expanded in y around 0 27.4%
Taylor expanded in y around inf 27.4%
*-commutative27.4%
unpow227.4%
Simplified27.4%
Taylor expanded in x around 0 27.4%
rem-square-sqrt13.0%
unpow213.0%
times-frac13.0%
associate-/r*13.1%
times-frac13.1%
associate-*l/13.1%
rem-square-sqrt27.5%
Simplified27.5%
Final simplification63.4%
(FPCore (x y z) :precision binary64 (if (<= y -2000000.0) (/ y (/ (* y z) x)) (if (<= y 2.4) (/ x z) (* x (/ (/ 6.0 y) (* y z))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -2000000.0) {
tmp = y / ((y * z) / x);
} else if (y <= 2.4) {
tmp = x / z;
} else {
tmp = x * ((6.0 / 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 <= (-2000000.0d0)) then
tmp = y / ((y * z) / x)
else if (y <= 2.4d0) then
tmp = x / z
else
tmp = x * ((6.0d0 / y) / (y * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -2000000.0) {
tmp = y / ((y * z) / x);
} else if (y <= 2.4) {
tmp = x / z;
} else {
tmp = x * ((6.0 / y) / (y * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2000000.0: tmp = y / ((y * z) / x) elif y <= 2.4: tmp = x / z else: tmp = x * ((6.0 / y) / (y * z)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2000000.0) tmp = Float64(y / Float64(Float64(y * z) / x)); elseif (y <= 2.4) tmp = Float64(x / z); else tmp = Float64(x * Float64(Float64(6.0 / y) / Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -2000000.0) tmp = y / ((y * z) / x); elseif (y <= 2.4) tmp = x / z; else tmp = x * ((6.0 / y) / (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2000000.0], N[(y / N[(N[(y * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.4], N[(x / z), $MachinePrecision], N[(x * N[(N[(6.0 / y), $MachinePrecision] / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2000000:\\
\;\;\;\;\frac{y}{\frac{y \cdot z}{x}}\\
\mathbf{elif}\;y \leq 2.4:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{6}{y}}{y \cdot z}\\
\end{array}
\end{array}
if y < -2e6Initial program 95.8%
associate-*r/95.7%
associate-/l/90.6%
*-commutative90.6%
times-frac95.9%
Simplified95.9%
Taylor expanded in y around 0 26.0%
frac-times18.6%
*-commutative18.6%
associate-/l*33.1%
Applied egg-rr33.1%
if -2e6 < y < 2.39999999999999991Initial program 100.0%
associate-*l/100.0%
times-frac79.7%
*-commutative79.7%
associate-*r/77.5%
*-commutative77.5%
Simplified77.5%
Taylor expanded in y around 0 97.1%
if 2.39999999999999991 < y Initial program 93.8%
associate-/l*94.4%
associate-/r/94.4%
Simplified94.4%
Taylor expanded in y around 0 27.4%
Taylor expanded in y around inf 27.4%
*-commutative27.4%
unpow227.4%
Simplified27.4%
Taylor expanded in x around 0 27.4%
associate-*r/27.4%
*-commutative27.4%
unpow227.4%
associate-*r*27.4%
associate-*r/27.4%
associate-/r*27.5%
Simplified27.5%
Final simplification63.4%
(FPCore (x y z) :precision binary64 (if (<= y -2.4) (* (/ x (* y z)) (/ 6.0 y)) (if (<= y 2.4) (/ x z) (/ (/ (* x (/ 6.0 y)) y) z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -2.4) {
tmp = (x / (y * z)) * (6.0 / y);
} else if (y <= 2.4) {
tmp = x / z;
} else {
tmp = ((x * (6.0 / 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 <= (-2.4d0)) then
tmp = (x / (y * z)) * (6.0d0 / y)
else if (y <= 2.4d0) then
tmp = x / z
else
tmp = ((x * (6.0d0 / y)) / y) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -2.4) {
tmp = (x / (y * z)) * (6.0 / y);
} else if (y <= 2.4) {
tmp = x / z;
} else {
tmp = ((x * (6.0 / y)) / y) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2.4: tmp = (x / (y * z)) * (6.0 / y) elif y <= 2.4: tmp = x / z else: tmp = ((x * (6.0 / y)) / y) / z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2.4) tmp = Float64(Float64(x / Float64(y * z)) * Float64(6.0 / y)); elseif (y <= 2.4) tmp = Float64(x / z); else tmp = Float64(Float64(Float64(x * Float64(6.0 / y)) / y) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -2.4) tmp = (x / (y * z)) * (6.0 / y); elseif (y <= 2.4) tmp = x / z; else tmp = ((x * (6.0 / y)) / y) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2.4], N[(N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision] * N[(6.0 / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.4], N[(x / z), $MachinePrecision], N[(N[(N[(x * N[(6.0 / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4:\\
\;\;\;\;\frac{x}{y \cdot z} \cdot \frac{6}{y}\\
\mathbf{elif}\;y \leq 2.4:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x \cdot \frac{6}{y}}{y}}{z}\\
\end{array}
\end{array}
if y < -2.39999999999999991Initial program 95.9%
associate-/l*90.9%
associate-/r/90.9%
Simplified90.9%
Taylor expanded in y around 0 31.6%
Taylor expanded in y around inf 31.7%
*-commutative31.7%
associate-*l/31.7%
unpow231.7%
associate-*l*31.6%
Simplified31.6%
*-commutative31.6%
times-frac32.8%
Applied egg-rr32.8%
if -2.39999999999999991 < y < 2.39999999999999991Initial program 100.0%
associate-*l/100.0%
times-frac79.4%
*-commutative79.4%
associate-*r/77.1%
*-commutative77.1%
Simplified77.1%
Taylor expanded in y around 0 98.6%
if 2.39999999999999991 < y Initial program 93.8%
associate-/l*94.4%
associate-/r/94.4%
Simplified94.4%
Taylor expanded in y around 0 27.4%
Taylor expanded in y around inf 27.4%
*-commutative27.4%
unpow227.4%
Simplified27.4%
associate-*r/27.4%
*-commutative27.4%
*-commutative27.4%
associate-*r*27.4%
associate-/r*27.5%
associate-/r*27.5%
*-un-lft-identity27.5%
times-frac27.5%
/-rgt-identity27.5%
Applied egg-rr27.5%
Final simplification63.6%
(FPCore (x y z) :precision binary64 (if (or (<= y -100000.0) (not (<= y 4.3e-44))) (/ y (* z (/ y x))) (/ x z)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -100000.0) || !(y <= 4.3e-44)) {
tmp = y / (z * (y / x));
} else {
tmp = 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 ((y <= (-100000.0d0)) .or. (.not. (y <= 4.3d-44))) then
tmp = y / (z * (y / x))
else
tmp = x / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -100000.0) || !(y <= 4.3e-44)) {
tmp = y / (z * (y / x));
} else {
tmp = x / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -100000.0) or not (y <= 4.3e-44): tmp = y / (z * (y / x)) else: tmp = x / z return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -100000.0) || !(y <= 4.3e-44)) tmp = Float64(y / Float64(z * Float64(y / x))); else tmp = Float64(x / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -100000.0) || ~((y <= 4.3e-44))) tmp = y / (z * (y / x)); else tmp = x / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -100000.0], N[Not[LessEqual[y, 4.3e-44]], $MachinePrecision]], N[(y / N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -100000 \lor \neg \left(y \leq 4.3 \cdot 10^{-44}\right):\\
\;\;\;\;\frac{y}{z \cdot \frac{y}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z}\\
\end{array}
\end{array}
if y < -1e5 or 4.30000000000000013e-44 < y Initial program 95.5%
associate-*r/95.6%
associate-/l/92.9%
*-commutative92.9%
times-frac95.6%
Simplified95.6%
Taylor expanded in y around 0 30.3%
*-commutative30.3%
clear-num30.3%
frac-times37.3%
*-un-lft-identity37.3%
Applied egg-rr37.3%
if -1e5 < y < 4.30000000000000013e-44Initial program 100.0%
associate-*l/100.0%
times-frac76.7%
*-commutative76.7%
associate-*r/74.0%
*-commutative74.0%
Simplified74.0%
Taylor expanded in y around 0 98.3%
Final simplification63.3%
(FPCore (x y z) :precision binary64 (if (or (<= y -100000.0) (not (<= y 1e+51))) (/ y (/ (* y z) x)) (/ x z)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -100000.0) || !(y <= 1e+51)) {
tmp = y / ((y * z) / x);
} else {
tmp = 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 ((y <= (-100000.0d0)) .or. (.not. (y <= 1d+51))) then
tmp = y / ((y * z) / x)
else
tmp = x / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -100000.0) || !(y <= 1e+51)) {
tmp = y / ((y * z) / x);
} else {
tmp = x / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -100000.0) or not (y <= 1e+51): tmp = y / ((y * z) / x) else: tmp = x / z return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -100000.0) || !(y <= 1e+51)) tmp = Float64(y / Float64(Float64(y * z) / x)); else tmp = Float64(x / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -100000.0) || ~((y <= 1e+51))) tmp = y / ((y * z) / x); else tmp = x / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -100000.0], N[Not[LessEqual[y, 1e+51]], $MachinePrecision]], N[(y / N[(N[(y * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(x / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -100000 \lor \neg \left(y \leq 10^{+51}\right):\\
\;\;\;\;\frac{y}{\frac{y \cdot z}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z}\\
\end{array}
\end{array}
if y < -1e5 or 1e51 < y Initial program 94.5%
associate-*r/94.6%
associate-/l/91.4%
*-commutative91.4%
times-frac94.6%
Simplified94.6%
Taylor expanded in y around 0 23.5%
frac-times17.3%
*-commutative17.3%
associate-/l*32.2%
Applied egg-rr32.2%
if -1e5 < y < 1e51Initial program 100.0%
associate-*l/99.9%
times-frac81.3%
*-commutative81.3%
associate-*r/79.2%
*-commutative79.2%
Simplified79.2%
Taylor expanded in y around 0 90.3%
Final simplification63.3%
(FPCore (x y z) :precision binary64 (if (<= x -1.4e-83) (/ x (/ (* y z) y)) (if (<= x 1.6e-148) (* (/ x y) (/ y z)) (/ x z))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.4e-83) {
tmp = x / ((y * z) / y);
} else if (x <= 1.6e-148) {
tmp = (x / y) * (y / z);
} else {
tmp = 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 (x <= (-1.4d-83)) then
tmp = x / ((y * z) / y)
else if (x <= 1.6d-148) then
tmp = (x / y) * (y / z)
else
tmp = x / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.4e-83) {
tmp = x / ((y * z) / y);
} else if (x <= 1.6e-148) {
tmp = (x / y) * (y / z);
} else {
tmp = x / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.4e-83: tmp = x / ((y * z) / y) elif x <= 1.6e-148: tmp = (x / y) * (y / z) else: tmp = x / z return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.4e-83) tmp = Float64(x / Float64(Float64(y * z) / y)); elseif (x <= 1.6e-148) tmp = Float64(Float64(x / y) * Float64(y / z)); else tmp = Float64(x / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.4e-83) tmp = x / ((y * z) / y); elseif (x <= 1.6e-148) tmp = (x / y) * (y / z); else tmp = x / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.4e-83], N[(x / N[(N[(y * z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.6e-148], N[(N[(x / y), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(x / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{-83}:\\
\;\;\;\;\frac{x}{\frac{y \cdot z}{y}}\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{-148}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z}\\
\end{array}
\end{array}
if x < -1.4e-83Initial program 99.7%
associate-/l*95.0%
associate-/r/88.0%
Simplified88.0%
Taylor expanded in y around 0 38.5%
associate-*l/47.9%
*-commutative47.9%
Applied egg-rr47.9%
if -1.4e-83 < x < 1.59999999999999997e-148Initial program 91.6%
associate-*r/71.9%
associate-/l/79.7%
*-commutative79.7%
times-frac91.1%
Simplified91.1%
Taylor expanded in y around 0 80.7%
if 1.59999999999999997e-148 < x Initial program 99.1%
associate-*l/94.6%
times-frac84.5%
*-commutative84.5%
associate-*r/81.2%
*-commutative81.2%
Simplified81.2%
Taylor expanded in y around 0 57.0%
Final simplification60.0%
(FPCore (x y z) :precision binary64 (/ (/ x (+ 1.0 (* (* y y) 0.16666666666666666))) z))
double code(double x, double y, double z) {
return (x / (1.0 + ((y * y) * 0.16666666666666666))) / 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 / (1.0d0 + ((y * y) * 0.16666666666666666d0))) / z
end function
public static double code(double x, double y, double z) {
return (x / (1.0 + ((y * y) * 0.16666666666666666))) / z;
}
def code(x, y, z): return (x / (1.0 + ((y * y) * 0.16666666666666666))) / z
function code(x, y, z) return Float64(Float64(x / Float64(1.0 + Float64(Float64(y * y) * 0.16666666666666666))) / z) end
function tmp = code(x, y, z) tmp = (x / (1.0 + ((y * y) * 0.16666666666666666))) / z; end
code[x_, y_, z_] := N[(N[(x / N[(1.0 + N[(N[(y * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{x}{1 + \left(y \cdot y\right) \cdot 0.16666666666666666}}{z}
\end{array}
Initial program 97.4%
clear-num97.4%
un-div-inv97.4%
Applied egg-rr97.4%
Taylor expanded in y around 0 63.5%
*-commutative63.5%
unpow263.5%
Simplified63.5%
Final simplification63.5%
(FPCore (x y z) :precision binary64 (if (<= y -3e+113) (* (/ x y) (/ y z)) (/ x z)))
double code(double x, double y, double z) {
double tmp;
if (y <= -3e+113) {
tmp = (x / y) * (y / z);
} else {
tmp = 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 (y <= (-3d+113)) then
tmp = (x / y) * (y / z)
else
tmp = x / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -3e+113) {
tmp = (x / y) * (y / z);
} else {
tmp = x / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -3e+113: tmp = (x / y) * (y / z) else: tmp = x / z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -3e+113) tmp = Float64(Float64(x / y) * Float64(y / z)); else tmp = Float64(x / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -3e+113) tmp = (x / y) * (y / z); else tmp = x / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -3e+113], N[(N[(x / y), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(x / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{+113}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z}\\
\end{array}
\end{array}
if y < -3e113Initial program 94.0%
associate-*r/94.0%
associate-/l/90.0%
*-commutative90.0%
times-frac94.2%
Simplified94.2%
Taylor expanded in y around 0 32.1%
if -3e113 < y Initial program 98.3%
associate-*l/98.0%
times-frac85.0%
*-commutative85.0%
associate-*r/83.6%
*-commutative83.6%
Simplified83.6%
Taylor expanded in y around 0 64.5%
Final simplification57.9%
(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 97.4%
associate-*l/96.1%
times-frac86.0%
*-commutative86.0%
associate-*r/84.9%
*-commutative84.9%
Simplified84.9%
Taylor expanded in y around 0 55.4%
Final simplification55.4%
(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 2023196
(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))