
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) z)))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * 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 + (((y - x) * 6.0d0) * z)
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * z);
}
def code(x, y, z): return x + (((y - x) * 6.0) * z)
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * z)) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * z); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot z
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) z)))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * 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 + (((y - x) * 6.0d0) * z)
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * z);
}
def code(x, y, z): return x + (((y - x) * 6.0) * z)
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * z)) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * z); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot z
\end{array}
(FPCore (x y z) :precision binary64 (+ x (* 6.0 (* z (- y x)))))
double code(double x, double y, double z) {
return x + (6.0 * (z * (y - x)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (6.0d0 * (z * (y - x)))
end function
public static double code(double x, double y, double z) {
return x + (6.0 * (z * (y - x)));
}
def code(x, y, z): return x + (6.0 * (z * (y - x)))
function code(x, y, z) return Float64(x + Float64(6.0 * Float64(z * Float64(y - x)))) end
function tmp = code(x, y, z) tmp = x + (6.0 * (z * (y - x))); end
code[x_, y_, z_] := N[(x + N[(6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + 6 \cdot \left(z \cdot \left(y - x\right)\right)
\end{array}
Initial program 99.8%
Taylor expanded in z around 0 99.8%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (* x -6.0)))
(t_1 (* z (* 6.0 y)))
(t_2 (* y (* 6.0 z)))
(t_3 (* x (* z -6.0))))
(if (<= z -1.7e+237)
t_2
(if (<= z -2.25e+197)
t_3
(if (<= z -4.4e+169)
t_1
(if (<= z -1.75e+149)
(* -6.0 (* x z))
(if (<= z -7.1e+93)
t_2
(if (<= z -3.5e+14)
t_0
(if (<= z -4.1e-54)
(* 6.0 (* z y))
(if (<= z 1.6e-39)
x
(if (<= z 1.14e+114)
t_2
(if (<= z 7.8e+149)
t_0
(if (<= z 1.55e+185) t_1 t_3)))))))))))))
double code(double x, double y, double z) {
double t_0 = z * (x * -6.0);
double t_1 = z * (6.0 * y);
double t_2 = y * (6.0 * z);
double t_3 = x * (z * -6.0);
double tmp;
if (z <= -1.7e+237) {
tmp = t_2;
} else if (z <= -2.25e+197) {
tmp = t_3;
} else if (z <= -4.4e+169) {
tmp = t_1;
} else if (z <= -1.75e+149) {
tmp = -6.0 * (x * z);
} else if (z <= -7.1e+93) {
tmp = t_2;
} else if (z <= -3.5e+14) {
tmp = t_0;
} else if (z <= -4.1e-54) {
tmp = 6.0 * (z * y);
} else if (z <= 1.6e-39) {
tmp = x;
} else if (z <= 1.14e+114) {
tmp = t_2;
} else if (z <= 7.8e+149) {
tmp = t_0;
} else if (z <= 1.55e+185) {
tmp = t_1;
} else {
tmp = t_3;
}
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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = z * (x * (-6.0d0))
t_1 = z * (6.0d0 * y)
t_2 = y * (6.0d0 * z)
t_3 = x * (z * (-6.0d0))
if (z <= (-1.7d+237)) then
tmp = t_2
else if (z <= (-2.25d+197)) then
tmp = t_3
else if (z <= (-4.4d+169)) then
tmp = t_1
else if (z <= (-1.75d+149)) then
tmp = (-6.0d0) * (x * z)
else if (z <= (-7.1d+93)) then
tmp = t_2
else if (z <= (-3.5d+14)) then
tmp = t_0
else if (z <= (-4.1d-54)) then
tmp = 6.0d0 * (z * y)
else if (z <= 1.6d-39) then
tmp = x
else if (z <= 1.14d+114) then
tmp = t_2
else if (z <= 7.8d+149) then
tmp = t_0
else if (z <= 1.55d+185) then
tmp = t_1
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * (x * -6.0);
double t_1 = z * (6.0 * y);
double t_2 = y * (6.0 * z);
double t_3 = x * (z * -6.0);
double tmp;
if (z <= -1.7e+237) {
tmp = t_2;
} else if (z <= -2.25e+197) {
tmp = t_3;
} else if (z <= -4.4e+169) {
tmp = t_1;
} else if (z <= -1.75e+149) {
tmp = -6.0 * (x * z);
} else if (z <= -7.1e+93) {
tmp = t_2;
} else if (z <= -3.5e+14) {
tmp = t_0;
} else if (z <= -4.1e-54) {
tmp = 6.0 * (z * y);
} else if (z <= 1.6e-39) {
tmp = x;
} else if (z <= 1.14e+114) {
tmp = t_2;
} else if (z <= 7.8e+149) {
tmp = t_0;
} else if (z <= 1.55e+185) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z): t_0 = z * (x * -6.0) t_1 = z * (6.0 * y) t_2 = y * (6.0 * z) t_3 = x * (z * -6.0) tmp = 0 if z <= -1.7e+237: tmp = t_2 elif z <= -2.25e+197: tmp = t_3 elif z <= -4.4e+169: tmp = t_1 elif z <= -1.75e+149: tmp = -6.0 * (x * z) elif z <= -7.1e+93: tmp = t_2 elif z <= -3.5e+14: tmp = t_0 elif z <= -4.1e-54: tmp = 6.0 * (z * y) elif z <= 1.6e-39: tmp = x elif z <= 1.14e+114: tmp = t_2 elif z <= 7.8e+149: tmp = t_0 elif z <= 1.55e+185: tmp = t_1 else: tmp = t_3 return tmp
function code(x, y, z) t_0 = Float64(z * Float64(x * -6.0)) t_1 = Float64(z * Float64(6.0 * y)) t_2 = Float64(y * Float64(6.0 * z)) t_3 = Float64(x * Float64(z * -6.0)) tmp = 0.0 if (z <= -1.7e+237) tmp = t_2; elseif (z <= -2.25e+197) tmp = t_3; elseif (z <= -4.4e+169) tmp = t_1; elseif (z <= -1.75e+149) tmp = Float64(-6.0 * Float64(x * z)); elseif (z <= -7.1e+93) tmp = t_2; elseif (z <= -3.5e+14) tmp = t_0; elseif (z <= -4.1e-54) tmp = Float64(6.0 * Float64(z * y)); elseif (z <= 1.6e-39) tmp = x; elseif (z <= 1.14e+114) tmp = t_2; elseif (z <= 7.8e+149) tmp = t_0; elseif (z <= 1.55e+185) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * (x * -6.0); t_1 = z * (6.0 * y); t_2 = y * (6.0 * z); t_3 = x * (z * -6.0); tmp = 0.0; if (z <= -1.7e+237) tmp = t_2; elseif (z <= -2.25e+197) tmp = t_3; elseif (z <= -4.4e+169) tmp = t_1; elseif (z <= -1.75e+149) tmp = -6.0 * (x * z); elseif (z <= -7.1e+93) tmp = t_2; elseif (z <= -3.5e+14) tmp = t_0; elseif (z <= -4.1e-54) tmp = 6.0 * (z * y); elseif (z <= 1.6e-39) tmp = x; elseif (z <= 1.14e+114) tmp = t_2; elseif (z <= 7.8e+149) tmp = t_0; elseif (z <= 1.55e+185) tmp = t_1; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(x * -6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(z * N[(6.0 * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(6.0 * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.7e+237], t$95$2, If[LessEqual[z, -2.25e+197], t$95$3, If[LessEqual[z, -4.4e+169], t$95$1, If[LessEqual[z, -1.75e+149], N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7.1e+93], t$95$2, If[LessEqual[z, -3.5e+14], t$95$0, If[LessEqual[z, -4.1e-54], N[(6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.6e-39], x, If[LessEqual[z, 1.14e+114], t$95$2, If[LessEqual[z, 7.8e+149], t$95$0, If[LessEqual[z, 1.55e+185], t$95$1, t$95$3]]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(x \cdot -6\right)\\
t_1 := z \cdot \left(6 \cdot y\right)\\
t_2 := y \cdot \left(6 \cdot z\right)\\
t_3 := x \cdot \left(z \cdot -6\right)\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{+237}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -2.25 \cdot 10^{+197}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq -4.4 \cdot 10^{+169}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.75 \cdot 10^{+149}:\\
\;\;\;\;-6 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;z \leq -7.1 \cdot 10^{+93}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{+14}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -4.1 \cdot 10^{-54}:\\
\;\;\;\;6 \cdot \left(z \cdot y\right)\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-39}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.14 \cdot 10^{+114}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{+149}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{+185}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if z < -1.7000000000000002e237 or -1.75000000000000006e149 < z < -7.1000000000000004e93 or 1.5999999999999999e-39 < z < 1.14e114Initial program 99.6%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 87.4%
Taylor expanded in y around inf 66.4%
*-commutative66.4%
associate-*r*66.5%
Simplified66.5%
if -1.7000000000000002e237 < z < -2.2500000000000001e197 or 1.55e185 < z Initial program 99.8%
Taylor expanded in x around inf 64.7%
Taylor expanded in z around inf 64.7%
if -2.2500000000000001e197 < z < -4.4e169 or 7.7999999999999998e149 < z < 1.55e185Initial program 99.8%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 99.7%
Taylor expanded in y around 0 99.7%
+-commutative99.7%
*-commutative99.7%
metadata-eval99.7%
cancel-sign-sub-inv99.7%
associate-*l*99.7%
unsub-neg99.7%
*-commutative99.7%
associate-*l*99.6%
distribute-rgt-neg-out99.6%
distribute-lft-out99.6%
sub-neg99.6%
*-commutative99.6%
associate-*r*99.8%
Simplified99.8%
Taylor expanded in y around inf 88.0%
if -4.4e169 < z < -1.75000000000000006e149Initial program 99.8%
Taylor expanded in z around 0 99.8%
Taylor expanded in z around inf 99.8%
Taylor expanded in y around 0 99.8%
if -7.1000000000000004e93 < z < -3.5e14 or 1.14e114 < z < 7.7999999999999998e149Initial program 99.8%
Taylor expanded in z around 0 99.8%
Taylor expanded in z around inf 99.8%
Taylor expanded in y around 0 71.9%
*-commutative71.9%
associate-*r*71.9%
*-commutative71.9%
associate-*r*72.0%
Simplified72.0%
if -3.5e14 < z < -4.1000000000000001e-54Initial program 99.5%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 80.5%
Taylor expanded in y around inf 79.1%
*-commutative79.1%
Simplified79.1%
if -4.1000000000000001e-54 < z < 1.5999999999999999e-39Initial program 99.9%
Taylor expanded in z around 0 77.8%
Final simplification74.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* z y))) (t_1 (* -6.0 (* x z))))
(if (<= z -1.7e+237)
t_0
(if (<= z -4.2e+148)
t_1
(if (<= z -1.05e+103)
t_0
(if (<= z -1.62e+14)
t_1
(if (<= z -4.1e-54)
t_0
(if (<= z 6.3e-40)
x
(if (or (<= z 5e+23)
(and (not (<= z 3.8e+148)) (<= z 2.2e+184)))
t_0
t_1)))))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (z * y);
double t_1 = -6.0 * (x * z);
double tmp;
if (z <= -1.7e+237) {
tmp = t_0;
} else if (z <= -4.2e+148) {
tmp = t_1;
} else if (z <= -1.05e+103) {
tmp = t_0;
} else if (z <= -1.62e+14) {
tmp = t_1;
} else if (z <= -4.1e-54) {
tmp = t_0;
} else if (z <= 6.3e-40) {
tmp = x;
} else if ((z <= 5e+23) || (!(z <= 3.8e+148) && (z <= 2.2e+184))) {
tmp = 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 = 6.0d0 * (z * y)
t_1 = (-6.0d0) * (x * z)
if (z <= (-1.7d+237)) then
tmp = t_0
else if (z <= (-4.2d+148)) then
tmp = t_1
else if (z <= (-1.05d+103)) then
tmp = t_0
else if (z <= (-1.62d+14)) then
tmp = t_1
else if (z <= (-4.1d-54)) then
tmp = t_0
else if (z <= 6.3d-40) then
tmp = x
else if ((z <= 5d+23) .or. (.not. (z <= 3.8d+148)) .and. (z <= 2.2d+184)) then
tmp = 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 = 6.0 * (z * y);
double t_1 = -6.0 * (x * z);
double tmp;
if (z <= -1.7e+237) {
tmp = t_0;
} else if (z <= -4.2e+148) {
tmp = t_1;
} else if (z <= -1.05e+103) {
tmp = t_0;
} else if (z <= -1.62e+14) {
tmp = t_1;
} else if (z <= -4.1e-54) {
tmp = t_0;
} else if (z <= 6.3e-40) {
tmp = x;
} else if ((z <= 5e+23) || (!(z <= 3.8e+148) && (z <= 2.2e+184))) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (z * y) t_1 = -6.0 * (x * z) tmp = 0 if z <= -1.7e+237: tmp = t_0 elif z <= -4.2e+148: tmp = t_1 elif z <= -1.05e+103: tmp = t_0 elif z <= -1.62e+14: tmp = t_1 elif z <= -4.1e-54: tmp = t_0 elif z <= 6.3e-40: tmp = x elif (z <= 5e+23) or (not (z <= 3.8e+148) and (z <= 2.2e+184)): tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(z * y)) t_1 = Float64(-6.0 * Float64(x * z)) tmp = 0.0 if (z <= -1.7e+237) tmp = t_0; elseif (z <= -4.2e+148) tmp = t_1; elseif (z <= -1.05e+103) tmp = t_0; elseif (z <= -1.62e+14) tmp = t_1; elseif (z <= -4.1e-54) tmp = t_0; elseif (z <= 6.3e-40) tmp = x; elseif ((z <= 5e+23) || (!(z <= 3.8e+148) && (z <= 2.2e+184))) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (z * y); t_1 = -6.0 * (x * z); tmp = 0.0; if (z <= -1.7e+237) tmp = t_0; elseif (z <= -4.2e+148) tmp = t_1; elseif (z <= -1.05e+103) tmp = t_0; elseif (z <= -1.62e+14) tmp = t_1; elseif (z <= -4.1e-54) tmp = t_0; elseif (z <= 6.3e-40) tmp = x; elseif ((z <= 5e+23) || (~((z <= 3.8e+148)) && (z <= 2.2e+184))) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.7e+237], t$95$0, If[LessEqual[z, -4.2e+148], t$95$1, If[LessEqual[z, -1.05e+103], t$95$0, If[LessEqual[z, -1.62e+14], t$95$1, If[LessEqual[z, -4.1e-54], t$95$0, If[LessEqual[z, 6.3e-40], x, If[Or[LessEqual[z, 5e+23], And[N[Not[LessEqual[z, 3.8e+148]], $MachinePrecision], LessEqual[z, 2.2e+184]]], t$95$0, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(z \cdot y\right)\\
t_1 := -6 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{+237}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{+148}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{+103}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.62 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -4.1 \cdot 10^{-54}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 6.3 \cdot 10^{-40}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 5 \cdot 10^{+23} \lor \neg \left(z \leq 3.8 \cdot 10^{+148}\right) \land z \leq 2.2 \cdot 10^{+184}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.7000000000000002e237 or -4.19999999999999998e148 < z < -1.0500000000000001e103 or -1.62e14 < z < -4.1000000000000001e-54 or 6.3000000000000001e-40 < z < 4.9999999999999999e23 or 3.7999999999999998e148 < z < 2.2e184Initial program 99.6%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 86.4%
Taylor expanded in y around inf 74.3%
*-commutative74.3%
Simplified74.3%
if -1.7000000000000002e237 < z < -4.19999999999999998e148 or -1.0500000000000001e103 < z < -1.62e14 or 4.9999999999999999e23 < z < 3.7999999999999998e148 or 2.2e184 < z Initial program 99.8%
Taylor expanded in z around 0 99.8%
Taylor expanded in z around inf 99.8%
Taylor expanded in y around 0 64.5%
if -4.1000000000000001e-54 < z < 6.3000000000000001e-40Initial program 99.9%
Taylor expanded in z around 0 77.8%
Final simplification72.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* z y))) (t_1 (* -6.0 (* x z))))
(if (<= z -2.55e+237)
t_0
(if (<= z -1.45e+149)
t_1
(if (<= z -1e+98)
t_0
(if (<= z -6.4e+14)
t_1
(if (<= z -6.8e-54)
t_0
(if (<= z 1.55e-39)
x
(if (<= z 2.02e+24)
t_0
(if (<= z 3.8e+148)
t_1
(if (<= z 1.2e+184) t_0 (* x (* z -6.0)))))))))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (z * y);
double t_1 = -6.0 * (x * z);
double tmp;
if (z <= -2.55e+237) {
tmp = t_0;
} else if (z <= -1.45e+149) {
tmp = t_1;
} else if (z <= -1e+98) {
tmp = t_0;
} else if (z <= -6.4e+14) {
tmp = t_1;
} else if (z <= -6.8e-54) {
tmp = t_0;
} else if (z <= 1.55e-39) {
tmp = x;
} else if (z <= 2.02e+24) {
tmp = t_0;
} else if (z <= 3.8e+148) {
tmp = t_1;
} else if (z <= 1.2e+184) {
tmp = t_0;
} else {
tmp = x * (z * -6.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 6.0d0 * (z * y)
t_1 = (-6.0d0) * (x * z)
if (z <= (-2.55d+237)) then
tmp = t_0
else if (z <= (-1.45d+149)) then
tmp = t_1
else if (z <= (-1d+98)) then
tmp = t_0
else if (z <= (-6.4d+14)) then
tmp = t_1
else if (z <= (-6.8d-54)) then
tmp = t_0
else if (z <= 1.55d-39) then
tmp = x
else if (z <= 2.02d+24) then
tmp = t_0
else if (z <= 3.8d+148) then
tmp = t_1
else if (z <= 1.2d+184) then
tmp = t_0
else
tmp = x * (z * (-6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 6.0 * (z * y);
double t_1 = -6.0 * (x * z);
double tmp;
if (z <= -2.55e+237) {
tmp = t_0;
} else if (z <= -1.45e+149) {
tmp = t_1;
} else if (z <= -1e+98) {
tmp = t_0;
} else if (z <= -6.4e+14) {
tmp = t_1;
} else if (z <= -6.8e-54) {
tmp = t_0;
} else if (z <= 1.55e-39) {
tmp = x;
} else if (z <= 2.02e+24) {
tmp = t_0;
} else if (z <= 3.8e+148) {
tmp = t_1;
} else if (z <= 1.2e+184) {
tmp = t_0;
} else {
tmp = x * (z * -6.0);
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (z * y) t_1 = -6.0 * (x * z) tmp = 0 if z <= -2.55e+237: tmp = t_0 elif z <= -1.45e+149: tmp = t_1 elif z <= -1e+98: tmp = t_0 elif z <= -6.4e+14: tmp = t_1 elif z <= -6.8e-54: tmp = t_0 elif z <= 1.55e-39: tmp = x elif z <= 2.02e+24: tmp = t_0 elif z <= 3.8e+148: tmp = t_1 elif z <= 1.2e+184: tmp = t_0 else: tmp = x * (z * -6.0) return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(z * y)) t_1 = Float64(-6.0 * Float64(x * z)) tmp = 0.0 if (z <= -2.55e+237) tmp = t_0; elseif (z <= -1.45e+149) tmp = t_1; elseif (z <= -1e+98) tmp = t_0; elseif (z <= -6.4e+14) tmp = t_1; elseif (z <= -6.8e-54) tmp = t_0; elseif (z <= 1.55e-39) tmp = x; elseif (z <= 2.02e+24) tmp = t_0; elseif (z <= 3.8e+148) tmp = t_1; elseif (z <= 1.2e+184) tmp = t_0; else tmp = Float64(x * Float64(z * -6.0)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (z * y); t_1 = -6.0 * (x * z); tmp = 0.0; if (z <= -2.55e+237) tmp = t_0; elseif (z <= -1.45e+149) tmp = t_1; elseif (z <= -1e+98) tmp = t_0; elseif (z <= -6.4e+14) tmp = t_1; elseif (z <= -6.8e-54) tmp = t_0; elseif (z <= 1.55e-39) tmp = x; elseif (z <= 2.02e+24) tmp = t_0; elseif (z <= 3.8e+148) tmp = t_1; elseif (z <= 1.2e+184) tmp = t_0; else tmp = x * (z * -6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.55e+237], t$95$0, If[LessEqual[z, -1.45e+149], t$95$1, If[LessEqual[z, -1e+98], t$95$0, If[LessEqual[z, -6.4e+14], t$95$1, If[LessEqual[z, -6.8e-54], t$95$0, If[LessEqual[z, 1.55e-39], x, If[LessEqual[z, 2.02e+24], t$95$0, If[LessEqual[z, 3.8e+148], t$95$1, If[LessEqual[z, 1.2e+184], t$95$0, N[(x * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(z \cdot y\right)\\
t_1 := -6 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -2.55 \cdot 10^{+237}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.45 \cdot 10^{+149}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1 \cdot 10^{+98}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -6.4 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -6.8 \cdot 10^{-54}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{-39}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.02 \cdot 10^{+24}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+148}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+184}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot -6\right)\\
\end{array}
\end{array}
if z < -2.54999999999999989e237 or -1.4500000000000001e149 < z < -9.99999999999999998e97 or -6.4e14 < z < -6.79999999999999975e-54 or 1.54999999999999985e-39 < z < 2.0199999999999999e24 or 3.7999999999999998e148 < z < 1.19999999999999998e184Initial program 99.6%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 86.4%
Taylor expanded in y around inf 74.3%
*-commutative74.3%
Simplified74.3%
if -2.54999999999999989e237 < z < -1.4500000000000001e149 or -9.99999999999999998e97 < z < -6.4e14 or 2.0199999999999999e24 < z < 3.7999999999999998e148Initial program 99.7%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 99.7%
Taylor expanded in y around 0 66.7%
if -6.79999999999999975e-54 < z < 1.54999999999999985e-39Initial program 99.9%
Taylor expanded in z around 0 77.8%
if 1.19999999999999998e184 < z Initial program 99.8%
Taylor expanded in x around inf 60.6%
Taylor expanded in z around inf 60.6%
Final simplification72.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (* 6.0 z))) (t_1 (* 6.0 (* z y))) (t_2 (* -6.0 (* x z))))
(if (<= z -2.2e+237)
t_0
(if (<= z -1.48e+150)
t_2
(if (<= z -6.6e+109)
t_0
(if (<= z -5.1e+14)
t_2
(if (<= z -2.9e-54)
t_1
(if (<= z 1.32e-39)
x
(if (<= z 2.6e+116)
t_0
(if (<= z 7.2e+149)
t_2
(if (<= z 3e+184) t_1 (* x (* z -6.0)))))))))))))
double code(double x, double y, double z) {
double t_0 = y * (6.0 * z);
double t_1 = 6.0 * (z * y);
double t_2 = -6.0 * (x * z);
double tmp;
if (z <= -2.2e+237) {
tmp = t_0;
} else if (z <= -1.48e+150) {
tmp = t_2;
} else if (z <= -6.6e+109) {
tmp = t_0;
} else if (z <= -5.1e+14) {
tmp = t_2;
} else if (z <= -2.9e-54) {
tmp = t_1;
} else if (z <= 1.32e-39) {
tmp = x;
} else if (z <= 2.6e+116) {
tmp = t_0;
} else if (z <= 7.2e+149) {
tmp = t_2;
} else if (z <= 3e+184) {
tmp = t_1;
} else {
tmp = x * (z * -6.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = y * (6.0d0 * z)
t_1 = 6.0d0 * (z * y)
t_2 = (-6.0d0) * (x * z)
if (z <= (-2.2d+237)) then
tmp = t_0
else if (z <= (-1.48d+150)) then
tmp = t_2
else if (z <= (-6.6d+109)) then
tmp = t_0
else if (z <= (-5.1d+14)) then
tmp = t_2
else if (z <= (-2.9d-54)) then
tmp = t_1
else if (z <= 1.32d-39) then
tmp = x
else if (z <= 2.6d+116) then
tmp = t_0
else if (z <= 7.2d+149) then
tmp = t_2
else if (z <= 3d+184) then
tmp = t_1
else
tmp = x * (z * (-6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (6.0 * z);
double t_1 = 6.0 * (z * y);
double t_2 = -6.0 * (x * z);
double tmp;
if (z <= -2.2e+237) {
tmp = t_0;
} else if (z <= -1.48e+150) {
tmp = t_2;
} else if (z <= -6.6e+109) {
tmp = t_0;
} else if (z <= -5.1e+14) {
tmp = t_2;
} else if (z <= -2.9e-54) {
tmp = t_1;
} else if (z <= 1.32e-39) {
tmp = x;
} else if (z <= 2.6e+116) {
tmp = t_0;
} else if (z <= 7.2e+149) {
tmp = t_2;
} else if (z <= 3e+184) {
tmp = t_1;
} else {
tmp = x * (z * -6.0);
}
return tmp;
}
def code(x, y, z): t_0 = y * (6.0 * z) t_1 = 6.0 * (z * y) t_2 = -6.0 * (x * z) tmp = 0 if z <= -2.2e+237: tmp = t_0 elif z <= -1.48e+150: tmp = t_2 elif z <= -6.6e+109: tmp = t_0 elif z <= -5.1e+14: tmp = t_2 elif z <= -2.9e-54: tmp = t_1 elif z <= 1.32e-39: tmp = x elif z <= 2.6e+116: tmp = t_0 elif z <= 7.2e+149: tmp = t_2 elif z <= 3e+184: tmp = t_1 else: tmp = x * (z * -6.0) return tmp
function code(x, y, z) t_0 = Float64(y * Float64(6.0 * z)) t_1 = Float64(6.0 * Float64(z * y)) t_2 = Float64(-6.0 * Float64(x * z)) tmp = 0.0 if (z <= -2.2e+237) tmp = t_0; elseif (z <= -1.48e+150) tmp = t_2; elseif (z <= -6.6e+109) tmp = t_0; elseif (z <= -5.1e+14) tmp = t_2; elseif (z <= -2.9e-54) tmp = t_1; elseif (z <= 1.32e-39) tmp = x; elseif (z <= 2.6e+116) tmp = t_0; elseif (z <= 7.2e+149) tmp = t_2; elseif (z <= 3e+184) tmp = t_1; else tmp = Float64(x * Float64(z * -6.0)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (6.0 * z); t_1 = 6.0 * (z * y); t_2 = -6.0 * (x * z); tmp = 0.0; if (z <= -2.2e+237) tmp = t_0; elseif (z <= -1.48e+150) tmp = t_2; elseif (z <= -6.6e+109) tmp = t_0; elseif (z <= -5.1e+14) tmp = t_2; elseif (z <= -2.9e-54) tmp = t_1; elseif (z <= 1.32e-39) tmp = x; elseif (z <= 2.6e+116) tmp = t_0; elseif (z <= 7.2e+149) tmp = t_2; elseif (z <= 3e+184) tmp = t_1; else tmp = x * (z * -6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(6.0 * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.2e+237], t$95$0, If[LessEqual[z, -1.48e+150], t$95$2, If[LessEqual[z, -6.6e+109], t$95$0, If[LessEqual[z, -5.1e+14], t$95$2, If[LessEqual[z, -2.9e-54], t$95$1, If[LessEqual[z, 1.32e-39], x, If[LessEqual[z, 2.6e+116], t$95$0, If[LessEqual[z, 7.2e+149], t$95$2, If[LessEqual[z, 3e+184], t$95$1, N[(x * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(6 \cdot z\right)\\
t_1 := 6 \cdot \left(z \cdot y\right)\\
t_2 := -6 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -2.2 \cdot 10^{+237}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.48 \cdot 10^{+150}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -6.6 \cdot 10^{+109}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -5.1 \cdot 10^{+14}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{-54}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.32 \cdot 10^{-39}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{+116}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{+149}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+184}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot -6\right)\\
\end{array}
\end{array}
if z < -2.2e237 or -1.47999999999999991e150 < z < -6.5999999999999998e109 or 1.31999999999999997e-39 < z < 2.59999999999999987e116Initial program 99.6%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 87.4%
Taylor expanded in y around inf 66.4%
*-commutative66.4%
associate-*r*66.5%
Simplified66.5%
if -2.2e237 < z < -1.47999999999999991e150 or -6.5999999999999998e109 < z < -5.1e14 or 2.59999999999999987e116 < z < 7.1999999999999999e149Initial program 99.8%
Taylor expanded in z around 0 99.8%
Taylor expanded in z around inf 99.8%
Taylor expanded in y around 0 70.3%
if -5.1e14 < z < -2.90000000000000015e-54 or 7.1999999999999999e149 < z < 2.99999999999999986e184Initial program 99.7%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 90.1%
Taylor expanded in y around inf 84.5%
*-commutative84.5%
Simplified84.5%
if -2.90000000000000015e-54 < z < 1.31999999999999997e-39Initial program 99.9%
Taylor expanded in z around 0 77.8%
if 2.99999999999999986e184 < z Initial program 99.8%
Taylor expanded in x around inf 60.6%
Taylor expanded in z around inf 60.6%
Final simplification72.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (* 6.0 z))) (t_1 (* z (* x -6.0))) (t_2 (* 6.0 (* z y))))
(if (<= z -2.85e+237)
t_0
(if (<= z -2.95e+149)
(* -6.0 (* x z))
(if (<= z -3.3e+98)
t_0
(if (<= z -1.55e+14)
t_1
(if (<= z -4e-54)
t_2
(if (<= z 1.55e-39)
x
(if (<= z 2.3e+114)
t_0
(if (<= z 2.6e+149)
t_1
(if (<= z 1.45e+183) t_2 (* x (* z -6.0)))))))))))))
double code(double x, double y, double z) {
double t_0 = y * (6.0 * z);
double t_1 = z * (x * -6.0);
double t_2 = 6.0 * (z * y);
double tmp;
if (z <= -2.85e+237) {
tmp = t_0;
} else if (z <= -2.95e+149) {
tmp = -6.0 * (x * z);
} else if (z <= -3.3e+98) {
tmp = t_0;
} else if (z <= -1.55e+14) {
tmp = t_1;
} else if (z <= -4e-54) {
tmp = t_2;
} else if (z <= 1.55e-39) {
tmp = x;
} else if (z <= 2.3e+114) {
tmp = t_0;
} else if (z <= 2.6e+149) {
tmp = t_1;
} else if (z <= 1.45e+183) {
tmp = t_2;
} else {
tmp = x * (z * -6.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = y * (6.0d0 * z)
t_1 = z * (x * (-6.0d0))
t_2 = 6.0d0 * (z * y)
if (z <= (-2.85d+237)) then
tmp = t_0
else if (z <= (-2.95d+149)) then
tmp = (-6.0d0) * (x * z)
else if (z <= (-3.3d+98)) then
tmp = t_0
else if (z <= (-1.55d+14)) then
tmp = t_1
else if (z <= (-4d-54)) then
tmp = t_2
else if (z <= 1.55d-39) then
tmp = x
else if (z <= 2.3d+114) then
tmp = t_0
else if (z <= 2.6d+149) then
tmp = t_1
else if (z <= 1.45d+183) then
tmp = t_2
else
tmp = x * (z * (-6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (6.0 * z);
double t_1 = z * (x * -6.0);
double t_2 = 6.0 * (z * y);
double tmp;
if (z <= -2.85e+237) {
tmp = t_0;
} else if (z <= -2.95e+149) {
tmp = -6.0 * (x * z);
} else if (z <= -3.3e+98) {
tmp = t_0;
} else if (z <= -1.55e+14) {
tmp = t_1;
} else if (z <= -4e-54) {
tmp = t_2;
} else if (z <= 1.55e-39) {
tmp = x;
} else if (z <= 2.3e+114) {
tmp = t_0;
} else if (z <= 2.6e+149) {
tmp = t_1;
} else if (z <= 1.45e+183) {
tmp = t_2;
} else {
tmp = x * (z * -6.0);
}
return tmp;
}
def code(x, y, z): t_0 = y * (6.0 * z) t_1 = z * (x * -6.0) t_2 = 6.0 * (z * y) tmp = 0 if z <= -2.85e+237: tmp = t_0 elif z <= -2.95e+149: tmp = -6.0 * (x * z) elif z <= -3.3e+98: tmp = t_0 elif z <= -1.55e+14: tmp = t_1 elif z <= -4e-54: tmp = t_2 elif z <= 1.55e-39: tmp = x elif z <= 2.3e+114: tmp = t_0 elif z <= 2.6e+149: tmp = t_1 elif z <= 1.45e+183: tmp = t_2 else: tmp = x * (z * -6.0) return tmp
function code(x, y, z) t_0 = Float64(y * Float64(6.0 * z)) t_1 = Float64(z * Float64(x * -6.0)) t_2 = Float64(6.0 * Float64(z * y)) tmp = 0.0 if (z <= -2.85e+237) tmp = t_0; elseif (z <= -2.95e+149) tmp = Float64(-6.0 * Float64(x * z)); elseif (z <= -3.3e+98) tmp = t_0; elseif (z <= -1.55e+14) tmp = t_1; elseif (z <= -4e-54) tmp = t_2; elseif (z <= 1.55e-39) tmp = x; elseif (z <= 2.3e+114) tmp = t_0; elseif (z <= 2.6e+149) tmp = t_1; elseif (z <= 1.45e+183) tmp = t_2; else tmp = Float64(x * Float64(z * -6.0)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (6.0 * z); t_1 = z * (x * -6.0); t_2 = 6.0 * (z * y); tmp = 0.0; if (z <= -2.85e+237) tmp = t_0; elseif (z <= -2.95e+149) tmp = -6.0 * (x * z); elseif (z <= -3.3e+98) tmp = t_0; elseif (z <= -1.55e+14) tmp = t_1; elseif (z <= -4e-54) tmp = t_2; elseif (z <= 1.55e-39) tmp = x; elseif (z <= 2.3e+114) tmp = t_0; elseif (z <= 2.6e+149) tmp = t_1; elseif (z <= 1.45e+183) tmp = t_2; else tmp = x * (z * -6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(6.0 * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(z * N[(x * -6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.85e+237], t$95$0, If[LessEqual[z, -2.95e+149], N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.3e+98], t$95$0, If[LessEqual[z, -1.55e+14], t$95$1, If[LessEqual[z, -4e-54], t$95$2, If[LessEqual[z, 1.55e-39], x, If[LessEqual[z, 2.3e+114], t$95$0, If[LessEqual[z, 2.6e+149], t$95$1, If[LessEqual[z, 1.45e+183], t$95$2, N[(x * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(6 \cdot z\right)\\
t_1 := z \cdot \left(x \cdot -6\right)\\
t_2 := 6 \cdot \left(z \cdot y\right)\\
\mathbf{if}\;z \leq -2.85 \cdot 10^{+237}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -2.95 \cdot 10^{+149}:\\
\;\;\;\;-6 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;z \leq -3.3 \cdot 10^{+98}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.55 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -4 \cdot 10^{-54}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{-39}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+114}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{+149}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+183}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot -6\right)\\
\end{array}
\end{array}
if z < -2.84999999999999997e237 or -2.9500000000000001e149 < z < -3.30000000000000028e98 or 1.54999999999999985e-39 < z < 2.3e114Initial program 99.6%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 87.4%
Taylor expanded in y around inf 66.4%
*-commutative66.4%
associate-*r*66.5%
Simplified66.5%
if -2.84999999999999997e237 < z < -2.9500000000000001e149Initial program 99.8%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 99.7%
Taylor expanded in y around 0 68.6%
if -3.30000000000000028e98 < z < -1.55e14 or 2.3e114 < z < 2.59999999999999979e149Initial program 99.8%
Taylor expanded in z around 0 99.8%
Taylor expanded in z around inf 99.8%
Taylor expanded in y around 0 71.9%
*-commutative71.9%
associate-*r*71.9%
*-commutative71.9%
associate-*r*72.0%
Simplified72.0%
if -1.55e14 < z < -4.0000000000000001e-54 or 2.59999999999999979e149 < z < 1.45e183Initial program 99.7%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 90.1%
Taylor expanded in y around inf 84.5%
*-commutative84.5%
Simplified84.5%
if -4.0000000000000001e-54 < z < 1.54999999999999985e-39Initial program 99.9%
Taylor expanded in z around 0 77.8%
if 1.45e183 < z Initial program 99.8%
Taylor expanded in x around inf 60.6%
Taylor expanded in z around inf 60.6%
Final simplification72.5%
(FPCore (x y z) :precision binary64 (if (<= z -6.6) (* 6.0 (* z (- y x))) (if (<= z 0.17) (+ x (* z (* 6.0 y))) (* z (/ 6.0 (/ 1.0 (- y x)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -6.6) {
tmp = 6.0 * (z * (y - x));
} else if (z <= 0.17) {
tmp = x + (z * (6.0 * y));
} else {
tmp = z * (6.0 / (1.0 / (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 (z <= (-6.6d0)) then
tmp = 6.0d0 * (z * (y - x))
else if (z <= 0.17d0) then
tmp = x + (z * (6.0d0 * y))
else
tmp = z * (6.0d0 / (1.0d0 / (y - x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -6.6) {
tmp = 6.0 * (z * (y - x));
} else if (z <= 0.17) {
tmp = x + (z * (6.0 * y));
} else {
tmp = z * (6.0 / (1.0 / (y - x)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -6.6: tmp = 6.0 * (z * (y - x)) elif z <= 0.17: tmp = x + (z * (6.0 * y)) else: tmp = z * (6.0 / (1.0 / (y - x))) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -6.6) tmp = Float64(6.0 * Float64(z * Float64(y - x))); elseif (z <= 0.17) tmp = Float64(x + Float64(z * Float64(6.0 * y))); else tmp = Float64(z * Float64(6.0 / Float64(1.0 / Float64(y - x)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -6.6) tmp = 6.0 * (z * (y - x)); elseif (z <= 0.17) tmp = x + (z * (6.0 * y)); else tmp = z * (6.0 / (1.0 / (y - x))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -6.6], N[(6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.17], N[(x + N[(z * N[(6.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(6.0 / N[(1.0 / N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6:\\
\;\;\;\;6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\mathbf{elif}\;z \leq 0.17:\\
\;\;\;\;x + z \cdot \left(6 \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{6}{\frac{1}{y - x}}\\
\end{array}
\end{array}
if z < -6.5999999999999996Initial program 99.7%
Taylor expanded in z around 0 99.8%
Taylor expanded in z around inf 99.8%
if -6.5999999999999996 < z < 0.170000000000000012Initial program 99.9%
Taylor expanded in y around inf 98.5%
if 0.170000000000000012 < z Initial program 99.7%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 98.1%
Taylor expanded in y around 0 95.0%
+-commutative95.0%
*-commutative95.0%
metadata-eval95.0%
cancel-sign-sub-inv95.0%
associate-*l*95.0%
unsub-neg95.0%
*-commutative95.0%
associate-*l*95.0%
distribute-rgt-neg-out95.0%
distribute-lft-out98.1%
sub-neg98.1%
*-commutative98.1%
associate-*r*98.0%
Simplified98.0%
associate-*r*98.1%
flip--73.6%
associate-*r/63.5%
pow263.5%
pow263.5%
Applied egg-rr63.5%
associate-/l*73.6%
*-commutative73.6%
associate-/l*73.6%
associate-/r/73.7%
unpow273.7%
unpow273.7%
difference-of-squares76.8%
associate-/r*98.2%
*-inverses98.2%
Simplified98.2%
Final simplification98.7%
(FPCore (x y z) :precision binary64 (if (or (<= z -6.5e-54) (not (<= z 1.5e-39))) (* 6.0 (* z (- y x))) x))
double code(double x, double y, double z) {
double tmp;
if ((z <= -6.5e-54) || !(z <= 1.5e-39)) {
tmp = 6.0 * (z * (y - x));
} else {
tmp = 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 ((z <= (-6.5d-54)) .or. (.not. (z <= 1.5d-39))) then
tmp = 6.0d0 * (z * (y - x))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -6.5e-54) || !(z <= 1.5e-39)) {
tmp = 6.0 * (z * (y - x));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -6.5e-54) or not (z <= 1.5e-39): tmp = 6.0 * (z * (y - x)) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -6.5e-54) || !(z <= 1.5e-39)) tmp = Float64(6.0 * Float64(z * Float64(y - x))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -6.5e-54) || ~((z <= 1.5e-39))) tmp = 6.0 * (z * (y - x)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -6.5e-54], N[Not[LessEqual[z, 1.5e-39]], $MachinePrecision]], N[(6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{-54} \lor \neg \left(z \leq 1.5 \cdot 10^{-39}\right):\\
\;\;\;\;6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -6.49999999999999991e-54 or 1.50000000000000014e-39 < z Initial program 99.7%
Taylor expanded in z around 0 99.8%
Taylor expanded in z around inf 93.9%
if -6.49999999999999991e-54 < z < 1.50000000000000014e-39Initial program 99.9%
Taylor expanded in z around 0 77.8%
Final simplification87.3%
(FPCore (x y z) :precision binary64 (if (or (<= z -3.6e-54) (not (<= z 550.0))) (* 6.0 (* z (- y x))) (* x (+ 1.0 (* z -6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -3.6e-54) || !(z <= 550.0)) {
tmp = 6.0 * (z * (y - x));
} else {
tmp = x * (1.0 + (z * -6.0));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-3.6d-54)) .or. (.not. (z <= 550.0d0))) then
tmp = 6.0d0 * (z * (y - x))
else
tmp = x * (1.0d0 + (z * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -3.6e-54) || !(z <= 550.0)) {
tmp = 6.0 * (z * (y - x));
} else {
tmp = x * (1.0 + (z * -6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -3.6e-54) or not (z <= 550.0): tmp = 6.0 * (z * (y - x)) else: tmp = x * (1.0 + (z * -6.0)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -3.6e-54) || !(z <= 550.0)) tmp = Float64(6.0 * Float64(z * Float64(y - x))); else tmp = Float64(x * Float64(1.0 + Float64(z * -6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -3.6e-54) || ~((z <= 550.0))) tmp = 6.0 * (z * (y - x)); else tmp = x * (1.0 + (z * -6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -3.6e-54], N[Not[LessEqual[z, 550.0]], $MachinePrecision]], N[(6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{-54} \lor \neg \left(z \leq 550\right):\\
\;\;\;\;6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 + z \cdot -6\right)\\
\end{array}
\end{array}
if z < -3.59999999999999976e-54 or 550 < z Initial program 99.7%
Taylor expanded in z around 0 99.8%
Taylor expanded in z around inf 98.1%
if -3.59999999999999976e-54 < z < 550Initial program 99.9%
Taylor expanded in x around inf 74.9%
Final simplification87.4%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.05e+14) (not (<= z 0.17))) (* 6.0 (* z (- y x))) (+ x (* 6.0 (* z y)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.05e+14) || !(z <= 0.17)) {
tmp = 6.0 * (z * (y - x));
} else {
tmp = x + (6.0 * (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 <= (-1.05d+14)) .or. (.not. (z <= 0.17d0))) then
tmp = 6.0d0 * (z * (y - x))
else
tmp = x + (6.0d0 * (z * y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.05e+14) || !(z <= 0.17)) {
tmp = 6.0 * (z * (y - x));
} else {
tmp = x + (6.0 * (z * y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.05e+14) or not (z <= 0.17): tmp = 6.0 * (z * (y - x)) else: tmp = x + (6.0 * (z * y)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.05e+14) || !(z <= 0.17)) tmp = Float64(6.0 * Float64(z * Float64(y - x))); else tmp = Float64(x + Float64(6.0 * Float64(z * y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.05e+14) || ~((z <= 0.17))) tmp = 6.0 * (z * (y - x)); else tmp = x + (6.0 * (z * y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.05e+14], N[Not[LessEqual[z, 0.17]], $MachinePrecision]], N[(6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{+14} \lor \neg \left(z \leq 0.17\right):\\
\;\;\;\;6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + 6 \cdot \left(z \cdot y\right)\\
\end{array}
\end{array}
if z < -1.05e14 or 0.170000000000000012 < z Initial program 99.7%
Taylor expanded in z around 0 99.8%
Taylor expanded in z around inf 98.9%
if -1.05e14 < z < 0.170000000000000012Initial program 99.9%
Taylor expanded in y around inf 98.5%
*-commutative98.5%
Simplified98.5%
Final simplification98.7%
(FPCore (x y z) :precision binary64 (if (or (<= z -6.6) (not (<= z 0.17))) (* 6.0 (* z (- y x))) (+ x (* z (* 6.0 y)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -6.6) || !(z <= 0.17)) {
tmp = 6.0 * (z * (y - x));
} else {
tmp = x + (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 ((z <= (-6.6d0)) .or. (.not. (z <= 0.17d0))) then
tmp = 6.0d0 * (z * (y - x))
else
tmp = x + (z * (6.0d0 * y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -6.6) || !(z <= 0.17)) {
tmp = 6.0 * (z * (y - x));
} else {
tmp = x + (z * (6.0 * y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -6.6) or not (z <= 0.17): tmp = 6.0 * (z * (y - x)) else: tmp = x + (z * (6.0 * y)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -6.6) || !(z <= 0.17)) tmp = Float64(6.0 * Float64(z * Float64(y - x))); else tmp = Float64(x + Float64(z * Float64(6.0 * y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -6.6) || ~((z <= 0.17))) tmp = 6.0 * (z * (y - x)); else tmp = x + (z * (6.0 * y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -6.6], N[Not[LessEqual[z, 0.17]], $MachinePrecision]], N[(6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(6.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \lor \neg \left(z \leq 0.17\right):\\
\;\;\;\;6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(6 \cdot y\right)\\
\end{array}
\end{array}
if z < -6.5999999999999996 or 0.170000000000000012 < z Initial program 99.7%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 98.9%
if -6.5999999999999996 < z < 0.170000000000000012Initial program 99.9%
Taylor expanded in y around inf 98.5%
Final simplification98.7%
(FPCore (x y z) :precision binary64 (if (or (<= z -6.6e-9) (not (<= z 0.17))) (* -6.0 (* x z)) x))
double code(double x, double y, double z) {
double tmp;
if ((z <= -6.6e-9) || !(z <= 0.17)) {
tmp = -6.0 * (x * z);
} else {
tmp = 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 ((z <= (-6.6d-9)) .or. (.not. (z <= 0.17d0))) then
tmp = (-6.0d0) * (x * z)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -6.6e-9) || !(z <= 0.17)) {
tmp = -6.0 * (x * z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -6.6e-9) or not (z <= 0.17): tmp = -6.0 * (x * z) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -6.6e-9) || !(z <= 0.17)) tmp = Float64(-6.0 * Float64(x * z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -6.6e-9) || ~((z <= 0.17))) tmp = -6.0 * (x * z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -6.6e-9], N[Not[LessEqual[z, 0.17]], $MachinePrecision]], N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{-9} \lor \neg \left(z \leq 0.17\right):\\
\;\;\;\;-6 \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -6.60000000000000037e-9 or 0.170000000000000012 < z Initial program 99.7%
Taylor expanded in z around 0 99.8%
Taylor expanded in z around inf 99.0%
Taylor expanded in y around 0 48.4%
if -6.60000000000000037e-9 < z < 0.170000000000000012Initial program 99.9%
Taylor expanded in z around 0 71.9%
Final simplification59.6%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.8%
Taylor expanded in z around 0 35.8%
Final simplification35.8%
(FPCore (x y z) :precision binary64 (- x (* (* 6.0 z) (- x y))))
double code(double x, double y, double z) {
return x - ((6.0 * z) * (x - 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 - ((6.0d0 * z) * (x - y))
end function
public static double code(double x, double y, double z) {
return x - ((6.0 * z) * (x - y));
}
def code(x, y, z): return x - ((6.0 * z) * (x - y))
function code(x, y, z) return Float64(x - Float64(Float64(6.0 * z) * Float64(x - y))) end
function tmp = code(x, y, z) tmp = x - ((6.0 * z) * (x - y)); end
code[x_, y_, z_] := N[(x - N[(N[(6.0 * z), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \left(6 \cdot z\right) \cdot \left(x - y\right)
\end{array}
herbie shell --seed 2024031
(FPCore (x y z)
:name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, E"
:precision binary64
:herbie-target
(- x (* (* 6.0 z) (- x y)))
(+ x (* (* (- y x) 6.0) z)))