
(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.9%
fma-define99.9%
Simplified99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* x z))) (t_1 (* 6.0 (* y z))))
(if (<= z -2.6e+170)
t_0
(if (<= z -3.5e-19)
t_1
(if (<= z 1.85e-68)
x
(if (or (<= z 1.25e+60)
(and (not (<= z 2.45e+92))
(or (<= z 4.5e+178) (not (<= z 1.65e+223)))))
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 <= -2.6e+170) {
tmp = t_0;
} else if (z <= -3.5e-19) {
tmp = t_1;
} else if (z <= 1.85e-68) {
tmp = x;
} else if ((z <= 1.25e+60) || (!(z <= 2.45e+92) && ((z <= 4.5e+178) || !(z <= 1.65e+223)))) {
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 <= (-2.6d+170)) then
tmp = t_0
else if (z <= (-3.5d-19)) then
tmp = t_1
else if (z <= 1.85d-68) then
tmp = x
else if ((z <= 1.25d+60) .or. (.not. (z <= 2.45d+92)) .and. (z <= 4.5d+178) .or. (.not. (z <= 1.65d+223))) 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 <= -2.6e+170) {
tmp = t_0;
} else if (z <= -3.5e-19) {
tmp = t_1;
} else if (z <= 1.85e-68) {
tmp = x;
} else if ((z <= 1.25e+60) || (!(z <= 2.45e+92) && ((z <= 4.5e+178) || !(z <= 1.65e+223)))) {
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 <= -2.6e+170: tmp = t_0 elif z <= -3.5e-19: tmp = t_1 elif z <= 1.85e-68: tmp = x elif (z <= 1.25e+60) or (not (z <= 2.45e+92) and ((z <= 4.5e+178) or not (z <= 1.65e+223))): 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 <= -2.6e+170) tmp = t_0; elseif (z <= -3.5e-19) tmp = t_1; elseif (z <= 1.85e-68) tmp = x; elseif ((z <= 1.25e+60) || (!(z <= 2.45e+92) && ((z <= 4.5e+178) || !(z <= 1.65e+223)))) 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 <= -2.6e+170) tmp = t_0; elseif (z <= -3.5e-19) tmp = t_1; elseif (z <= 1.85e-68) tmp = x; elseif ((z <= 1.25e+60) || (~((z <= 2.45e+92)) && ((z <= 4.5e+178) || ~((z <= 1.65e+223))))) 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, -2.6e+170], t$95$0, If[LessEqual[z, -3.5e-19], t$95$1, If[LessEqual[z, 1.85e-68], x, If[Or[LessEqual[z, 1.25e+60], And[N[Not[LessEqual[z, 2.45e+92]], $MachinePrecision], Or[LessEqual[z, 4.5e+178], N[Not[LessEqual[z, 1.65e+223]], $MachinePrecision]]]], 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 -2.6 \cdot 10^{+170}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{-19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{-68}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+60} \lor \neg \left(z \leq 2.45 \cdot 10^{+92}\right) \land \left(z \leq 4.5 \cdot 10^{+178} \lor \neg \left(z \leq 1.65 \cdot 10^{+223}\right)\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -2.5999999999999998e170 or 1.24999999999999994e60 < z < 2.4500000000000001e92 or 4.4999999999999997e178 < z < 1.65e223Initial program 99.8%
associate-*r*99.8%
+-commutative99.8%
*-commutative99.8%
associate-*r*99.6%
fma-define99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 99.6%
associate-*r*99.8%
*-commutative99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 74.2%
*-commutative74.2%
Simplified74.2%
if -2.5999999999999998e170 < z < -3.50000000000000015e-19 or 1.85000000000000001e-68 < z < 1.24999999999999994e60 or 2.4500000000000001e92 < z < 4.4999999999999997e178 or 1.65e223 < z Initial program 99.7%
associate-*r*99.8%
+-commutative99.8%
*-commutative99.8%
associate-*r*99.7%
fma-define99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 66.0%
*-commutative66.0%
Simplified66.0%
if -3.50000000000000015e-19 < z < 1.85000000000000001e-68Initial program 99.0%
Taylor expanded in z around 0 81.5%
Final simplification74.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (* z -6.0))) (t_1 (* 6.0 (* y z))))
(if (<= z -1.25e+172)
t_0
(if (<= z -3.4e-19)
t_1
(if (<= z 3.3e-69)
x
(if (<= z 7.5e+59)
t_1
(if (<= z 3.6e+92)
(* -6.0 (* x z))
(if (or (<= z 5e+177) (not (<= z 1.7e+221))) t_1 t_0))))))))
double code(double x, double y, double z) {
double t_0 = x * (z * -6.0);
double t_1 = 6.0 * (y * z);
double tmp;
if (z <= -1.25e+172) {
tmp = t_0;
} else if (z <= -3.4e-19) {
tmp = t_1;
} else if (z <= 3.3e-69) {
tmp = x;
} else if (z <= 7.5e+59) {
tmp = t_1;
} else if (z <= 3.6e+92) {
tmp = -6.0 * (x * z);
} else if ((z <= 5e+177) || !(z <= 1.7e+221)) {
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 = x * (z * (-6.0d0))
t_1 = 6.0d0 * (y * z)
if (z <= (-1.25d+172)) then
tmp = t_0
else if (z <= (-3.4d-19)) then
tmp = t_1
else if (z <= 3.3d-69) then
tmp = x
else if (z <= 7.5d+59) then
tmp = t_1
else if (z <= 3.6d+92) then
tmp = (-6.0d0) * (x * z)
else if ((z <= 5d+177) .or. (.not. (z <= 1.7d+221))) 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 = x * (z * -6.0);
double t_1 = 6.0 * (y * z);
double tmp;
if (z <= -1.25e+172) {
tmp = t_0;
} else if (z <= -3.4e-19) {
tmp = t_1;
} else if (z <= 3.3e-69) {
tmp = x;
} else if (z <= 7.5e+59) {
tmp = t_1;
} else if (z <= 3.6e+92) {
tmp = -6.0 * (x * z);
} else if ((z <= 5e+177) || !(z <= 1.7e+221)) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (z * -6.0) t_1 = 6.0 * (y * z) tmp = 0 if z <= -1.25e+172: tmp = t_0 elif z <= -3.4e-19: tmp = t_1 elif z <= 3.3e-69: tmp = x elif z <= 7.5e+59: tmp = t_1 elif z <= 3.6e+92: tmp = -6.0 * (x * z) elif (z <= 5e+177) or not (z <= 1.7e+221): tmp = t_1 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(z * -6.0)) t_1 = Float64(6.0 * Float64(y * z)) tmp = 0.0 if (z <= -1.25e+172) tmp = t_0; elseif (z <= -3.4e-19) tmp = t_1; elseif (z <= 3.3e-69) tmp = x; elseif (z <= 7.5e+59) tmp = t_1; elseif (z <= 3.6e+92) tmp = Float64(-6.0 * Float64(x * z)); elseif ((z <= 5e+177) || !(z <= 1.7e+221)) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (z * -6.0); t_1 = 6.0 * (y * z); tmp = 0.0; if (z <= -1.25e+172) tmp = t_0; elseif (z <= -3.4e-19) tmp = t_1; elseif (z <= 3.3e-69) tmp = x; elseif (z <= 7.5e+59) tmp = t_1; elseif (z <= 3.6e+92) tmp = -6.0 * (x * z); elseif ((z <= 5e+177) || ~((z <= 1.7e+221))) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.25e+172], t$95$0, If[LessEqual[z, -3.4e-19], t$95$1, If[LessEqual[z, 3.3e-69], x, If[LessEqual[z, 7.5e+59], t$95$1, If[LessEqual[z, 3.6e+92], N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 5e+177], N[Not[LessEqual[z, 1.7e+221]], $MachinePrecision]], t$95$1, t$95$0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(z \cdot -6\right)\\
t_1 := 6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -1.25 \cdot 10^{+172}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{-19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{-69}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{+59}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+92}:\\
\;\;\;\;-6 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;z \leq 5 \cdot 10^{+177} \lor \neg \left(z \leq 1.7 \cdot 10^{+221}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -1.25e172 or 5.0000000000000003e177 < z < 1.6999999999999999e221Initial program 99.8%
associate-*r*99.9%
+-commutative99.9%
*-commutative99.9%
associate-*r*99.6%
fma-define99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 99.6%
associate-*r*99.9%
*-commutative99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 71.4%
*-commutative71.4%
Simplified71.4%
Taylor expanded in z around 0 71.4%
*-commutative71.4%
associate-*r*71.5%
Simplified71.5%
if -1.25e172 < z < -3.4000000000000002e-19 or 3.3e-69 < z < 7.4999999999999996e59 or 3.6e92 < z < 5.0000000000000003e177 or 1.6999999999999999e221 < z Initial program 99.7%
associate-*r*99.8%
+-commutative99.8%
*-commutative99.8%
associate-*r*99.7%
fma-define99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 66.0%
*-commutative66.0%
Simplified66.0%
if -3.4000000000000002e-19 < z < 3.3e-69Initial program 99.0%
Taylor expanded in z around 0 81.5%
if 7.4999999999999996e59 < z < 3.6e92Initial program 99.4%
associate-*r*99.4%
+-commutative99.4%
*-commutative99.4%
associate-*r*99.7%
fma-define99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 99.7%
associate-*r*99.4%
*-commutative99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in y around 0 99.7%
*-commutative99.7%
Simplified99.7%
Final simplification74.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (* 6.0 z))))
(if (<= z -1.06e+183)
(* z (* x -6.0))
(if (<= z -3.4e-19)
t_0
(if (<= z 3.9e-73)
x
(if (<= z 9e+59)
t_0
(if (<= z 3.6e+92)
(* -6.0 (* x z))
(if (<= z 3.1e+178)
t_0
(if (<= z 3.5e+221) (* x (* z -6.0)) (* 6.0 (* y z)))))))))))
double code(double x, double y, double z) {
double t_0 = y * (6.0 * z);
double tmp;
if (z <= -1.06e+183) {
tmp = z * (x * -6.0);
} else if (z <= -3.4e-19) {
tmp = t_0;
} else if (z <= 3.9e-73) {
tmp = x;
} else if (z <= 9e+59) {
tmp = t_0;
} else if (z <= 3.6e+92) {
tmp = -6.0 * (x * z);
} else if (z <= 3.1e+178) {
tmp = t_0;
} else if (z <= 3.5e+221) {
tmp = x * (z * -6.0);
} else {
tmp = 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) :: t_0
real(8) :: tmp
t_0 = y * (6.0d0 * z)
if (z <= (-1.06d+183)) then
tmp = z * (x * (-6.0d0))
else if (z <= (-3.4d-19)) then
tmp = t_0
else if (z <= 3.9d-73) then
tmp = x
else if (z <= 9d+59) then
tmp = t_0
else if (z <= 3.6d+92) then
tmp = (-6.0d0) * (x * z)
else if (z <= 3.1d+178) then
tmp = t_0
else if (z <= 3.5d+221) then
tmp = x * (z * (-6.0d0))
else
tmp = 6.0d0 * (y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (6.0 * z);
double tmp;
if (z <= -1.06e+183) {
tmp = z * (x * -6.0);
} else if (z <= -3.4e-19) {
tmp = t_0;
} else if (z <= 3.9e-73) {
tmp = x;
} else if (z <= 9e+59) {
tmp = t_0;
} else if (z <= 3.6e+92) {
tmp = -6.0 * (x * z);
} else if (z <= 3.1e+178) {
tmp = t_0;
} else if (z <= 3.5e+221) {
tmp = x * (z * -6.0);
} else {
tmp = 6.0 * (y * z);
}
return tmp;
}
def code(x, y, z): t_0 = y * (6.0 * z) tmp = 0 if z <= -1.06e+183: tmp = z * (x * -6.0) elif z <= -3.4e-19: tmp = t_0 elif z <= 3.9e-73: tmp = x elif z <= 9e+59: tmp = t_0 elif z <= 3.6e+92: tmp = -6.0 * (x * z) elif z <= 3.1e+178: tmp = t_0 elif z <= 3.5e+221: tmp = x * (z * -6.0) else: tmp = 6.0 * (y * z) return tmp
function code(x, y, z) t_0 = Float64(y * Float64(6.0 * z)) tmp = 0.0 if (z <= -1.06e+183) tmp = Float64(z * Float64(x * -6.0)); elseif (z <= -3.4e-19) tmp = t_0; elseif (z <= 3.9e-73) tmp = x; elseif (z <= 9e+59) tmp = t_0; elseif (z <= 3.6e+92) tmp = Float64(-6.0 * Float64(x * z)); elseif (z <= 3.1e+178) tmp = t_0; elseif (z <= 3.5e+221) tmp = Float64(x * Float64(z * -6.0)); else tmp = Float64(6.0 * Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (6.0 * z); tmp = 0.0; if (z <= -1.06e+183) tmp = z * (x * -6.0); elseif (z <= -3.4e-19) tmp = t_0; elseif (z <= 3.9e-73) tmp = x; elseif (z <= 9e+59) tmp = t_0; elseif (z <= 3.6e+92) tmp = -6.0 * (x * z); elseif (z <= 3.1e+178) tmp = t_0; elseif (z <= 3.5e+221) tmp = x * (z * -6.0); else tmp = 6.0 * (y * z); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(6.0 * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.06e+183], N[(z * N[(x * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.4e-19], t$95$0, If[LessEqual[z, 3.9e-73], x, If[LessEqual[z, 9e+59], t$95$0, If[LessEqual[z, 3.6e+92], N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.1e+178], t$95$0, If[LessEqual[z, 3.5e+221], N[(x * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(6 \cdot z\right)\\
\mathbf{if}\;z \leq -1.06 \cdot 10^{+183}:\\
\;\;\;\;z \cdot \left(x \cdot -6\right)\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{-19}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-73}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+59}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+92}:\\
\;\;\;\;-6 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{+178}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+221}:\\
\;\;\;\;x \cdot \left(z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(y \cdot z\right)\\
\end{array}
\end{array}
if z < -1.06e183Initial program 99.8%
associate-*r*99.8%
+-commutative99.8%
*-commutative99.8%
associate-*r*99.6%
fma-define99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 99.6%
associate-*r*99.8%
*-commutative99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 66.9%
*-commutative66.9%
*-commutative66.9%
associate-*r*67.0%
Simplified67.0%
if -1.06e183 < z < -3.4000000000000002e-19 or 3.89999999999999982e-73 < z < 8.99999999999999919e59 or 3.6e92 < z < 3.09999999999999991e178Initial program 99.6%
associate-*r*99.8%
+-commutative99.8%
*-commutative99.8%
associate-*r*99.6%
fma-define99.5%
Applied egg-rr99.5%
Taylor expanded in y around inf 66.1%
*-commutative66.1%
Simplified66.1%
Taylor expanded in z around 0 66.1%
*-commutative66.1%
associate-*r*66.2%
Simplified66.2%
if -3.4000000000000002e-19 < z < 3.89999999999999982e-73Initial program 99.0%
Taylor expanded in z around 0 81.5%
if 8.99999999999999919e59 < z < 3.6e92Initial program 99.4%
associate-*r*99.4%
+-commutative99.4%
*-commutative99.4%
associate-*r*99.7%
fma-define99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 99.7%
associate-*r*99.4%
*-commutative99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in y around 0 99.7%
*-commutative99.7%
Simplified99.7%
if 3.09999999999999991e178 < z < 3.5000000000000002e221Initial program 99.8%
associate-*r*99.9%
+-commutative99.9%
*-commutative99.9%
associate-*r*99.7%
fma-define99.6%
Applied egg-rr99.6%
Taylor expanded in z around inf 99.7%
associate-*r*99.9%
*-commutative99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 80.8%
*-commutative80.8%
Simplified80.8%
Taylor expanded in z around 0 80.8%
*-commutative80.8%
associate-*r*81.0%
Simplified81.0%
if 3.5000000000000002e221 < z Initial program 99.9%
associate-*r*99.8%
+-commutative99.8%
*-commutative99.8%
associate-*r*99.9%
fma-define100.0%
Applied egg-rr100.0%
Taylor expanded in y around inf 64.4%
*-commutative64.4%
Simplified64.4%
Final simplification74.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* y z))))
(if (<= z -3.1e+168)
(* z (* x -6.0))
(if (<= z -3.4e-19)
t_0
(if (<= z 5.3e-67)
x
(if (<= z 4.6e+59)
t_0
(if (<= z 1.1e+92)
(* -6.0 (* x z))
(if (<= z 4.8e+177)
(* z (* y 6.0))
(if (<= z 3.7e+221) (* x (* z -6.0)) t_0)))))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (y * z);
double tmp;
if (z <= -3.1e+168) {
tmp = z * (x * -6.0);
} else if (z <= -3.4e-19) {
tmp = t_0;
} else if (z <= 5.3e-67) {
tmp = x;
} else if (z <= 4.6e+59) {
tmp = t_0;
} else if (z <= 1.1e+92) {
tmp = -6.0 * (x * z);
} else if (z <= 4.8e+177) {
tmp = z * (y * 6.0);
} else if (z <= 3.7e+221) {
tmp = x * (z * -6.0);
} 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 * z)
if (z <= (-3.1d+168)) then
tmp = z * (x * (-6.0d0))
else if (z <= (-3.4d-19)) then
tmp = t_0
else if (z <= 5.3d-67) then
tmp = x
else if (z <= 4.6d+59) then
tmp = t_0
else if (z <= 1.1d+92) then
tmp = (-6.0d0) * (x * z)
else if (z <= 4.8d+177) then
tmp = z * (y * 6.0d0)
else if (z <= 3.7d+221) then
tmp = x * (z * (-6.0d0))
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 * z);
double tmp;
if (z <= -3.1e+168) {
tmp = z * (x * -6.0);
} else if (z <= -3.4e-19) {
tmp = t_0;
} else if (z <= 5.3e-67) {
tmp = x;
} else if (z <= 4.6e+59) {
tmp = t_0;
} else if (z <= 1.1e+92) {
tmp = -6.0 * (x * z);
} else if (z <= 4.8e+177) {
tmp = z * (y * 6.0);
} else if (z <= 3.7e+221) {
tmp = x * (z * -6.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (y * z) tmp = 0 if z <= -3.1e+168: tmp = z * (x * -6.0) elif z <= -3.4e-19: tmp = t_0 elif z <= 5.3e-67: tmp = x elif z <= 4.6e+59: tmp = t_0 elif z <= 1.1e+92: tmp = -6.0 * (x * z) elif z <= 4.8e+177: tmp = z * (y * 6.0) elif z <= 3.7e+221: tmp = x * (z * -6.0) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(y * z)) tmp = 0.0 if (z <= -3.1e+168) tmp = Float64(z * Float64(x * -6.0)); elseif (z <= -3.4e-19) tmp = t_0; elseif (z <= 5.3e-67) tmp = x; elseif (z <= 4.6e+59) tmp = t_0; elseif (z <= 1.1e+92) tmp = Float64(-6.0 * Float64(x * z)); elseif (z <= 4.8e+177) tmp = Float64(z * Float64(y * 6.0)); elseif (z <= 3.7e+221) tmp = Float64(x * Float64(z * -6.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (y * z); tmp = 0.0; if (z <= -3.1e+168) tmp = z * (x * -6.0); elseif (z <= -3.4e-19) tmp = t_0; elseif (z <= 5.3e-67) tmp = x; elseif (z <= 4.6e+59) tmp = t_0; elseif (z <= 1.1e+92) tmp = -6.0 * (x * z); elseif (z <= 4.8e+177) tmp = z * (y * 6.0); elseif (z <= 3.7e+221) tmp = x * (z * -6.0); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.1e+168], N[(z * N[(x * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.4e-19], t$95$0, If[LessEqual[z, 5.3e-67], x, If[LessEqual[z, 4.6e+59], t$95$0, If[LessEqual[z, 1.1e+92], N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.8e+177], N[(z * N[(y * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.7e+221], N[(x * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -3.1 \cdot 10^{+168}:\\
\;\;\;\;z \cdot \left(x \cdot -6\right)\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{-19}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 5.3 \cdot 10^{-67}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{+59}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+92}:\\
\;\;\;\;-6 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+177}:\\
\;\;\;\;z \cdot \left(y \cdot 6\right)\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{+221}:\\
\;\;\;\;x \cdot \left(z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -3.09999999999999996e168Initial program 99.8%
associate-*r*99.8%
+-commutative99.8%
*-commutative99.8%
associate-*r*99.6%
fma-define99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 99.6%
associate-*r*99.8%
*-commutative99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 65.8%
*-commutative65.8%
*-commutative65.8%
associate-*r*66.0%
Simplified66.0%
if -3.09999999999999996e168 < z < -3.4000000000000002e-19 or 5.29999999999999971e-67 < z < 4.60000000000000016e59 or 3.70000000000000001e221 < z Initial program 99.7%
associate-*r*99.8%
+-commutative99.8%
*-commutative99.8%
associate-*r*99.7%
fma-define99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 66.9%
*-commutative66.9%
Simplified66.9%
if -3.4000000000000002e-19 < z < 5.29999999999999971e-67Initial program 99.0%
Taylor expanded in z around 0 81.5%
if 4.60000000000000016e59 < z < 1.09999999999999996e92Initial program 99.4%
associate-*r*99.4%
+-commutative99.4%
*-commutative99.4%
associate-*r*99.7%
fma-define99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 99.7%
associate-*r*99.4%
*-commutative99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in y around 0 99.7%
*-commutative99.7%
Simplified99.7%
if 1.09999999999999996e92 < z < 4.8e177Initial program 99.7%
associate-*r*99.9%
+-commutative99.9%
*-commutative99.9%
associate-*r*99.4%
fma-define99.1%
Applied egg-rr99.1%
Taylor expanded in y around inf 61.7%
*-commutative61.7%
associate-*r*62.1%
*-commutative62.1%
associate-*r*62.0%
Simplified62.0%
if 4.8e177 < z < 3.70000000000000001e221Initial program 99.8%
associate-*r*99.9%
+-commutative99.9%
*-commutative99.9%
associate-*r*99.7%
fma-define99.6%
Applied egg-rr99.6%
Taylor expanded in z around inf 99.7%
associate-*r*99.9%
*-commutative99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 80.8%
*-commutative80.8%
Simplified80.8%
Taylor expanded in z around 0 80.8%
*-commutative80.8%
associate-*r*81.0%
Simplified81.0%
Final simplification74.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (* z -6.0))) (t_1 (* 6.0 (* y z))))
(if (<= z -4.6e+170)
t_0
(if (<= z -3.4e-19)
t_1
(if (<= z 3.5e-67)
x
(if (<= z 4.2e+59)
t_1
(if (<= z 7.5e+92)
(* -6.0 (* x z))
(if (<= z 4e+178)
(* z (* y 6.0))
(if (<= z 2e+221) t_0 t_1)))))))))
double code(double x, double y, double z) {
double t_0 = x * (z * -6.0);
double t_1 = 6.0 * (y * z);
double tmp;
if (z <= -4.6e+170) {
tmp = t_0;
} else if (z <= -3.4e-19) {
tmp = t_1;
} else if (z <= 3.5e-67) {
tmp = x;
} else if (z <= 4.2e+59) {
tmp = t_1;
} else if (z <= 7.5e+92) {
tmp = -6.0 * (x * z);
} else if (z <= 4e+178) {
tmp = z * (y * 6.0);
} else if (z <= 2e+221) {
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 = x * (z * (-6.0d0))
t_1 = 6.0d0 * (y * z)
if (z <= (-4.6d+170)) then
tmp = t_0
else if (z <= (-3.4d-19)) then
tmp = t_1
else if (z <= 3.5d-67) then
tmp = x
else if (z <= 4.2d+59) then
tmp = t_1
else if (z <= 7.5d+92) then
tmp = (-6.0d0) * (x * z)
else if (z <= 4d+178) then
tmp = z * (y * 6.0d0)
else if (z <= 2d+221) 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 = x * (z * -6.0);
double t_1 = 6.0 * (y * z);
double tmp;
if (z <= -4.6e+170) {
tmp = t_0;
} else if (z <= -3.4e-19) {
tmp = t_1;
} else if (z <= 3.5e-67) {
tmp = x;
} else if (z <= 4.2e+59) {
tmp = t_1;
} else if (z <= 7.5e+92) {
tmp = -6.0 * (x * z);
} else if (z <= 4e+178) {
tmp = z * (y * 6.0);
} else if (z <= 2e+221) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = x * (z * -6.0) t_1 = 6.0 * (y * z) tmp = 0 if z <= -4.6e+170: tmp = t_0 elif z <= -3.4e-19: tmp = t_1 elif z <= 3.5e-67: tmp = x elif z <= 4.2e+59: tmp = t_1 elif z <= 7.5e+92: tmp = -6.0 * (x * z) elif z <= 4e+178: tmp = z * (y * 6.0) elif z <= 2e+221: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(z * -6.0)) t_1 = Float64(6.0 * Float64(y * z)) tmp = 0.0 if (z <= -4.6e+170) tmp = t_0; elseif (z <= -3.4e-19) tmp = t_1; elseif (z <= 3.5e-67) tmp = x; elseif (z <= 4.2e+59) tmp = t_1; elseif (z <= 7.5e+92) tmp = Float64(-6.0 * Float64(x * z)); elseif (z <= 4e+178) tmp = Float64(z * Float64(y * 6.0)); elseif (z <= 2e+221) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (z * -6.0); t_1 = 6.0 * (y * z); tmp = 0.0; if (z <= -4.6e+170) tmp = t_0; elseif (z <= -3.4e-19) tmp = t_1; elseif (z <= 3.5e-67) tmp = x; elseif (z <= 4.2e+59) tmp = t_1; elseif (z <= 7.5e+92) tmp = -6.0 * (x * z); elseif (z <= 4e+178) tmp = z * (y * 6.0); elseif (z <= 2e+221) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.6e+170], t$95$0, If[LessEqual[z, -3.4e-19], t$95$1, If[LessEqual[z, 3.5e-67], x, If[LessEqual[z, 4.2e+59], t$95$1, If[LessEqual[z, 7.5e+92], N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4e+178], N[(z * N[(y * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e+221], t$95$0, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(z \cdot -6\right)\\
t_1 := 6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -4.6 \cdot 10^{+170}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{-19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-67}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+59}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{+92}:\\
\;\;\;\;-6 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+178}:\\
\;\;\;\;z \cdot \left(y \cdot 6\right)\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+221}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.6000000000000001e170 or 4.0000000000000002e178 < z < 2.0000000000000001e221Initial program 99.8%
associate-*r*99.9%
+-commutative99.9%
*-commutative99.9%
associate-*r*99.6%
fma-define99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 99.6%
associate-*r*99.9%
*-commutative99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 71.4%
*-commutative71.4%
Simplified71.4%
Taylor expanded in z around 0 71.4%
*-commutative71.4%
associate-*r*71.5%
Simplified71.5%
if -4.6000000000000001e170 < z < -3.4000000000000002e-19 or 3.5e-67 < z < 4.19999999999999968e59 or 2.0000000000000001e221 < z Initial program 99.7%
associate-*r*99.8%
+-commutative99.8%
*-commutative99.8%
associate-*r*99.7%
fma-define99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 66.9%
*-commutative66.9%
Simplified66.9%
if -3.4000000000000002e-19 < z < 3.5e-67Initial program 99.0%
Taylor expanded in z around 0 81.5%
if 4.19999999999999968e59 < z < 7.49999999999999946e92Initial program 99.4%
associate-*r*99.4%
+-commutative99.4%
*-commutative99.4%
associate-*r*99.7%
fma-define99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 99.7%
associate-*r*99.4%
*-commutative99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in y around 0 99.7%
*-commutative99.7%
Simplified99.7%
if 7.49999999999999946e92 < z < 4.0000000000000002e178Initial program 99.7%
associate-*r*99.9%
+-commutative99.9%
*-commutative99.9%
associate-*r*99.4%
fma-define99.1%
Applied egg-rr99.1%
Taylor expanded in y around inf 61.7%
*-commutative61.7%
associate-*r*62.1%
*-commutative62.1%
associate-*r*62.0%
Simplified62.0%
Final simplification74.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ 1.0 (* z -6.0)))))
(if (<= x -3.1e-40)
t_0
(if (<= x -9.5e-57)
(* z (* y 6.0))
(if (or (<= x -5e-113) (not (<= x 2.1e-104))) t_0 (* y (* 6.0 z)))))))
double code(double x, double y, double z) {
double t_0 = x * (1.0 + (z * -6.0));
double tmp;
if (x <= -3.1e-40) {
tmp = t_0;
} else if (x <= -9.5e-57) {
tmp = z * (y * 6.0);
} else if ((x <= -5e-113) || !(x <= 2.1e-104)) {
tmp = t_0;
} else {
tmp = 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) :: t_0
real(8) :: tmp
t_0 = x * (1.0d0 + (z * (-6.0d0)))
if (x <= (-3.1d-40)) then
tmp = t_0
else if (x <= (-9.5d-57)) then
tmp = z * (y * 6.0d0)
else if ((x <= (-5d-113)) .or. (.not. (x <= 2.1d-104))) then
tmp = t_0
else
tmp = y * (6.0d0 * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (1.0 + (z * -6.0));
double tmp;
if (x <= -3.1e-40) {
tmp = t_0;
} else if (x <= -9.5e-57) {
tmp = z * (y * 6.0);
} else if ((x <= -5e-113) || !(x <= 2.1e-104)) {
tmp = t_0;
} else {
tmp = y * (6.0 * z);
}
return tmp;
}
def code(x, y, z): t_0 = x * (1.0 + (z * -6.0)) tmp = 0 if x <= -3.1e-40: tmp = t_0 elif x <= -9.5e-57: tmp = z * (y * 6.0) elif (x <= -5e-113) or not (x <= 2.1e-104): tmp = t_0 else: tmp = y * (6.0 * z) return tmp
function code(x, y, z) t_0 = Float64(x * Float64(1.0 + Float64(z * -6.0))) tmp = 0.0 if (x <= -3.1e-40) tmp = t_0; elseif (x <= -9.5e-57) tmp = Float64(z * Float64(y * 6.0)); elseif ((x <= -5e-113) || !(x <= 2.1e-104)) tmp = t_0; else tmp = Float64(y * Float64(6.0 * z)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (1.0 + (z * -6.0)); tmp = 0.0; if (x <= -3.1e-40) tmp = t_0; elseif (x <= -9.5e-57) tmp = z * (y * 6.0); elseif ((x <= -5e-113) || ~((x <= 2.1e-104))) tmp = t_0; else tmp = y * (6.0 * z); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(1.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.1e-40], t$95$0, If[LessEqual[x, -9.5e-57], N[(z * N[(y * 6.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -5e-113], N[Not[LessEqual[x, 2.1e-104]], $MachinePrecision]], t$95$0, N[(y * N[(6.0 * z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(1 + z \cdot -6\right)\\
\mathbf{if}\;x \leq -3.1 \cdot 10^{-40}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -9.5 \cdot 10^{-57}:\\
\;\;\;\;z \cdot \left(y \cdot 6\right)\\
\mathbf{elif}\;x \leq -5 \cdot 10^{-113} \lor \neg \left(x \leq 2.1 \cdot 10^{-104}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(6 \cdot z\right)\\
\end{array}
\end{array}
if x < -3.10000000000000011e-40 or -9.5000000000000005e-57 < x < -4.9999999999999997e-113 or 2.09999999999999999e-104 < x Initial program 99.3%
Taylor expanded in x around inf 82.9%
+-commutative82.9%
Simplified82.9%
if -3.10000000000000011e-40 < x < -9.5000000000000005e-57Initial program 100.0%
associate-*r*99.7%
+-commutative99.7%
*-commutative99.7%
associate-*r*99.4%
fma-define99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 99.4%
*-commutative99.4%
associate-*r*99.7%
*-commutative99.7%
associate-*r*100.0%
Simplified100.0%
if -4.9999999999999997e-113 < x < 2.09999999999999999e-104Initial program 99.6%
associate-*r*99.8%
+-commutative99.8%
*-commutative99.8%
associate-*r*99.7%
fma-define99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 77.6%
*-commutative77.6%
Simplified77.6%
Taylor expanded in z around 0 77.6%
*-commutative77.6%
associate-*r*77.6%
Simplified77.6%
Final simplification81.6%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.172) (not (<= z 0.165))) (* (- y x) (* 6.0 z)) (+ x (* 6.0 (* y z)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.172) || !(z <= 0.165)) {
tmp = (y - x) * (6.0 * 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.172d0)) .or. (.not. (z <= 0.165d0))) then
tmp = (y - x) * (6.0d0 * 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.172) || !(z <= 0.165)) {
tmp = (y - x) * (6.0 * z);
} else {
tmp = x + (6.0 * (y * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.172) or not (z <= 0.165): tmp = (y - x) * (6.0 * z) else: tmp = x + (6.0 * (y * z)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.172) || !(z <= 0.165)) tmp = Float64(Float64(y - x) * Float64(6.0 * 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.172) || ~((z <= 0.165))) tmp = (y - x) * (6.0 * z); else tmp = x + (6.0 * (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.172], N[Not[LessEqual[z, 0.165]], $MachinePrecision]], N[(N[(y - x), $MachinePrecision] * N[(6.0 * 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.172 \lor \neg \left(z \leq 0.165\right):\\
\;\;\;\;\left(y - x\right) \cdot \left(6 \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + 6 \cdot \left(y \cdot z\right)\\
\end{array}
\end{array}
if z < -0.17199999999999999 or 0.165000000000000008 < z Initial program 99.7%
associate-*r*99.8%
+-commutative99.8%
*-commutative99.8%
associate-*r*99.7%
fma-define99.6%
Applied egg-rr99.6%
Taylor expanded in z around inf 97.8%
associate-*r*97.9%
*-commutative97.9%
*-commutative97.9%
Simplified97.9%
if -0.17199999999999999 < z < 0.165000000000000008Initial program 99.0%
Taylor expanded in y around inf 99.9%
*-commutative99.9%
Simplified99.9%
Final simplification98.8%
(FPCore (x y z) :precision binary64 (if (or (<= z -2.8e-29) (not (<= z 5.7e-70))) (* (- y x) (* 6.0 z)) (* x (+ 1.0 (* z -6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -2.8e-29) || !(z <= 5.7e-70)) {
tmp = (y - x) * (6.0 * z);
} 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 <= (-2.8d-29)) .or. (.not. (z <= 5.7d-70))) then
tmp = (y - x) * (6.0d0 * z)
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 <= -2.8e-29) || !(z <= 5.7e-70)) {
tmp = (y - x) * (6.0 * z);
} else {
tmp = x * (1.0 + (z * -6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -2.8e-29) or not (z <= 5.7e-70): tmp = (y - x) * (6.0 * z) else: tmp = x * (1.0 + (z * -6.0)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -2.8e-29) || !(z <= 5.7e-70)) tmp = Float64(Float64(y - x) * Float64(6.0 * z)); 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 <= -2.8e-29) || ~((z <= 5.7e-70))) tmp = (y - x) * (6.0 * z); else tmp = x * (1.0 + (z * -6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -2.8e-29], N[Not[LessEqual[z, 5.7e-70]], $MachinePrecision]], N[(N[(y - x), $MachinePrecision] * N[(6.0 * z), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{-29} \lor \neg \left(z \leq 5.7 \cdot 10^{-70}\right):\\
\;\;\;\;\left(y - x\right) \cdot \left(6 \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 + z \cdot -6\right)\\
\end{array}
\end{array}
if z < -2.8000000000000002e-29 or 5.70000000000000028e-70 < z Initial program 99.7%
associate-*r*99.8%
+-commutative99.8%
*-commutative99.8%
associate-*r*99.7%
fma-define99.6%
Applied egg-rr99.6%
Taylor expanded in z around inf 96.1%
associate-*r*96.2%
*-commutative96.2%
*-commutative96.2%
Simplified96.2%
if -2.8000000000000002e-29 < z < 5.70000000000000028e-70Initial program 99.0%
Taylor expanded in x around inf 82.1%
+-commutative82.1%
Simplified82.1%
Final simplification90.5%
(FPCore (x y z) :precision binary64 (if (or (<= z -3.75e-19) (not (<= z 12.0))) (* -6.0 (* x z)) x))
double code(double x, double y, double z) {
double tmp;
if ((z <= -3.75e-19) || !(z <= 12.0)) {
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 <= (-3.75d-19)) .or. (.not. (z <= 12.0d0))) 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 <= -3.75e-19) || !(z <= 12.0)) {
tmp = -6.0 * (x * z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -3.75e-19) or not (z <= 12.0): tmp = -6.0 * (x * z) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -3.75e-19) || !(z <= 12.0)) 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 <= -3.75e-19) || ~((z <= 12.0))) tmp = -6.0 * (x * z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -3.75e-19], N[Not[LessEqual[z, 12.0]], $MachinePrecision]], N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.75 \cdot 10^{-19} \lor \neg \left(z \leq 12\right):\\
\;\;\;\;-6 \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.74999999999999979e-19 or 12 < z Initial program 99.7%
associate-*r*99.8%
+-commutative99.8%
*-commutative99.8%
associate-*r*99.7%
fma-define99.6%
Applied egg-rr99.6%
Taylor expanded in z around inf 97.8%
associate-*r*97.9%
*-commutative97.9%
*-commutative97.9%
Simplified97.9%
Taylor expanded in y around 0 52.0%
*-commutative52.0%
Simplified52.0%
if -3.74999999999999979e-19 < z < 12Initial program 99.0%
Taylor expanded in z around 0 73.3%
Final simplification62.0%
(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.9%
Simplified99.9%
(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)
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 35.9%
(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 2024086
(FPCore (x y z)
:name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, E"
:precision binary64
:alt
(- x (* (* 6.0 z) (- x y)))
(+ x (* (* (- y x) 6.0) z)))