
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.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) * ((2.0d0 / 3.0d0) - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(Float64(2.0 / 3.0) - z))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * ((2.0 / 3.0) - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(N[(2.0 / 3.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.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) * ((2.0d0 / 3.0d0) - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(Float64(2.0 / 3.0) - z))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * ((2.0 / 3.0) - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(N[(2.0 / 3.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
\end{array}
(FPCore (x y z) :precision binary64 (fma (- y x) (fma z -6.0 4.0) x))
double code(double x, double y, double z) {
return fma((y - x), fma(z, -6.0, 4.0), x);
}
function code(x, y, z) return fma(Float64(y - x), fma(z, -6.0, 4.0), x) end
code[x_, y_, z_] := N[(N[(y - x), $MachinePrecision] * N[(z * -6.0 + 4.0), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - x, \mathsf{fma}\left(z, -6, 4\right), x\right)
\end{array}
Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.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 -4.2e+252)
t_0
(if (<= z -9.5e+192)
t_1
(if (<= z -0.98)
t_0
(if (<= z -1.4e-239)
(* y 4.0)
(if (<= z 1e-177)
(* x -3.0)
(if (<= z 3.8e-123)
(* y 4.0)
(if (<= z 1.35e-54)
(* x -3.0)
(if (<= z 15000000000.0)
(* y 4.0)
(if (or (<= z 3.55e+81)
(and (not (<= z 5e+226)) (<= z 3.1e+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 <= -4.2e+252) {
tmp = t_0;
} else if (z <= -9.5e+192) {
tmp = t_1;
} else if (z <= -0.98) {
tmp = t_0;
} else if (z <= -1.4e-239) {
tmp = y * 4.0;
} else if (z <= 1e-177) {
tmp = x * -3.0;
} else if (z <= 3.8e-123) {
tmp = y * 4.0;
} else if (z <= 1.35e-54) {
tmp = x * -3.0;
} else if (z <= 15000000000.0) {
tmp = y * 4.0;
} else if ((z <= 3.55e+81) || (!(z <= 5e+226) && (z <= 3.1e+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 <= (-4.2d+252)) then
tmp = t_0
else if (z <= (-9.5d+192)) then
tmp = t_1
else if (z <= (-0.98d0)) then
tmp = t_0
else if (z <= (-1.4d-239)) then
tmp = y * 4.0d0
else if (z <= 1d-177) then
tmp = x * (-3.0d0)
else if (z <= 3.8d-123) then
tmp = y * 4.0d0
else if (z <= 1.35d-54) then
tmp = x * (-3.0d0)
else if (z <= 15000000000.0d0) then
tmp = y * 4.0d0
else if ((z <= 3.55d+81) .or. (.not. (z <= 5d+226)) .and. (z <= 3.1d+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 <= -4.2e+252) {
tmp = t_0;
} else if (z <= -9.5e+192) {
tmp = t_1;
} else if (z <= -0.98) {
tmp = t_0;
} else if (z <= -1.4e-239) {
tmp = y * 4.0;
} else if (z <= 1e-177) {
tmp = x * -3.0;
} else if (z <= 3.8e-123) {
tmp = y * 4.0;
} else if (z <= 1.35e-54) {
tmp = x * -3.0;
} else if (z <= 15000000000.0) {
tmp = y * 4.0;
} else if ((z <= 3.55e+81) || (!(z <= 5e+226) && (z <= 3.1e+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 <= -4.2e+252: tmp = t_0 elif z <= -9.5e+192: tmp = t_1 elif z <= -0.98: tmp = t_0 elif z <= -1.4e-239: tmp = y * 4.0 elif z <= 1e-177: tmp = x * -3.0 elif z <= 3.8e-123: tmp = y * 4.0 elif z <= 1.35e-54: tmp = x * -3.0 elif z <= 15000000000.0: tmp = y * 4.0 elif (z <= 3.55e+81) or (not (z <= 5e+226) and (z <= 3.1e+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 <= -4.2e+252) tmp = t_0; elseif (z <= -9.5e+192) tmp = t_1; elseif (z <= -0.98) tmp = t_0; elseif (z <= -1.4e-239) tmp = Float64(y * 4.0); elseif (z <= 1e-177) tmp = Float64(x * -3.0); elseif (z <= 3.8e-123) tmp = Float64(y * 4.0); elseif (z <= 1.35e-54) tmp = Float64(x * -3.0); elseif (z <= 15000000000.0) tmp = Float64(y * 4.0); elseif ((z <= 3.55e+81) || (!(z <= 5e+226) && (z <= 3.1e+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 <= -4.2e+252) tmp = t_0; elseif (z <= -9.5e+192) tmp = t_1; elseif (z <= -0.98) tmp = t_0; elseif (z <= -1.4e-239) tmp = y * 4.0; elseif (z <= 1e-177) tmp = x * -3.0; elseif (z <= 3.8e-123) tmp = y * 4.0; elseif (z <= 1.35e-54) tmp = x * -3.0; elseif (z <= 15000000000.0) tmp = y * 4.0; elseif ((z <= 3.55e+81) || (~((z <= 5e+226)) && (z <= 3.1e+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, -4.2e+252], t$95$0, If[LessEqual[z, -9.5e+192], t$95$1, If[LessEqual[z, -0.98], t$95$0, If[LessEqual[z, -1.4e-239], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1e-177], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 3.8e-123], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.35e-54], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 15000000000.0], N[(y * 4.0), $MachinePrecision], If[Or[LessEqual[z, 3.55e+81], And[N[Not[LessEqual[z, 5e+226]], $MachinePrecision], LessEqual[z, 3.1e+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 -4.2 \cdot 10^{+252}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{+192}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -0.98:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1.4 \cdot 10^{-239}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 10^{-177}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-123}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-54}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 15000000000:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 3.55 \cdot 10^{+81} \lor \neg \left(z \leq 5 \cdot 10^{+226}\right) \land z \leq 3.1 \cdot 10^{+264}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -4.2000000000000003e252 or -9.49999999999999931e192 < z < -0.97999999999999998 or 3.54999999999999984e81 < z < 5.0000000000000005e226 or 3.09999999999999981e264 < z Initial program 99.8%
Taylor expanded in x around inf 68.7%
*-commutative68.7%
sub-neg68.7%
distribute-lft-in68.7%
metadata-eval68.7%
metadata-eval68.7%
neg-mul-168.7%
*-commutative68.7%
associate-*l*68.7%
distribute-rgt-in68.7%
distribute-lft-in68.7%
associate-+r+68.7%
metadata-eval68.7%
metadata-eval68.7%
metadata-eval68.7%
distribute-lft-in68.7%
+-commutative68.7%
distribute-rgt-in68.7%
*-commutative68.7%
associate-*l*68.7%
metadata-eval68.7%
metadata-eval68.7%
Simplified68.7%
Taylor expanded in z around inf 68.3%
Taylor expanded in x around 0 68.2%
if -4.2000000000000003e252 < z < -9.49999999999999931e192 or 1.5e10 < z < 3.54999999999999984e81 or 5.0000000000000005e226 < z < 3.09999999999999981e264Initial program 99.8%
Taylor expanded in x around 0 99.7%
fma-def99.7%
*-commutative99.7%
associate-*r*99.7%
Simplified99.7%
Taylor expanded in z around inf 99.7%
associate-*r*99.8%
*-commutative99.8%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in x around 0 77.9%
if -0.97999999999999998 < z < -1.40000000000000006e-239 or 9.99999999999999952e-178 < z < 3.79999999999999996e-123 or 1.35000000000000013e-54 < z < 1.5e10Initial program 99.4%
associate-*r*99.8%
metadata-eval99.8%
flip-+45.3%
clear-num45.2%
pow245.2%
Applied egg-rr45.2%
Taylor expanded in x around 0 63.0%
Taylor expanded in z around 0 60.0%
*-commutative60.0%
Simplified60.0%
if -1.40000000000000006e-239 < z < 9.99999999999999952e-178 or 3.79999999999999996e-123 < z < 1.35000000000000013e-54Initial program 99.3%
Taylor expanded in x around inf 69.2%
*-commutative69.2%
sub-neg69.2%
distribute-lft-in69.2%
metadata-eval69.2%
metadata-eval69.2%
neg-mul-169.2%
*-commutative69.2%
associate-*l*69.2%
distribute-rgt-in69.2%
distribute-lft-in69.2%
associate-+r+69.2%
metadata-eval69.2%
metadata-eval69.2%
metadata-eval69.2%
distribute-lft-in69.2%
+-commutative69.2%
distribute-rgt-in69.2%
*-commutative69.2%
associate-*l*69.2%
metadata-eval69.2%
metadata-eval69.2%
Simplified69.2%
Taylor expanded in z around 0 69.2%
*-commutative69.2%
Simplified69.2%
Final simplification67.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (* z 6.0))) (t_1 (* -6.0 (* y z))))
(if (<= z -1.7e+254)
t_0
(if (<= z -2.25e+189)
t_1
(if (<= z -0.42)
t_0
(if (<= z -1.2e-238)
(* y 4.0)
(if (<= z 1.9e-177)
(* x -3.0)
(if (<= z 2.6e-122)
(* y 4.0)
(if (<= z 2.2e-55)
(* x -3.0)
(if (<= z 15000000000.0)
(* y 4.0)
(if (or (<= z 1.8e+81)
(and (not (<= z 5.5e+237)) (<= z 1.2e+262)))
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.7e+254) {
tmp = t_0;
} else if (z <= -2.25e+189) {
tmp = t_1;
} else if (z <= -0.42) {
tmp = t_0;
} else if (z <= -1.2e-238) {
tmp = y * 4.0;
} else if (z <= 1.9e-177) {
tmp = x * -3.0;
} else if (z <= 2.6e-122) {
tmp = y * 4.0;
} else if (z <= 2.2e-55) {
tmp = x * -3.0;
} else if (z <= 15000000000.0) {
tmp = y * 4.0;
} else if ((z <= 1.8e+81) || (!(z <= 5.5e+237) && (z <= 1.2e+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 = x * (z * 6.0d0)
t_1 = (-6.0d0) * (y * z)
if (z <= (-1.7d+254)) then
tmp = t_0
else if (z <= (-2.25d+189)) then
tmp = t_1
else if (z <= (-0.42d0)) then
tmp = t_0
else if (z <= (-1.2d-238)) then
tmp = y * 4.0d0
else if (z <= 1.9d-177) then
tmp = x * (-3.0d0)
else if (z <= 2.6d-122) then
tmp = y * 4.0d0
else if (z <= 2.2d-55) then
tmp = x * (-3.0d0)
else if (z <= 15000000000.0d0) then
tmp = y * 4.0d0
else if ((z <= 1.8d+81) .or. (.not. (z <= 5.5d+237)) .and. (z <= 1.2d+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 = x * (z * 6.0);
double t_1 = -6.0 * (y * z);
double tmp;
if (z <= -1.7e+254) {
tmp = t_0;
} else if (z <= -2.25e+189) {
tmp = t_1;
} else if (z <= -0.42) {
tmp = t_0;
} else if (z <= -1.2e-238) {
tmp = y * 4.0;
} else if (z <= 1.9e-177) {
tmp = x * -3.0;
} else if (z <= 2.6e-122) {
tmp = y * 4.0;
} else if (z <= 2.2e-55) {
tmp = x * -3.0;
} else if (z <= 15000000000.0) {
tmp = y * 4.0;
} else if ((z <= 1.8e+81) || (!(z <= 5.5e+237) && (z <= 1.2e+262))) {
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.7e+254: tmp = t_0 elif z <= -2.25e+189: tmp = t_1 elif z <= -0.42: tmp = t_0 elif z <= -1.2e-238: tmp = y * 4.0 elif z <= 1.9e-177: tmp = x * -3.0 elif z <= 2.6e-122: tmp = y * 4.0 elif z <= 2.2e-55: tmp = x * -3.0 elif z <= 15000000000.0: tmp = y * 4.0 elif (z <= 1.8e+81) or (not (z <= 5.5e+237) and (z <= 1.2e+262)): 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.7e+254) tmp = t_0; elseif (z <= -2.25e+189) tmp = t_1; elseif (z <= -0.42) tmp = t_0; elseif (z <= -1.2e-238) tmp = Float64(y * 4.0); elseif (z <= 1.9e-177) tmp = Float64(x * -3.0); elseif (z <= 2.6e-122) tmp = Float64(y * 4.0); elseif (z <= 2.2e-55) tmp = Float64(x * -3.0); elseif (z <= 15000000000.0) tmp = Float64(y * 4.0); elseif ((z <= 1.8e+81) || (!(z <= 5.5e+237) && (z <= 1.2e+262))) 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.7e+254) tmp = t_0; elseif (z <= -2.25e+189) tmp = t_1; elseif (z <= -0.42) tmp = t_0; elseif (z <= -1.2e-238) tmp = y * 4.0; elseif (z <= 1.9e-177) tmp = x * -3.0; elseif (z <= 2.6e-122) tmp = y * 4.0; elseif (z <= 2.2e-55) tmp = x * -3.0; elseif (z <= 15000000000.0) tmp = y * 4.0; elseif ((z <= 1.8e+81) || (~((z <= 5.5e+237)) && (z <= 1.2e+262))) 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.7e+254], t$95$0, If[LessEqual[z, -2.25e+189], t$95$1, If[LessEqual[z, -0.42], t$95$0, If[LessEqual[z, -1.2e-238], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.9e-177], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.6e-122], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.2e-55], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 15000000000.0], N[(y * 4.0), $MachinePrecision], If[Or[LessEqual[z, 1.8e+81], And[N[Not[LessEqual[z, 5.5e+237]], $MachinePrecision], LessEqual[z, 1.2e+262]]], 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.7 \cdot 10^{+254}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -2.25 \cdot 10^{+189}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -0.42:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1.2 \cdot 10^{-238}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-177}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-122}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-55}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 15000000000:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{+81} \lor \neg \left(z \leq 5.5 \cdot 10^{+237}\right) \land z \leq 1.2 \cdot 10^{+262}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -1.7e254 or -2.24999999999999987e189 < z < -0.419999999999999984 or 1.80000000000000003e81 < z < 5.5000000000000001e237 or 1.19999999999999991e262 < z Initial program 99.8%
Taylor expanded in x around inf 68.7%
*-commutative68.7%
sub-neg68.7%
distribute-lft-in68.7%
metadata-eval68.7%
metadata-eval68.7%
neg-mul-168.7%
*-commutative68.7%
associate-*l*68.7%
distribute-rgt-in68.7%
distribute-lft-in68.7%
associate-+r+68.7%
metadata-eval68.7%
metadata-eval68.7%
metadata-eval68.7%
distribute-lft-in68.7%
+-commutative68.7%
distribute-rgt-in68.7%
*-commutative68.7%
associate-*l*68.7%
metadata-eval68.7%
metadata-eval68.7%
Simplified68.7%
Taylor expanded in z around inf 68.3%
if -1.7e254 < z < -2.24999999999999987e189 or 1.5e10 < z < 1.80000000000000003e81 or 5.5000000000000001e237 < z < 1.19999999999999991e262Initial program 99.8%
Taylor expanded in x around 0 99.7%
fma-def99.7%
*-commutative99.7%
associate-*r*99.7%
Simplified99.7%
Taylor expanded in z around inf 99.7%
associate-*r*99.8%
*-commutative99.8%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in x around 0 77.9%
if -0.419999999999999984 < z < -1.1999999999999999e-238 or 1.90000000000000002e-177 < z < 2.59999999999999975e-122 or 2.2e-55 < z < 1.5e10Initial program 99.4%
associate-*r*99.8%
metadata-eval99.8%
flip-+45.3%
clear-num45.2%
pow245.2%
Applied egg-rr45.2%
Taylor expanded in x around 0 63.0%
Taylor expanded in z around 0 60.0%
*-commutative60.0%
Simplified60.0%
if -1.1999999999999999e-238 < z < 1.90000000000000002e-177 or 2.59999999999999975e-122 < z < 2.2e-55Initial program 99.3%
Taylor expanded in x around inf 69.2%
*-commutative69.2%
sub-neg69.2%
distribute-lft-in69.2%
metadata-eval69.2%
metadata-eval69.2%
neg-mul-169.2%
*-commutative69.2%
associate-*l*69.2%
distribute-rgt-in69.2%
distribute-lft-in69.2%
associate-+r+69.2%
metadata-eval69.2%
metadata-eval69.2%
metadata-eval69.2%
distribute-lft-in69.2%
+-commutative69.2%
distribute-rgt-in69.2%
*-commutative69.2%
associate-*l*69.2%
metadata-eval69.2%
metadata-eval69.2%
Simplified69.2%
Taylor expanded in z around 0 69.2%
*-commutative69.2%
Simplified69.2%
Final simplification67.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (* z 6.0))) (t_1 (* z (* y -6.0))))
(if (<= z -1.25e+248)
t_0
(if (<= z -9.5e+192)
t_1
(if (<= z -0.25)
t_0
(if (<= z -3.2e-238)
(* y 4.0)
(if (<= z 1.3e-178)
(* x -3.0)
(if (<= z 3e-120)
(* y 4.0)
(if (<= z 1.02e-54)
(* x -3.0)
(if (<= z 15000000000.0)
(* y 4.0)
(if (<= z 2.35e+83)
(* -6.0 (* y z))
(if (or (<= z 3.8e+236) (not (<= z 7.5e+262)))
t_0
t_1))))))))))))
double code(double x, double y, double z) {
double t_0 = x * (z * 6.0);
double t_1 = z * (y * -6.0);
double tmp;
if (z <= -1.25e+248) {
tmp = t_0;
} else if (z <= -9.5e+192) {
tmp = t_1;
} else if (z <= -0.25) {
tmp = t_0;
} else if (z <= -3.2e-238) {
tmp = y * 4.0;
} else if (z <= 1.3e-178) {
tmp = x * -3.0;
} else if (z <= 3e-120) {
tmp = y * 4.0;
} else if (z <= 1.02e-54) {
tmp = x * -3.0;
} else if (z <= 15000000000.0) {
tmp = y * 4.0;
} else if (z <= 2.35e+83) {
tmp = -6.0 * (y * z);
} else if ((z <= 3.8e+236) || !(z <= 7.5e+262)) {
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 = z * (y * (-6.0d0))
if (z <= (-1.25d+248)) then
tmp = t_0
else if (z <= (-9.5d+192)) then
tmp = t_1
else if (z <= (-0.25d0)) then
tmp = t_0
else if (z <= (-3.2d-238)) then
tmp = y * 4.0d0
else if (z <= 1.3d-178) then
tmp = x * (-3.0d0)
else if (z <= 3d-120) then
tmp = y * 4.0d0
else if (z <= 1.02d-54) then
tmp = x * (-3.0d0)
else if (z <= 15000000000.0d0) then
tmp = y * 4.0d0
else if (z <= 2.35d+83) then
tmp = (-6.0d0) * (y * z)
else if ((z <= 3.8d+236) .or. (.not. (z <= 7.5d+262))) 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 = z * (y * -6.0);
double tmp;
if (z <= -1.25e+248) {
tmp = t_0;
} else if (z <= -9.5e+192) {
tmp = t_1;
} else if (z <= -0.25) {
tmp = t_0;
} else if (z <= -3.2e-238) {
tmp = y * 4.0;
} else if (z <= 1.3e-178) {
tmp = x * -3.0;
} else if (z <= 3e-120) {
tmp = y * 4.0;
} else if (z <= 1.02e-54) {
tmp = x * -3.0;
} else if (z <= 15000000000.0) {
tmp = y * 4.0;
} else if (z <= 2.35e+83) {
tmp = -6.0 * (y * z);
} else if ((z <= 3.8e+236) || !(z <= 7.5e+262)) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = x * (z * 6.0) t_1 = z * (y * -6.0) tmp = 0 if z <= -1.25e+248: tmp = t_0 elif z <= -9.5e+192: tmp = t_1 elif z <= -0.25: tmp = t_0 elif z <= -3.2e-238: tmp = y * 4.0 elif z <= 1.3e-178: tmp = x * -3.0 elif z <= 3e-120: tmp = y * 4.0 elif z <= 1.02e-54: tmp = x * -3.0 elif z <= 15000000000.0: tmp = y * 4.0 elif z <= 2.35e+83: tmp = -6.0 * (y * z) elif (z <= 3.8e+236) or not (z <= 7.5e+262): 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(z * Float64(y * -6.0)) tmp = 0.0 if (z <= -1.25e+248) tmp = t_0; elseif (z <= -9.5e+192) tmp = t_1; elseif (z <= -0.25) tmp = t_0; elseif (z <= -3.2e-238) tmp = Float64(y * 4.0); elseif (z <= 1.3e-178) tmp = Float64(x * -3.0); elseif (z <= 3e-120) tmp = Float64(y * 4.0); elseif (z <= 1.02e-54) tmp = Float64(x * -3.0); elseif (z <= 15000000000.0) tmp = Float64(y * 4.0); elseif (z <= 2.35e+83) tmp = Float64(-6.0 * Float64(y * z)); elseif ((z <= 3.8e+236) || !(z <= 7.5e+262)) 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 = z * (y * -6.0); tmp = 0.0; if (z <= -1.25e+248) tmp = t_0; elseif (z <= -9.5e+192) tmp = t_1; elseif (z <= -0.25) tmp = t_0; elseif (z <= -3.2e-238) tmp = y * 4.0; elseif (z <= 1.3e-178) tmp = x * -3.0; elseif (z <= 3e-120) tmp = y * 4.0; elseif (z <= 1.02e-54) tmp = x * -3.0; elseif (z <= 15000000000.0) tmp = y * 4.0; elseif (z <= 2.35e+83) tmp = -6.0 * (y * z); elseif ((z <= 3.8e+236) || ~((z <= 7.5e+262))) 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[(z * N[(y * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.25e+248], t$95$0, If[LessEqual[z, -9.5e+192], t$95$1, If[LessEqual[z, -0.25], t$95$0, If[LessEqual[z, -3.2e-238], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.3e-178], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 3e-120], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.02e-54], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 15000000000.0], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.35e+83], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 3.8e+236], N[Not[LessEqual[z, 7.5e+262]], $MachinePrecision]], t$95$0, t$95$1]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(z \cdot 6\right)\\
t_1 := z \cdot \left(y \cdot -6\right)\\
\mathbf{if}\;z \leq -1.25 \cdot 10^{+248}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{+192}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -0.25:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -3.2 \cdot 10^{-238}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-178}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-120}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{-54}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 15000000000:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 2.35 \cdot 10^{+83}:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+236} \lor \neg \left(z \leq 7.5 \cdot 10^{+262}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.2499999999999999e248 or -9.49999999999999931e192 < z < -0.25 or 2.3499999999999999e83 < z < 3.79999999999999986e236 or 7.49999999999999977e262 < z Initial program 99.8%
Taylor expanded in x around inf 68.7%
*-commutative68.7%
sub-neg68.7%
distribute-lft-in68.7%
metadata-eval68.7%
metadata-eval68.7%
neg-mul-168.7%
*-commutative68.7%
associate-*l*68.7%
distribute-rgt-in68.7%
distribute-lft-in68.7%
associate-+r+68.7%
metadata-eval68.7%
metadata-eval68.7%
metadata-eval68.7%
distribute-lft-in68.7%
+-commutative68.7%
distribute-rgt-in68.7%
*-commutative68.7%
associate-*l*68.7%
metadata-eval68.7%
metadata-eval68.7%
Simplified68.7%
Taylor expanded in z around inf 68.3%
if -1.2499999999999999e248 < z < -9.49999999999999931e192 or 3.79999999999999986e236 < z < 7.49999999999999977e262Initial program 100.0%
Taylor expanded in x around 0 99.8%
fma-def99.8%
*-commutative99.8%
associate-*r*99.8%
Simplified99.8%
Taylor expanded in z around inf 99.8%
associate-*r*100.0%
*-commutative100.0%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in x around 0 83.0%
associate-*r*83.2%
Simplified83.2%
if -0.25 < z < -3.2000000000000002e-238 or 1.29999999999999999e-178 < z < 3.00000000000000011e-120 or 1.01999999999999999e-54 < z < 1.5e10Initial program 99.4%
associate-*r*99.8%
metadata-eval99.8%
flip-+45.3%
clear-num45.2%
pow245.2%
Applied egg-rr45.2%
Taylor expanded in x around 0 63.0%
Taylor expanded in z around 0 60.0%
*-commutative60.0%
Simplified60.0%
if -3.2000000000000002e-238 < z < 1.29999999999999999e-178 or 3.00000000000000011e-120 < z < 1.01999999999999999e-54Initial program 99.3%
Taylor expanded in x around inf 69.2%
*-commutative69.2%
sub-neg69.2%
distribute-lft-in69.2%
metadata-eval69.2%
metadata-eval69.2%
neg-mul-169.2%
*-commutative69.2%
associate-*l*69.2%
distribute-rgt-in69.2%
distribute-lft-in69.2%
associate-+r+69.2%
metadata-eval69.2%
metadata-eval69.2%
metadata-eval69.2%
distribute-lft-in69.2%
+-commutative69.2%
distribute-rgt-in69.2%
*-commutative69.2%
associate-*l*69.2%
metadata-eval69.2%
metadata-eval69.2%
Simplified69.2%
Taylor expanded in z around 0 69.2%
*-commutative69.2%
Simplified69.2%
if 1.5e10 < z < 2.3499999999999999e83Initial program 99.4%
Taylor expanded in x around 0 99.6%
fma-def99.6%
*-commutative99.6%
associate-*r*99.7%
Simplified99.7%
Taylor expanded in z around inf 99.6%
associate-*r*99.6%
*-commutative99.6%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in x around 0 68.7%
Final simplification67.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* (- y x) z))))
(if (<= z -0.052)
t_0
(if (<= z -7.6e-239)
(* y 4.0)
(if (<= z 2.8e-179)
(* x -3.0)
(if (<= z 1.4e-123)
(* y 4.0)
(if (<= z 1.16e-55) (* x -3.0) (if (<= z 0.66) (* y 4.0) t_0))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -0.052) {
tmp = t_0;
} else if (z <= -7.6e-239) {
tmp = y * 4.0;
} else if (z <= 2.8e-179) {
tmp = x * -3.0;
} else if (z <= 1.4e-123) {
tmp = y * 4.0;
} else if (z <= 1.16e-55) {
tmp = x * -3.0;
} else if (z <= 0.66) {
tmp = y * 4.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 - x) * z)
if (z <= (-0.052d0)) then
tmp = t_0
else if (z <= (-7.6d-239)) then
tmp = y * 4.0d0
else if (z <= 2.8d-179) then
tmp = x * (-3.0d0)
else if (z <= 1.4d-123) then
tmp = y * 4.0d0
else if (z <= 1.16d-55) then
tmp = x * (-3.0d0)
else if (z <= 0.66d0) then
tmp = y * 4.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 - x) * z);
double tmp;
if (z <= -0.052) {
tmp = t_0;
} else if (z <= -7.6e-239) {
tmp = y * 4.0;
} else if (z <= 2.8e-179) {
tmp = x * -3.0;
} else if (z <= 1.4e-123) {
tmp = y * 4.0;
} else if (z <= 1.16e-55) {
tmp = x * -3.0;
} else if (z <= 0.66) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * ((y - x) * z) tmp = 0 if z <= -0.052: tmp = t_0 elif z <= -7.6e-239: tmp = y * 4.0 elif z <= 2.8e-179: tmp = x * -3.0 elif z <= 1.4e-123: tmp = y * 4.0 elif z <= 1.16e-55: tmp = x * -3.0 elif z <= 0.66: tmp = y * 4.0 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 <= -0.052) tmp = t_0; elseif (z <= -7.6e-239) tmp = Float64(y * 4.0); elseif (z <= 2.8e-179) tmp = Float64(x * -3.0); elseif (z <= 1.4e-123) tmp = Float64(y * 4.0); elseif (z <= 1.16e-55) tmp = Float64(x * -3.0); elseif (z <= 0.66) tmp = Float64(y * 4.0); 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 <= -0.052) tmp = t_0; elseif (z <= -7.6e-239) tmp = y * 4.0; elseif (z <= 2.8e-179) tmp = x * -3.0; elseif (z <= 1.4e-123) tmp = y * 4.0; elseif (z <= 1.16e-55) tmp = x * -3.0; elseif (z <= 0.66) tmp = y * 4.0; 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, -0.052], t$95$0, If[LessEqual[z, -7.6e-239], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.8e-179], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.4e-123], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.16e-55], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.66], N[(y * 4.0), $MachinePrecision], 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 -0.052:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -7.6 \cdot 10^{-239}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-179}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-123}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.16 \cdot 10^{-55}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -0.0519999999999999976 or 0.660000000000000031 < z Initial program 99.8%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 98.9%
if -0.0519999999999999976 < z < -7.6000000000000004e-239 or 2.8000000000000001e-179 < z < 1.3999999999999999e-123 or 1.15999999999999996e-55 < z < 0.660000000000000031Initial program 99.4%
associate-*r*99.8%
metadata-eval99.8%
flip-+45.9%
clear-num45.7%
pow245.7%
Applied egg-rr45.7%
Taylor expanded in x around 0 63.8%
Taylor expanded in z around 0 60.7%
*-commutative60.7%
Simplified60.7%
if -7.6000000000000004e-239 < z < 2.8000000000000001e-179 or 1.3999999999999999e-123 < z < 1.15999999999999996e-55Initial program 99.3%
Taylor expanded in x around inf 69.2%
*-commutative69.2%
sub-neg69.2%
distribute-lft-in69.2%
metadata-eval69.2%
metadata-eval69.2%
neg-mul-169.2%
*-commutative69.2%
associate-*l*69.2%
distribute-rgt-in69.2%
distribute-lft-in69.2%
associate-+r+69.2%
metadata-eval69.2%
metadata-eval69.2%
metadata-eval69.2%
distribute-lft-in69.2%
+-commutative69.2%
distribute-rgt-in69.2%
*-commutative69.2%
associate-*l*69.2%
metadata-eval69.2%
metadata-eval69.2%
Simplified69.2%
Taylor expanded in z around 0 69.2%
*-commutative69.2%
Simplified69.2%
Final simplification81.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* y (- 0.6666666666666666 z))))
(t_1 (* -6.0 (* (- y x) z))))
(if (<= z -800.0)
t_1
(if (<= z -1.22e-173)
t_0
(if (<= z 3.2e-176)
(* x -3.0)
(if (<= z 4e-122)
(* y 4.0)
(if (<= z 3.8e-55) (* x -3.0) (if (<= z 260000.0) t_0 t_1))))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (y * (0.6666666666666666 - z));
double t_1 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -800.0) {
tmp = t_1;
} else if (z <= -1.22e-173) {
tmp = t_0;
} else if (z <= 3.2e-176) {
tmp = x * -3.0;
} else if (z <= 4e-122) {
tmp = y * 4.0;
} else if (z <= 3.8e-55) {
tmp = x * -3.0;
} else if (z <= 260000.0) {
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 * (y * (0.6666666666666666d0 - z))
t_1 = (-6.0d0) * ((y - x) * z)
if (z <= (-800.0d0)) then
tmp = t_1
else if (z <= (-1.22d-173)) then
tmp = t_0
else if (z <= 3.2d-176) then
tmp = x * (-3.0d0)
else if (z <= 4d-122) then
tmp = y * 4.0d0
else if (z <= 3.8d-55) then
tmp = x * (-3.0d0)
else if (z <= 260000.0d0) 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 * (y * (0.6666666666666666 - z));
double t_1 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -800.0) {
tmp = t_1;
} else if (z <= -1.22e-173) {
tmp = t_0;
} else if (z <= 3.2e-176) {
tmp = x * -3.0;
} else if (z <= 4e-122) {
tmp = y * 4.0;
} else if (z <= 3.8e-55) {
tmp = x * -3.0;
} else if (z <= 260000.0) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (y * (0.6666666666666666 - z)) t_1 = -6.0 * ((y - x) * z) tmp = 0 if z <= -800.0: tmp = t_1 elif z <= -1.22e-173: tmp = t_0 elif z <= 3.2e-176: tmp = x * -3.0 elif z <= 4e-122: tmp = y * 4.0 elif z <= 3.8e-55: tmp = x * -3.0 elif z <= 260000.0: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))) t_1 = Float64(-6.0 * Float64(Float64(y - x) * z)) tmp = 0.0 if (z <= -800.0) tmp = t_1; elseif (z <= -1.22e-173) tmp = t_0; elseif (z <= 3.2e-176) tmp = Float64(x * -3.0); elseif (z <= 4e-122) tmp = Float64(y * 4.0); elseif (z <= 3.8e-55) tmp = Float64(x * -3.0); elseif (z <= 260000.0) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (y * (0.6666666666666666 - z)); t_1 = -6.0 * ((y - x) * z); tmp = 0.0; if (z <= -800.0) tmp = t_1; elseif (z <= -1.22e-173) tmp = t_0; elseif (z <= 3.2e-176) tmp = x * -3.0; elseif (z <= 4e-122) tmp = y * 4.0; elseif (z <= 3.8e-55) tmp = x * -3.0; elseif (z <= 260000.0) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -800.0], t$95$1, If[LessEqual[z, -1.22e-173], t$95$0, If[LessEqual[z, 3.2e-176], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 4e-122], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 3.8e-55], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 260000.0], t$95$0, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
t_1 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{if}\;z \leq -800:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.22 \cdot 10^{-173}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-176}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-122}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-55}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 260000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -800 or 2.6e5 < z Initial program 99.8%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 98.9%
if -800 < z < -1.21999999999999993e-173 or 3.7999999999999997e-55 < z < 2.6e5Initial program 99.4%
associate-*r*99.7%
metadata-eval99.7%
flip-+44.7%
clear-num44.6%
pow244.6%
Applied egg-rr44.6%
Taylor expanded in x around 0 59.1%
if -1.21999999999999993e-173 < z < 3.19999999999999985e-176 or 4.00000000000000024e-122 < z < 3.7999999999999997e-55Initial program 99.4%
Taylor expanded in x around inf 66.5%
*-commutative66.5%
sub-neg66.5%
distribute-lft-in66.5%
metadata-eval66.5%
metadata-eval66.5%
neg-mul-166.5%
*-commutative66.5%
associate-*l*66.5%
distribute-rgt-in66.5%
distribute-lft-in66.5%
associate-+r+66.5%
metadata-eval66.5%
metadata-eval66.5%
metadata-eval66.5%
distribute-lft-in66.5%
+-commutative66.5%
distribute-rgt-in66.5%
*-commutative66.5%
associate-*l*66.5%
metadata-eval66.5%
metadata-eval66.5%
Simplified66.5%
Taylor expanded in z around 0 66.5%
*-commutative66.5%
Simplified66.5%
if 3.19999999999999985e-176 < z < 4.00000000000000024e-122Initial program 99.4%
associate-*r*100.0%
metadata-eval100.0%
flip-+46.5%
clear-num46.3%
pow246.3%
Applied egg-rr46.3%
Taylor expanded in x around 0 83.2%
Taylor expanded in z around 0 83.6%
*-commutative83.6%
Simplified83.6%
Final simplification82.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -0.65)
t_0
(if (<= z -4.6e-238)
(* y 4.0)
(if (<= z 1.6e-178)
(* x -3.0)
(if (<= z 2.9e-120)
(* y 4.0)
(if (<= z 1.52e-55)
(* x -3.0)
(if (<= z 15000000000.0) (* y 4.0) t_0))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -0.65) {
tmp = t_0;
} else if (z <= -4.6e-238) {
tmp = y * 4.0;
} else if (z <= 1.6e-178) {
tmp = x * -3.0;
} else if (z <= 2.9e-120) {
tmp = y * 4.0;
} else if (z <= 1.52e-55) {
tmp = x * -3.0;
} else if (z <= 15000000000.0) {
tmp = y * 4.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 <= (-0.65d0)) then
tmp = t_0
else if (z <= (-4.6d-238)) then
tmp = y * 4.0d0
else if (z <= 1.6d-178) then
tmp = x * (-3.0d0)
else if (z <= 2.9d-120) then
tmp = y * 4.0d0
else if (z <= 1.52d-55) then
tmp = x * (-3.0d0)
else if (z <= 15000000000.0d0) then
tmp = y * 4.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 <= -0.65) {
tmp = t_0;
} else if (z <= -4.6e-238) {
tmp = y * 4.0;
} else if (z <= 1.6e-178) {
tmp = x * -3.0;
} else if (z <= 2.9e-120) {
tmp = y * 4.0;
} else if (z <= 1.52e-55) {
tmp = x * -3.0;
} else if (z <= 15000000000.0) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -0.65: tmp = t_0 elif z <= -4.6e-238: tmp = y * 4.0 elif z <= 1.6e-178: tmp = x * -3.0 elif z <= 2.9e-120: tmp = y * 4.0 elif z <= 1.52e-55: tmp = x * -3.0 elif z <= 15000000000.0: tmp = y * 4.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 <= -0.65) tmp = t_0; elseif (z <= -4.6e-238) tmp = Float64(y * 4.0); elseif (z <= 1.6e-178) tmp = Float64(x * -3.0); elseif (z <= 2.9e-120) tmp = Float64(y * 4.0); elseif (z <= 1.52e-55) tmp = Float64(x * -3.0); elseif (z <= 15000000000.0) tmp = Float64(y * 4.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 <= -0.65) tmp = t_0; elseif (z <= -4.6e-238) tmp = y * 4.0; elseif (z <= 1.6e-178) tmp = x * -3.0; elseif (z <= 2.9e-120) tmp = y * 4.0; elseif (z <= 1.52e-55) tmp = x * -3.0; elseif (z <= 15000000000.0) tmp = y * 4.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, -0.65], t$95$0, If[LessEqual[z, -4.6e-238], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.6e-178], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.9e-120], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.52e-55], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 15000000000.0], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -0.65:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -4.6 \cdot 10^{-238}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-178}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-120}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.52 \cdot 10^{-55}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 15000000000:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -0.650000000000000022 or 1.5e10 < z Initial program 99.8%
Taylor expanded in x around 0 95.9%
fma-def97.4%
*-commutative97.4%
associate-*r*97.5%
Simplified97.5%
Taylor expanded in z around inf 97.2%
associate-*r*97.2%
*-commutative97.2%
associate-*l*97.2%
Simplified97.2%
Taylor expanded in x around 0 47.3%
if -0.650000000000000022 < z < -4.60000000000000009e-238 or 1.6e-178 < z < 2.9e-120 or 1.5200000000000001e-55 < z < 1.5e10Initial program 99.4%
associate-*r*99.8%
metadata-eval99.8%
flip-+45.3%
clear-num45.2%
pow245.2%
Applied egg-rr45.2%
Taylor expanded in x around 0 63.0%
Taylor expanded in z around 0 60.0%
*-commutative60.0%
Simplified60.0%
if -4.60000000000000009e-238 < z < 1.6e-178 or 2.9e-120 < z < 1.5200000000000001e-55Initial program 99.3%
Taylor expanded in x around inf 69.2%
*-commutative69.2%
sub-neg69.2%
distribute-lft-in69.2%
metadata-eval69.2%
metadata-eval69.2%
neg-mul-169.2%
*-commutative69.2%
associate-*l*69.2%
distribute-rgt-in69.2%
distribute-lft-in69.2%
associate-+r+69.2%
metadata-eval69.2%
metadata-eval69.2%
metadata-eval69.2%
distribute-lft-in69.2%
+-commutative69.2%
distribute-rgt-in69.2%
*-commutative69.2%
associate-*l*69.2%
metadata-eval69.2%
metadata-eval69.2%
Simplified69.2%
Taylor expanded in z around 0 69.2%
*-commutative69.2%
Simplified69.2%
Final simplification55.1%
(FPCore (x y z) :precision binary64 (if (<= z -0.56) (* (- y x) (* z -6.0)) (if (<= z 0.56) (+ x (* (- y x) 4.0)) (+ x (* z (* 6.0 (- x y)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.56) {
tmp = (y - x) * (z * -6.0);
} else if (z <= 0.56) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = x + (z * (6.0 * (x - y)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-0.56d0)) then
tmp = (y - x) * (z * (-6.0d0))
else if (z <= 0.56d0) then
tmp = x + ((y - x) * 4.0d0)
else
tmp = x + (z * (6.0d0 * (x - y)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.56) {
tmp = (y - x) * (z * -6.0);
} else if (z <= 0.56) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = x + (z * (6.0 * (x - y)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.56: tmp = (y - x) * (z * -6.0) elif z <= 0.56: tmp = x + ((y - x) * 4.0) else: tmp = x + (z * (6.0 * (x - y))) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.56) tmp = Float64(Float64(y - x) * Float64(z * -6.0)); elseif (z <= 0.56) tmp = Float64(x + Float64(Float64(y - x) * 4.0)); else tmp = Float64(x + Float64(z * Float64(6.0 * Float64(x - y)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.56) tmp = (y - x) * (z * -6.0); elseif (z <= 0.56) tmp = x + ((y - x) * 4.0); else tmp = x + (z * (6.0 * (x - y))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.56], N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.56], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(6.0 * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.56:\\
\;\;\;\;\left(y - x\right) \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq 0.56:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(6 \cdot \left(x - y\right)\right)\\
\end{array}
\end{array}
if z < -0.56000000000000005Initial program 99.7%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 98.5%
associate-*r*98.7%
*-commutative98.7%
Simplified98.7%
if -0.56000000000000005 < z < 0.56000000000000005Initial program 99.4%
Taylor expanded in z around 0 96.7%
if 0.56000000000000005 < z Initial program 99.8%
Taylor expanded in z around inf 99.4%
neg-mul-199.4%
Simplified99.4%
Final simplification97.9%
(FPCore (x y z) :precision binary64 (if (or (<= x -6.6e+53) (not (<= x 3.3e+103))) (* x (+ (* z 6.0) -3.0)) (* 6.0 (* y (- 0.6666666666666666 z)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -6.6e+53) || !(x <= 3.3e+103)) {
tmp = x * ((z * 6.0) + -3.0);
} else {
tmp = 6.0 * (y * (0.6666666666666666 - 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 <= (-6.6d+53)) .or. (.not. (x <= 3.3d+103))) then
tmp = x * ((z * 6.0d0) + (-3.0d0))
else
tmp = 6.0d0 * (y * (0.6666666666666666d0 - z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -6.6e+53) || !(x <= 3.3e+103)) {
tmp = x * ((z * 6.0) + -3.0);
} else {
tmp = 6.0 * (y * (0.6666666666666666 - z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -6.6e+53) or not (x <= 3.3e+103): tmp = x * ((z * 6.0) + -3.0) else: tmp = 6.0 * (y * (0.6666666666666666 - z)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -6.6e+53) || !(x <= 3.3e+103)) tmp = Float64(x * Float64(Float64(z * 6.0) + -3.0)); else tmp = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -6.6e+53) || ~((x <= 3.3e+103))) tmp = x * ((z * 6.0) + -3.0); else tmp = 6.0 * (y * (0.6666666666666666 - z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -6.6e+53], N[Not[LessEqual[x, 3.3e+103]], $MachinePrecision]], N[(x * N[(N[(z * 6.0), $MachinePrecision] + -3.0), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.6 \cdot 10^{+53} \lor \neg \left(x \leq 3.3 \cdot 10^{+103}\right):\\
\;\;\;\;x \cdot \left(z \cdot 6 + -3\right)\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\end{array}
\end{array}
if x < -6.6000000000000004e53 or 3.30000000000000009e103 < x Initial program 99.7%
Taylor expanded in x around inf 86.7%
*-commutative86.7%
sub-neg86.7%
distribute-lft-in86.7%
metadata-eval86.7%
metadata-eval86.7%
neg-mul-186.7%
*-commutative86.7%
associate-*l*86.7%
distribute-rgt-in86.7%
distribute-lft-in86.7%
associate-+r+86.7%
metadata-eval86.7%
metadata-eval86.7%
metadata-eval86.7%
distribute-lft-in86.7%
+-commutative86.7%
distribute-rgt-in86.7%
*-commutative86.7%
associate-*l*86.7%
metadata-eval86.7%
metadata-eval86.7%
Simplified86.7%
if -6.6000000000000004e53 < x < 3.30000000000000009e103Initial program 99.5%
associate-*r*99.8%
metadata-eval99.8%
flip-+52.5%
clear-num52.4%
pow252.4%
Applied egg-rr52.4%
Taylor expanded in x around 0 71.1%
Final simplification77.4%
(FPCore (x y z) :precision binary64 (if (or (<= x -6e+54) (not (<= x 4e+103))) (* x (+ (* z 6.0) -3.0)) (* y (+ 4.0 (* z -6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -6e+54) || !(x <= 4e+103)) {
tmp = x * ((z * 6.0) + -3.0);
} else {
tmp = y * (4.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 ((x <= (-6d+54)) .or. (.not. (x <= 4d+103))) then
tmp = x * ((z * 6.0d0) + (-3.0d0))
else
tmp = y * (4.0d0 + (z * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -6e+54) || !(x <= 4e+103)) {
tmp = x * ((z * 6.0) + -3.0);
} else {
tmp = y * (4.0 + (z * -6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -6e+54) or not (x <= 4e+103): tmp = x * ((z * 6.0) + -3.0) else: tmp = y * (4.0 + (z * -6.0)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -6e+54) || !(x <= 4e+103)) tmp = Float64(x * Float64(Float64(z * 6.0) + -3.0)); else tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -6e+54) || ~((x <= 4e+103))) tmp = x * ((z * 6.0) + -3.0); else tmp = y * (4.0 + (z * -6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -6e+54], N[Not[LessEqual[x, 4e+103]], $MachinePrecision]], N[(x * N[(N[(z * 6.0), $MachinePrecision] + -3.0), $MachinePrecision]), $MachinePrecision], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6 \cdot 10^{+54} \lor \neg \left(x \leq 4 \cdot 10^{+103}\right):\\
\;\;\;\;x \cdot \left(z \cdot 6 + -3\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\end{array}
\end{array}
if x < -5.9999999999999998e54 or 4e103 < x Initial program 99.7%
Taylor expanded in x around inf 86.7%
*-commutative86.7%
sub-neg86.7%
distribute-lft-in86.7%
metadata-eval86.7%
metadata-eval86.7%
neg-mul-186.7%
*-commutative86.7%
associate-*l*86.7%
distribute-rgt-in86.7%
distribute-lft-in86.7%
associate-+r+86.7%
metadata-eval86.7%
metadata-eval86.7%
metadata-eval86.7%
distribute-lft-in86.7%
+-commutative86.7%
distribute-rgt-in86.7%
*-commutative86.7%
associate-*l*86.7%
metadata-eval86.7%
metadata-eval86.7%
Simplified86.7%
if -5.9999999999999998e54 < x < 4e103Initial program 99.5%
+-commutative99.5%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 71.3%
Final simplification77.5%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.56) (not (<= z 0.52))) (* (- y x) (* z -6.0)) (+ x (* (- y x) 4.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.56) || !(z <= 0.52)) {
tmp = (y - x) * (z * -6.0);
} else {
tmp = x + ((y - x) * 4.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 <= (-0.56d0)) .or. (.not. (z <= 0.52d0))) then
tmp = (y - x) * (z * (-6.0d0))
else
tmp = x + ((y - x) * 4.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.56) || !(z <= 0.52)) {
tmp = (y - x) * (z * -6.0);
} else {
tmp = x + ((y - x) * 4.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.56) or not (z <= 0.52): tmp = (y - x) * (z * -6.0) else: tmp = x + ((y - x) * 4.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.56) || !(z <= 0.52)) tmp = Float64(Float64(y - x) * Float64(z * -6.0)); else tmp = Float64(x + Float64(Float64(y - x) * 4.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.56) || ~((z <= 0.52))) tmp = (y - x) * (z * -6.0); else tmp = x + ((y - x) * 4.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.56], N[Not[LessEqual[z, 0.52]], $MachinePrecision]], N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.56 \lor \neg \left(z \leq 0.52\right):\\
\;\;\;\;\left(y - x\right) \cdot \left(z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\end{array}
\end{array}
if z < -0.56000000000000005 or 0.52000000000000002 < z Initial program 99.8%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 98.9%
associate-*r*99.0%
*-commutative99.0%
Simplified99.0%
if -0.56000000000000005 < z < 0.52000000000000002Initial program 99.4%
Taylor expanded in z around 0 96.7%
Final simplification97.9%
(FPCore (x y z) :precision binary64 (+ x (* (- y x) (* 6.0 (- 0.6666666666666666 z)))))
double code(double x, double y, double z) {
return x + ((y - x) * (6.0 * (0.6666666666666666 - 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 * (0.6666666666666666d0 - z)))
end function
public static double code(double x, double y, double z) {
return x + ((y - x) * (6.0 * (0.6666666666666666 - z)));
}
def code(x, y, z): return x + ((y - x) * (6.0 * (0.6666666666666666 - z)))
function code(x, y, z) return Float64(x + Float64(Float64(y - x) * Float64(6.0 * Float64(0.6666666666666666 - z)))) end
function tmp = code(x, y, z) tmp = x + ((y - x) * (6.0 * (0.6666666666666666 - z))); end
code[x_, y_, z_] := N[(x + N[(N[(y - x), $MachinePrecision] * N[(6.0 * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)
\end{array}
Initial program 99.6%
associate-*l*99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (if (<= y -3.5e-43) (* y 4.0) (if (<= y 17000.0) (* x -3.0) (* y 4.0))))
double code(double x, double y, double z) {
double tmp;
if (y <= -3.5e-43) {
tmp = y * 4.0;
} else if (y <= 17000.0) {
tmp = x * -3.0;
} else {
tmp = y * 4.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 (y <= (-3.5d-43)) then
tmp = y * 4.0d0
else if (y <= 17000.0d0) then
tmp = x * (-3.0d0)
else
tmp = y * 4.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -3.5e-43) {
tmp = y * 4.0;
} else if (y <= 17000.0) {
tmp = x * -3.0;
} else {
tmp = y * 4.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -3.5e-43: tmp = y * 4.0 elif y <= 17000.0: tmp = x * -3.0 else: tmp = y * 4.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -3.5e-43) tmp = Float64(y * 4.0); elseif (y <= 17000.0) tmp = Float64(x * -3.0); else tmp = Float64(y * 4.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -3.5e-43) tmp = y * 4.0; elseif (y <= 17000.0) tmp = x * -3.0; else tmp = y * 4.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -3.5e-43], N[(y * 4.0), $MachinePrecision], If[LessEqual[y, 17000.0], N[(x * -3.0), $MachinePrecision], N[(y * 4.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{-43}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;y \leq 17000:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4\\
\end{array}
\end{array}
if y < -3.49999999999999997e-43 or 17000 < y Initial program 99.6%
associate-*r*99.9%
metadata-eval99.9%
flip-+25.6%
clear-num25.5%
pow225.5%
Applied egg-rr25.5%
Taylor expanded in x around 0 74.3%
Taylor expanded in z around 0 42.8%
*-commutative42.8%
Simplified42.8%
if -3.49999999999999997e-43 < y < 17000Initial program 99.6%
Taylor expanded in x around inf 73.8%
*-commutative73.8%
sub-neg73.8%
distribute-lft-in73.8%
metadata-eval73.8%
metadata-eval73.8%
neg-mul-173.8%
*-commutative73.8%
associate-*l*73.8%
distribute-rgt-in73.8%
distribute-lft-in73.8%
associate-+r+73.8%
metadata-eval73.8%
metadata-eval73.8%
metadata-eval73.8%
distribute-lft-in73.8%
+-commutative73.8%
distribute-rgt-in73.8%
*-commutative73.8%
associate-*l*73.8%
metadata-eval73.8%
metadata-eval73.8%
Simplified73.8%
Taylor expanded in z around 0 35.8%
*-commutative35.8%
Simplified35.8%
Final simplification39.2%
(FPCore (x y z) :precision binary64 (* x -3.0))
double code(double x, double y, double z) {
return x * -3.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 * (-3.0d0)
end function
public static double code(double x, double y, double z) {
return x * -3.0;
}
def code(x, y, z): return x * -3.0
function code(x, y, z) return Float64(x * -3.0) end
function tmp = code(x, y, z) tmp = x * -3.0; end
code[x_, y_, z_] := N[(x * -3.0), $MachinePrecision]
\begin{array}{l}
\\
x \cdot -3
\end{array}
Initial program 99.6%
Taylor expanded in x around inf 53.2%
*-commutative53.2%
sub-neg53.2%
distribute-lft-in53.3%
metadata-eval53.3%
metadata-eval53.3%
neg-mul-153.3%
*-commutative53.3%
associate-*l*53.3%
distribute-rgt-in53.3%
distribute-lft-in53.3%
associate-+r+53.3%
metadata-eval53.3%
metadata-eval53.3%
metadata-eval53.3%
distribute-lft-in53.3%
+-commutative53.3%
distribute-rgt-in53.3%
*-commutative53.3%
associate-*l*53.3%
metadata-eval53.3%
metadata-eval53.3%
Simplified53.3%
Taylor expanded in z around 0 24.9%
*-commutative24.9%
Simplified24.9%
Final simplification24.9%
herbie shell --seed 2023182
(FPCore (x y z)
:name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, D"
:precision binary64
(+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))