
(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 (fma (- y x) (* 6.0 z) x))
double code(double x, double y, double z) {
return fma((y - x), (6.0 * z), x);
}
function code(x, y, z) return fma(Float64(y - x), Float64(6.0 * z), x) end
code[x_, y_, z_] := N[(N[(y - x), $MachinePrecision] * N[(6.0 * z), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - x, 6 \cdot z, x\right)
\end{array}
Initial program 99.4%
+-commutative99.4%
associate-*l*99.8%
fma-def99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* x z))) (t_1 (* 6.0 (* y z))))
(if (<= z -5.2e+248)
t_0
(if (<= z -6e+190)
t_1
(if (<= z -1.6e+63)
t_0
(if (<= z -4.3e-65)
t_1
(if (<= z 1.12e-175)
x
(if (<= z 1.05e-123)
t_1
(if (<= z 5.2e-18)
x
(if (or (<= z 4.2e+82)
(and (not (<= z 5.6e+233)) (<= z 1.55e+264)))
t_1
t_0))))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (x * z);
double t_1 = 6.0 * (y * z);
double tmp;
if (z <= -5.2e+248) {
tmp = t_0;
} else if (z <= -6e+190) {
tmp = t_1;
} else if (z <= -1.6e+63) {
tmp = t_0;
} else if (z <= -4.3e-65) {
tmp = t_1;
} else if (z <= 1.12e-175) {
tmp = x;
} else if (z <= 1.05e-123) {
tmp = t_1;
} else if (z <= 5.2e-18) {
tmp = x;
} else if ((z <= 4.2e+82) || (!(z <= 5.6e+233) && (z <= 1.55e+264))) {
tmp = t_1;
} else {
tmp = t_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) * (x * z)
t_1 = 6.0d0 * (y * z)
if (z <= (-5.2d+248)) then
tmp = t_0
else if (z <= (-6d+190)) then
tmp = t_1
else if (z <= (-1.6d+63)) then
tmp = t_0
else if (z <= (-4.3d-65)) then
tmp = t_1
else if (z <= 1.12d-175) then
tmp = x
else if (z <= 1.05d-123) then
tmp = t_1
else if (z <= 5.2d-18) then
tmp = x
else if ((z <= 4.2d+82) .or. (.not. (z <= 5.6d+233)) .and. (z <= 1.55d+264)) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (x * z);
double t_1 = 6.0 * (y * z);
double tmp;
if (z <= -5.2e+248) {
tmp = t_0;
} else if (z <= -6e+190) {
tmp = t_1;
} else if (z <= -1.6e+63) {
tmp = t_0;
} else if (z <= -4.3e-65) {
tmp = t_1;
} else if (z <= 1.12e-175) {
tmp = x;
} else if (z <= 1.05e-123) {
tmp = t_1;
} else if (z <= 5.2e-18) {
tmp = x;
} else if ((z <= 4.2e+82) || (!(z <= 5.6e+233) && (z <= 1.55e+264))) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (x * z) t_1 = 6.0 * (y * z) tmp = 0 if z <= -5.2e+248: tmp = t_0 elif z <= -6e+190: tmp = t_1 elif z <= -1.6e+63: tmp = t_0 elif z <= -4.3e-65: tmp = t_1 elif z <= 1.12e-175: tmp = x elif z <= 1.05e-123: tmp = t_1 elif z <= 5.2e-18: tmp = x elif (z <= 4.2e+82) or (not (z <= 5.6e+233) and (z <= 1.55e+264)): tmp = t_1 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(x * z)) t_1 = Float64(6.0 * Float64(y * z)) tmp = 0.0 if (z <= -5.2e+248) tmp = t_0; elseif (z <= -6e+190) tmp = t_1; elseif (z <= -1.6e+63) tmp = t_0; elseif (z <= -4.3e-65) tmp = t_1; elseif (z <= 1.12e-175) tmp = x; elseif (z <= 1.05e-123) tmp = t_1; elseif (z <= 5.2e-18) tmp = x; elseif ((z <= 4.2e+82) || (!(z <= 5.6e+233) && (z <= 1.55e+264))) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (x * z); t_1 = 6.0 * (y * z); tmp = 0.0; if (z <= -5.2e+248) tmp = t_0; elseif (z <= -6e+190) tmp = t_1; elseif (z <= -1.6e+63) tmp = t_0; elseif (z <= -4.3e-65) tmp = t_1; elseif (z <= 1.12e-175) tmp = x; elseif (z <= 1.05e-123) tmp = t_1; elseif (z <= 5.2e-18) tmp = x; elseif ((z <= 4.2e+82) || (~((z <= 5.6e+233)) && (z <= 1.55e+264))) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.2e+248], t$95$0, If[LessEqual[z, -6e+190], t$95$1, If[LessEqual[z, -1.6e+63], t$95$0, If[LessEqual[z, -4.3e-65], t$95$1, If[LessEqual[z, 1.12e-175], x, If[LessEqual[z, 1.05e-123], t$95$1, If[LessEqual[z, 5.2e-18], x, If[Or[LessEqual[z, 4.2e+82], And[N[Not[LessEqual[z, 5.6e+233]], $MachinePrecision], LessEqual[z, 1.55e+264]]], t$95$1, t$95$0]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(x \cdot z\right)\\
t_1 := 6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -5.2 \cdot 10^{+248}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -6 \cdot 10^{+190}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{+63}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -4.3 \cdot 10^{-65}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{-175}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-123}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{-18}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+82} \lor \neg \left(z \leq 5.6 \cdot 10^{+233}\right) \land z \leq 1.55 \cdot 10^{+264}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -5.20000000000000019e248 or -5.99999999999999964e190 < z < -1.60000000000000006e63 or 4.2e82 < z < 5.60000000000000021e233 or 1.54999999999999991e264 < z Initial 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 71.8%
if -5.20000000000000019e248 < z < -5.99999999999999964e190 or -1.60000000000000006e63 < z < -4.30000000000000024e-65 or 1.1200000000000001e-175 < z < 1.05e-123 or 5.2000000000000001e-18 < z < 4.2e82 or 5.60000000000000021e233 < z < 1.54999999999999991e264Initial program 98.5%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 84.1%
Taylor expanded in y around inf 68.3%
*-commutative68.3%
Simplified68.3%
if -4.30000000000000024e-65 < z < 1.1200000000000001e-175 or 1.05e-123 < z < 5.2000000000000001e-18Initial program 99.9%
Taylor expanded in z around 0 76.4%
Final simplification72.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (* x -6.0))) (t_1 (* 6.0 (* y z))))
(if (<= z -3.5e+254)
t_0
(if (<= z -3.3e+190)
t_1
(if (<= z -1.35e+71)
t_0
(if (<= z -5e-65)
t_1
(if (<= z 1.12e-175)
x
(if (<= z 1.05e-123)
t_1
(if (<= z 8.5e-19)
x
(if (or (<= z 1.38e+84)
(and (not (<= z 2.55e+237)) (<= z 9.6e+262)))
t_1
t_0))))))))))
double code(double x, double y, double z) {
double t_0 = z * (x * -6.0);
double t_1 = 6.0 * (y * z);
double tmp;
if (z <= -3.5e+254) {
tmp = t_0;
} else if (z <= -3.3e+190) {
tmp = t_1;
} else if (z <= -1.35e+71) {
tmp = t_0;
} else if (z <= -5e-65) {
tmp = t_1;
} else if (z <= 1.12e-175) {
tmp = x;
} else if (z <= 1.05e-123) {
tmp = t_1;
} else if (z <= 8.5e-19) {
tmp = x;
} else if ((z <= 1.38e+84) || (!(z <= 2.55e+237) && (z <= 9.6e+262))) {
tmp = t_1;
} else {
tmp = t_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 = z * (x * (-6.0d0))
t_1 = 6.0d0 * (y * z)
if (z <= (-3.5d+254)) then
tmp = t_0
else if (z <= (-3.3d+190)) then
tmp = t_1
else if (z <= (-1.35d+71)) then
tmp = t_0
else if (z <= (-5d-65)) then
tmp = t_1
else if (z <= 1.12d-175) then
tmp = x
else if (z <= 1.05d-123) then
tmp = t_1
else if (z <= 8.5d-19) then
tmp = x
else if ((z <= 1.38d+84) .or. (.not. (z <= 2.55d+237)) .and. (z <= 9.6d+262)) then
tmp = t_1
else
tmp = t_0
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 = 6.0 * (y * z);
double tmp;
if (z <= -3.5e+254) {
tmp = t_0;
} else if (z <= -3.3e+190) {
tmp = t_1;
} else if (z <= -1.35e+71) {
tmp = t_0;
} else if (z <= -5e-65) {
tmp = t_1;
} else if (z <= 1.12e-175) {
tmp = x;
} else if (z <= 1.05e-123) {
tmp = t_1;
} else if (z <= 8.5e-19) {
tmp = x;
} else if ((z <= 1.38e+84) || (!(z <= 2.55e+237) && (z <= 9.6e+262))) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * (x * -6.0) t_1 = 6.0 * (y * z) tmp = 0 if z <= -3.5e+254: tmp = t_0 elif z <= -3.3e+190: tmp = t_1 elif z <= -1.35e+71: tmp = t_0 elif z <= -5e-65: tmp = t_1 elif z <= 1.12e-175: tmp = x elif z <= 1.05e-123: tmp = t_1 elif z <= 8.5e-19: tmp = x elif (z <= 1.38e+84) or (not (z <= 2.55e+237) and (z <= 9.6e+262)): tmp = t_1 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * Float64(x * -6.0)) t_1 = Float64(6.0 * Float64(y * z)) tmp = 0.0 if (z <= -3.5e+254) tmp = t_0; elseif (z <= -3.3e+190) tmp = t_1; elseif (z <= -1.35e+71) tmp = t_0; elseif (z <= -5e-65) tmp = t_1; elseif (z <= 1.12e-175) tmp = x; elseif (z <= 1.05e-123) tmp = t_1; elseif (z <= 8.5e-19) tmp = x; elseif ((z <= 1.38e+84) || (!(z <= 2.55e+237) && (z <= 9.6e+262))) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * (x * -6.0); t_1 = 6.0 * (y * z); tmp = 0.0; if (z <= -3.5e+254) tmp = t_0; elseif (z <= -3.3e+190) tmp = t_1; elseif (z <= -1.35e+71) tmp = t_0; elseif (z <= -5e-65) tmp = t_1; elseif (z <= 1.12e-175) tmp = x; elseif (z <= 1.05e-123) tmp = t_1; elseif (z <= 8.5e-19) tmp = x; elseif ((z <= 1.38e+84) || (~((z <= 2.55e+237)) && (z <= 9.6e+262))) tmp = t_1; else tmp = t_0; 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[(6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.5e+254], t$95$0, If[LessEqual[z, -3.3e+190], t$95$1, If[LessEqual[z, -1.35e+71], t$95$0, If[LessEqual[z, -5e-65], t$95$1, If[LessEqual[z, 1.12e-175], x, If[LessEqual[z, 1.05e-123], t$95$1, If[LessEqual[z, 8.5e-19], x, If[Or[LessEqual[z, 1.38e+84], And[N[Not[LessEqual[z, 2.55e+237]], $MachinePrecision], LessEqual[z, 9.6e+262]]], t$95$1, t$95$0]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(x \cdot -6\right)\\
t_1 := 6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -3.5 \cdot 10^{+254}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -3.3 \cdot 10^{+190}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.35 \cdot 10^{+71}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -5 \cdot 10^{-65}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{-175}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-123}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-19}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.38 \cdot 10^{+84} \lor \neg \left(z \leq 2.55 \cdot 10^{+237}\right) \land z \leq 9.6 \cdot 10^{+262}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -3.50000000000000017e254 or -3.3e190 < z < -1.34999999999999998e71 or 1.38e84 < z < 2.54999999999999989e237 or 9.59999999999999932e262 < z Initial 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 71.8%
*-commutative71.8%
associate-*r*72.0%
*-commutative72.0%
Simplified72.0%
if -3.50000000000000017e254 < z < -3.3e190 or -1.34999999999999998e71 < z < -4.99999999999999983e-65 or 1.1200000000000001e-175 < z < 1.05e-123 or 8.50000000000000003e-19 < z < 1.38e84 or 2.54999999999999989e237 < z < 9.59999999999999932e262Initial program 98.5%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 84.1%
Taylor expanded in y around inf 68.3%
*-commutative68.3%
Simplified68.3%
if -4.99999999999999983e-65 < z < 1.1200000000000001e-175 or 1.05e-123 < z < 8.50000000000000003e-19Initial program 99.9%
Taylor expanded in z around 0 76.4%
Final simplification72.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (* x -6.0))) (t_1 (* z (* y 6.0))) (t_2 (* 6.0 (* y z))))
(if (<= z -1.6e+252)
t_0
(if (<= z -1.4e+190)
t_1
(if (<= z -8.5e+66)
t_0
(if (<= z -4.3e-65)
t_1
(if (<= z 1.12e-175)
x
(if (<= z 6.2e-122)
t_2
(if (<= z 5.6e-20)
x
(if (<= z 4.2e+82)
t_2
(if (or (<= z 2.1e+231) (not (<= z 5.4e+261)))
t_0
t_1)))))))))))
double code(double x, double y, double z) {
double t_0 = z * (x * -6.0);
double t_1 = z * (y * 6.0);
double t_2 = 6.0 * (y * z);
double tmp;
if (z <= -1.6e+252) {
tmp = t_0;
} else if (z <= -1.4e+190) {
tmp = t_1;
} else if (z <= -8.5e+66) {
tmp = t_0;
} else if (z <= -4.3e-65) {
tmp = t_1;
} else if (z <= 1.12e-175) {
tmp = x;
} else if (z <= 6.2e-122) {
tmp = t_2;
} else if (z <= 5.6e-20) {
tmp = x;
} else if (z <= 4.2e+82) {
tmp = t_2;
} else if ((z <= 2.1e+231) || !(z <= 5.4e+261)) {
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) :: t_2
real(8) :: tmp
t_0 = z * (x * (-6.0d0))
t_1 = z * (y * 6.0d0)
t_2 = 6.0d0 * (y * z)
if (z <= (-1.6d+252)) then
tmp = t_0
else if (z <= (-1.4d+190)) then
tmp = t_1
else if (z <= (-8.5d+66)) then
tmp = t_0
else if (z <= (-4.3d-65)) then
tmp = t_1
else if (z <= 1.12d-175) then
tmp = x
else if (z <= 6.2d-122) then
tmp = t_2
else if (z <= 5.6d-20) then
tmp = x
else if (z <= 4.2d+82) then
tmp = t_2
else if ((z <= 2.1d+231) .or. (.not. (z <= 5.4d+261))) 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 = z * (x * -6.0);
double t_1 = z * (y * 6.0);
double t_2 = 6.0 * (y * z);
double tmp;
if (z <= -1.6e+252) {
tmp = t_0;
} else if (z <= -1.4e+190) {
tmp = t_1;
} else if (z <= -8.5e+66) {
tmp = t_0;
} else if (z <= -4.3e-65) {
tmp = t_1;
} else if (z <= 1.12e-175) {
tmp = x;
} else if (z <= 6.2e-122) {
tmp = t_2;
} else if (z <= 5.6e-20) {
tmp = x;
} else if (z <= 4.2e+82) {
tmp = t_2;
} else if ((z <= 2.1e+231) || !(z <= 5.4e+261)) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = z * (x * -6.0) t_1 = z * (y * 6.0) t_2 = 6.0 * (y * z) tmp = 0 if z <= -1.6e+252: tmp = t_0 elif z <= -1.4e+190: tmp = t_1 elif z <= -8.5e+66: tmp = t_0 elif z <= -4.3e-65: tmp = t_1 elif z <= 1.12e-175: tmp = x elif z <= 6.2e-122: tmp = t_2 elif z <= 5.6e-20: tmp = x elif z <= 4.2e+82: tmp = t_2 elif (z <= 2.1e+231) or not (z <= 5.4e+261): tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(z * Float64(x * -6.0)) t_1 = Float64(z * Float64(y * 6.0)) t_2 = Float64(6.0 * Float64(y * z)) tmp = 0.0 if (z <= -1.6e+252) tmp = t_0; elseif (z <= -1.4e+190) tmp = t_1; elseif (z <= -8.5e+66) tmp = t_0; elseif (z <= -4.3e-65) tmp = t_1; elseif (z <= 1.12e-175) tmp = x; elseif (z <= 6.2e-122) tmp = t_2; elseif (z <= 5.6e-20) tmp = x; elseif (z <= 4.2e+82) tmp = t_2; elseif ((z <= 2.1e+231) || !(z <= 5.4e+261)) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * (x * -6.0); t_1 = z * (y * 6.0); t_2 = 6.0 * (y * z); tmp = 0.0; if (z <= -1.6e+252) tmp = t_0; elseif (z <= -1.4e+190) tmp = t_1; elseif (z <= -8.5e+66) tmp = t_0; elseif (z <= -4.3e-65) tmp = t_1; elseif (z <= 1.12e-175) tmp = x; elseif (z <= 6.2e-122) tmp = t_2; elseif (z <= 5.6e-20) tmp = x; elseif (z <= 4.2e+82) tmp = t_2; elseif ((z <= 2.1e+231) || ~((z <= 5.4e+261))) tmp = t_0; else tmp = t_1; 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[(y * 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.6e+252], t$95$0, If[LessEqual[z, -1.4e+190], t$95$1, If[LessEqual[z, -8.5e+66], t$95$0, If[LessEqual[z, -4.3e-65], t$95$1, If[LessEqual[z, 1.12e-175], x, If[LessEqual[z, 6.2e-122], t$95$2, If[LessEqual[z, 5.6e-20], x, If[LessEqual[z, 4.2e+82], t$95$2, If[Or[LessEqual[z, 2.1e+231], N[Not[LessEqual[z, 5.4e+261]], $MachinePrecision]], t$95$0, t$95$1]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(x \cdot -6\right)\\
t_1 := z \cdot \left(y \cdot 6\right)\\
t_2 := 6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -1.6 \cdot 10^{+252}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1.4 \cdot 10^{+190}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -8.5 \cdot 10^{+66}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -4.3 \cdot 10^{-65}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{-175}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{-122}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{-20}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+82}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+231} \lor \neg \left(z \leq 5.4 \cdot 10^{+261}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.6000000000000001e252 or -1.39999999999999998e190 < z < -8.5000000000000004e66 or 4.2e82 < z < 2.09999999999999984e231 or 5.40000000000000005e261 < z Initial 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 71.8%
*-commutative71.8%
associate-*r*72.0%
*-commutative72.0%
Simplified72.0%
if -1.6000000000000001e252 < z < -1.39999999999999998e190 or -8.5000000000000004e66 < z < -4.30000000000000024e-65 or 2.09999999999999984e231 < z < 5.40000000000000005e261Initial program 99.8%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 87.6%
Taylor expanded in y around inf 68.7%
associate-*r*68.8%
*-commutative68.8%
Simplified68.8%
if -4.30000000000000024e-65 < z < 1.1200000000000001e-175 or 6.1999999999999997e-122 < z < 5.6000000000000005e-20Initial program 99.9%
Taylor expanded in z around 0 76.4%
if 1.1200000000000001e-175 < z < 6.1999999999999997e-122 or 5.6000000000000005e-20 < z < 4.2e82Initial program 96.8%
Taylor expanded in z around 0 99.5%
Taylor expanded in z around inf 79.4%
Taylor expanded in y around inf 67.9%
*-commutative67.9%
Simplified67.9%
Final simplification72.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* y z))) (t_1 (* z (* x -6.0))) (t_2 (* z (* y 6.0))))
(if (<= z -6.5e+255)
(* x (* z -6.0))
(if (<= z -3e+193)
t_2
(if (<= z -1.56e+63)
t_1
(if (<= z -5e-65)
t_2
(if (<= z 1.12e-175)
x
(if (<= z 2.8e-123)
t_0
(if (<= z 7.2e-20)
x
(if (<= z 1.9e+84)
t_0
(if (or (<= z 6.8e+233) (not (<= z 1e+262)))
t_1
t_2)))))))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (y * z);
double t_1 = z * (x * -6.0);
double t_2 = z * (y * 6.0);
double tmp;
if (z <= -6.5e+255) {
tmp = x * (z * -6.0);
} else if (z <= -3e+193) {
tmp = t_2;
} else if (z <= -1.56e+63) {
tmp = t_1;
} else if (z <= -5e-65) {
tmp = t_2;
} else if (z <= 1.12e-175) {
tmp = x;
} else if (z <= 2.8e-123) {
tmp = t_0;
} else if (z <= 7.2e-20) {
tmp = x;
} else if (z <= 1.9e+84) {
tmp = t_0;
} else if ((z <= 6.8e+233) || !(z <= 1e+262)) {
tmp = t_1;
} else {
tmp = t_2;
}
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 = 6.0d0 * (y * z)
t_1 = z * (x * (-6.0d0))
t_2 = z * (y * 6.0d0)
if (z <= (-6.5d+255)) then
tmp = x * (z * (-6.0d0))
else if (z <= (-3d+193)) then
tmp = t_2
else if (z <= (-1.56d+63)) then
tmp = t_1
else if (z <= (-5d-65)) then
tmp = t_2
else if (z <= 1.12d-175) then
tmp = x
else if (z <= 2.8d-123) then
tmp = t_0
else if (z <= 7.2d-20) then
tmp = x
else if (z <= 1.9d+84) then
tmp = t_0
else if ((z <= 6.8d+233) .or. (.not. (z <= 1d+262))) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 6.0 * (y * z);
double t_1 = z * (x * -6.0);
double t_2 = z * (y * 6.0);
double tmp;
if (z <= -6.5e+255) {
tmp = x * (z * -6.0);
} else if (z <= -3e+193) {
tmp = t_2;
} else if (z <= -1.56e+63) {
tmp = t_1;
} else if (z <= -5e-65) {
tmp = t_2;
} else if (z <= 1.12e-175) {
tmp = x;
} else if (z <= 2.8e-123) {
tmp = t_0;
} else if (z <= 7.2e-20) {
tmp = x;
} else if (z <= 1.9e+84) {
tmp = t_0;
} else if ((z <= 6.8e+233) || !(z <= 1e+262)) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (y * z) t_1 = z * (x * -6.0) t_2 = z * (y * 6.0) tmp = 0 if z <= -6.5e+255: tmp = x * (z * -6.0) elif z <= -3e+193: tmp = t_2 elif z <= -1.56e+63: tmp = t_1 elif z <= -5e-65: tmp = t_2 elif z <= 1.12e-175: tmp = x elif z <= 2.8e-123: tmp = t_0 elif z <= 7.2e-20: tmp = x elif z <= 1.9e+84: tmp = t_0 elif (z <= 6.8e+233) or not (z <= 1e+262): tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(y * z)) t_1 = Float64(z * Float64(x * -6.0)) t_2 = Float64(z * Float64(y * 6.0)) tmp = 0.0 if (z <= -6.5e+255) tmp = Float64(x * Float64(z * -6.0)); elseif (z <= -3e+193) tmp = t_2; elseif (z <= -1.56e+63) tmp = t_1; elseif (z <= -5e-65) tmp = t_2; elseif (z <= 1.12e-175) tmp = x; elseif (z <= 2.8e-123) tmp = t_0; elseif (z <= 7.2e-20) tmp = x; elseif (z <= 1.9e+84) tmp = t_0; elseif ((z <= 6.8e+233) || !(z <= 1e+262)) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (y * z); t_1 = z * (x * -6.0); t_2 = z * (y * 6.0); tmp = 0.0; if (z <= -6.5e+255) tmp = x * (z * -6.0); elseif (z <= -3e+193) tmp = t_2; elseif (z <= -1.56e+63) tmp = t_1; elseif (z <= -5e-65) tmp = t_2; elseif (z <= 1.12e-175) tmp = x; elseif (z <= 2.8e-123) tmp = t_0; elseif (z <= 7.2e-20) tmp = x; elseif (z <= 1.9e+84) tmp = t_0; elseif ((z <= 6.8e+233) || ~((z <= 1e+262))) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(z * N[(x * -6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(y * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.5e+255], N[(x * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3e+193], t$95$2, If[LessEqual[z, -1.56e+63], t$95$1, If[LessEqual[z, -5e-65], t$95$2, If[LessEqual[z, 1.12e-175], x, If[LessEqual[z, 2.8e-123], t$95$0, If[LessEqual[z, 7.2e-20], x, If[LessEqual[z, 1.9e+84], t$95$0, If[Or[LessEqual[z, 6.8e+233], N[Not[LessEqual[z, 1e+262]], $MachinePrecision]], t$95$1, t$95$2]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(y \cdot z\right)\\
t_1 := z \cdot \left(x \cdot -6\right)\\
t_2 := z \cdot \left(y \cdot 6\right)\\
\mathbf{if}\;z \leq -6.5 \cdot 10^{+255}:\\
\;\;\;\;x \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq -3 \cdot 10^{+193}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.56 \cdot 10^{+63}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -5 \cdot 10^{-65}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{-175}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-123}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-20}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{+84}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{+233} \lor \neg \left(z \leq 10^{+262}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -6.50000000000000003e255Initial program 99.6%
Taylor expanded in x around inf 87.4%
Taylor expanded in z around inf 87.4%
if -6.50000000000000003e255 < z < -3e193 or -1.56e63 < z < -4.99999999999999983e-65 or 6.80000000000000044e233 < z < 1e262Initial program 99.8%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 87.6%
Taylor expanded in y around inf 68.7%
associate-*r*68.8%
*-commutative68.8%
Simplified68.8%
if -3e193 < z < -1.56e63 or 1.9e84 < z < 6.80000000000000044e233 or 1e262 < z Initial 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.4%
*-commutative68.4%
associate-*r*68.5%
*-commutative68.5%
Simplified68.5%
if -4.99999999999999983e-65 < z < 1.1200000000000001e-175 or 2.7999999999999999e-123 < z < 7.19999999999999948e-20Initial program 99.9%
Taylor expanded in z around 0 76.4%
if 1.1200000000000001e-175 < z < 2.7999999999999999e-123 or 7.19999999999999948e-20 < z < 1.9e84Initial program 96.8%
Taylor expanded in z around 0 99.5%
Taylor expanded in z around inf 79.4%
Taylor expanded in y around inf 67.9%
*-commutative67.9%
Simplified67.9%
Final simplification72.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* (- y x) z))))
(if (<= z -3.7e-65)
t_0
(if (<= z 1.12e-175)
x
(if (<= z 1.05e-123) (* 6.0 (* y z)) (if (<= z 3.6e-18) x t_0))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * ((y - x) * z);
double tmp;
if (z <= -3.7e-65) {
tmp = t_0;
} else if (z <= 1.12e-175) {
tmp = x;
} else if (z <= 1.05e-123) {
tmp = 6.0 * (y * z);
} else if (z <= 3.6e-18) {
tmp = x;
} else {
tmp = t_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) :: tmp
t_0 = 6.0d0 * ((y - x) * z)
if (z <= (-3.7d-65)) then
tmp = t_0
else if (z <= 1.12d-175) then
tmp = x
else if (z <= 1.05d-123) then
tmp = 6.0d0 * (y * z)
else if (z <= 3.6d-18) then
tmp = x
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 6.0 * ((y - x) * z);
double tmp;
if (z <= -3.7e-65) {
tmp = t_0;
} else if (z <= 1.12e-175) {
tmp = x;
} else if (z <= 1.05e-123) {
tmp = 6.0 * (y * z);
} else if (z <= 3.6e-18) {
tmp = x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * ((y - x) * z) tmp = 0 if z <= -3.7e-65: tmp = t_0 elif z <= 1.12e-175: tmp = x elif z <= 1.05e-123: tmp = 6.0 * (y * z) elif z <= 3.6e-18: tmp = x else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(Float64(y - x) * z)) tmp = 0.0 if (z <= -3.7e-65) tmp = t_0; elseif (z <= 1.12e-175) tmp = x; elseif (z <= 1.05e-123) tmp = Float64(6.0 * Float64(y * z)); elseif (z <= 3.6e-18) tmp = x; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * ((y - x) * z); tmp = 0.0; if (z <= -3.7e-65) tmp = t_0; elseif (z <= 1.12e-175) tmp = x; elseif (z <= 1.05e-123) tmp = 6.0 * (y * z); elseif (z <= 3.6e-18) tmp = x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.7e-65], t$95$0, If[LessEqual[z, 1.12e-175], x, If[LessEqual[z, 1.05e-123], N[(6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6e-18], x, t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{if}\;z \leq -3.7 \cdot 10^{-65}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{-175}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-123}:\\
\;\;\;\;6 \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-18}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -3.7e-65 or 3.6000000000000001e-18 < z Initial program 99.7%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 95.0%
if -3.7e-65 < z < 1.1200000000000001e-175 or 1.05e-123 < z < 3.6000000000000001e-18Initial program 99.9%
Taylor expanded in z around 0 76.4%
if 1.1200000000000001e-175 < z < 1.05e-123Initial program 94.4%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 67.6%
Taylor expanded in y around inf 67.9%
*-commutative67.9%
Simplified67.9%
Final simplification86.8%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.4e+59) (not (<= x 1.1e+75))) (* x (+ 1.0 (* z -6.0))) (* 6.0 (* (- y x) z))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.4e+59) || !(x <= 1.1e+75)) {
tmp = x * (1.0 + (z * -6.0));
} else {
tmp = 6.0 * ((y - x) * z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-1.4d+59)) .or. (.not. (x <= 1.1d+75))) then
tmp = x * (1.0d0 + (z * (-6.0d0)))
else
tmp = 6.0d0 * ((y - x) * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -1.4e+59) || !(x <= 1.1e+75)) {
tmp = x * (1.0 + (z * -6.0));
} else {
tmp = 6.0 * ((y - x) * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.4e+59) or not (x <= 1.1e+75): tmp = x * (1.0 + (z * -6.0)) else: tmp = 6.0 * ((y - x) * z) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.4e+59) || !(x <= 1.1e+75)) tmp = Float64(x * Float64(1.0 + Float64(z * -6.0))); else tmp = Float64(6.0 * Float64(Float64(y - x) * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.4e+59) || ~((x <= 1.1e+75))) tmp = x * (1.0 + (z * -6.0)); else tmp = 6.0 * ((y - x) * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.4e+59], N[Not[LessEqual[x, 1.1e+75]], $MachinePrecision]], N[(x * N[(1.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{+59} \lor \neg \left(x \leq 1.1 \cdot 10^{+75}\right):\\
\;\;\;\;x \cdot \left(1 + z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\end{array}
\end{array}
if x < -1.3999999999999999e59 or 1.10000000000000006e75 < x Initial program 99.9%
Taylor expanded in x around inf 95.0%
if -1.3999999999999999e59 < x < 1.10000000000000006e75Initial program 99.0%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 81.7%
Final simplification87.3%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.17) (not (<= z 0.00086))) (* 6.0 (* (- y x) z)) (+ x (* 6.0 (* y z)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.17) || !(z <= 0.00086)) {
tmp = 6.0 * ((y - x) * z);
} else {
tmp = x + (6.0 * (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 ((z <= (-0.17d0)) .or. (.not. (z <= 0.00086d0))) then
tmp = 6.0d0 * ((y - x) * z)
else
tmp = x + (6.0d0 * (y * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.17) || !(z <= 0.00086)) {
tmp = 6.0 * ((y - x) * z);
} else {
tmp = x + (6.0 * (y * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.17) or not (z <= 0.00086): tmp = 6.0 * ((y - x) * z) else: tmp = x + (6.0 * (y * z)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.17) || !(z <= 0.00086)) tmp = Float64(6.0 * Float64(Float64(y - x) * z)); else tmp = Float64(x + Float64(6.0 * Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.17) || ~((z <= 0.00086))) tmp = 6.0 * ((y - x) * z); else tmp = x + (6.0 * (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.17], N[Not[LessEqual[z, 0.00086]], $MachinePrecision]], N[(6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(x + N[(6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.17 \lor \neg \left(z \leq 0.00086\right):\\
\;\;\;\;6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + 6 \cdot \left(y \cdot z\right)\\
\end{array}
\end{array}
if z < -0.170000000000000012 or 8.59999999999999979e-4 < z Initial program 99.8%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 99.2%
if -0.170000000000000012 < z < 8.59999999999999979e-4Initial program 99.0%
Taylor expanded in y around inf 98.7%
Final simplification98.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.18) (not (<= z 0.165))) (* 6.0 (* (- y x) z)) (+ x (* y (* 6.0 z)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.18) || !(z <= 0.165)) {
tmp = 6.0 * ((y - x) * z);
} else {
tmp = x + (y * (6.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) :: tmp
if ((z <= (-0.18d0)) .or. (.not. (z <= 0.165d0))) then
tmp = 6.0d0 * ((y - x) * z)
else
tmp = x + (y * (6.0d0 * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.18) || !(z <= 0.165)) {
tmp = 6.0 * ((y - x) * z);
} else {
tmp = x + (y * (6.0 * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.18) or not (z <= 0.165): tmp = 6.0 * ((y - x) * z) else: tmp = x + (y * (6.0 * z)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.18) || !(z <= 0.165)) tmp = Float64(6.0 * Float64(Float64(y - x) * z)); else tmp = Float64(x + Float64(y * Float64(6.0 * z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.18) || ~((z <= 0.165))) tmp = 6.0 * ((y - x) * z); else tmp = x + (y * (6.0 * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.18], N[Not[LessEqual[z, 0.165]], $MachinePrecision]], N[(6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(6.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.18 \lor \neg \left(z \leq 0.165\right):\\
\;\;\;\;6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(6 \cdot z\right)\\
\end{array}
\end{array}
if z < -0.17999999999999999 or 0.165000000000000008 < z Initial program 99.8%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 99.2%
if -0.17999999999999999 < z < 0.165000000000000008Initial program 99.0%
associate-*r*99.9%
*-commutative99.9%
flip--48.4%
associate-*r/48.3%
Applied egg-rr48.3%
associate-/l*48.3%
*-commutative48.3%
associate-/l*48.3%
difference-of-squares48.4%
associate-/r*99.8%
*-inverses99.8%
Simplified99.8%
Taylor expanded in y around inf 98.6%
associate-*r*97.9%
*-commutative97.9%
associate-*r*98.7%
Simplified98.7%
Final simplification98.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.0205) (not (<= z 0.165))) (* -6.0 (* x z)) x))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.0205) || !(z <= 0.165)) {
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 <= (-0.0205d0)) .or. (.not. (z <= 0.165d0))) 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 <= -0.0205) || !(z <= 0.165)) {
tmp = -6.0 * (x * z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.0205) or not (z <= 0.165): tmp = -6.0 * (x * z) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.0205) || !(z <= 0.165)) 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 <= -0.0205) || ~((z <= 0.165))) tmp = -6.0 * (x * z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.0205], N[Not[LessEqual[z, 0.165]], $MachinePrecision]], N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.0205 \lor \neg \left(z \leq 0.165\right):\\
\;\;\;\;-6 \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -0.0205000000000000009 or 0.165000000000000008 < z Initial program 99.8%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 99.2%
Taylor expanded in y around 0 55.8%
if -0.0205000000000000009 < z < 0.165000000000000008Initial program 99.0%
Taylor expanded in z around 0 64.0%
Final simplification59.7%
(FPCore (x y z) :precision binary64 (+ x (* z (* (- y x) 6.0))))
double code(double x, double y, double z) {
return x + (z * ((y - x) * 6.0));
}
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 - x) * 6.0d0))
end function
public static double code(double x, double y, double z) {
return x + (z * ((y - x) * 6.0));
}
def code(x, y, z): return x + (z * ((y - x) * 6.0))
function code(x, y, z) return Float64(x + Float64(z * Float64(Float64(y - x) * 6.0))) end
function tmp = code(x, y, z) tmp = x + (z * ((y - x) * 6.0)); end
code[x_, y_, z_] := N[(x + N[(z * N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + z \cdot \left(\left(y - x\right) \cdot 6\right)
\end{array}
Initial program 99.4%
Final simplification99.4%
(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(y - x) * Float64(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[(y - x), $MachinePrecision] * N[(6.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - x\right) \cdot \left(6 \cdot z\right)
\end{array}
Initial program 99.4%
associate-*l*99.8%
Simplified99.8%
Final simplification99.8%
(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.4%
Taylor expanded in z around 0 32.1%
Final simplification32.1%
(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 2023182
(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)))