
(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-define99.9%
sub-neg99.9%
+-commutative99.9%
distribute-lft-in99.9%
distribute-rgt-neg-out99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-define99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (* z 6.0))) (t_1 (* -6.0 (* y z))))
(if (<= z -2.8e+177)
t_0
(if (<= z -2.8e+141)
t_1
(if (<= z -60000000000000.0)
t_0
(if (<= z 2.6e-86)
(* y 4.0)
(if (<= z 0.5)
(* x -3.0)
(if (or (<= z 7e+87) (not (<= z 1.1e+157))) 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 <= -2.8e+177) {
tmp = t_0;
} else if (z <= -2.8e+141) {
tmp = t_1;
} else if (z <= -60000000000000.0) {
tmp = t_0;
} else if (z <= 2.6e-86) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if ((z <= 7e+87) || !(z <= 1.1e+157)) {
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 <= (-2.8d+177)) then
tmp = t_0
else if (z <= (-2.8d+141)) then
tmp = t_1
else if (z <= (-60000000000000.0d0)) then
tmp = t_0
else if (z <= 2.6d-86) then
tmp = y * 4.0d0
else if (z <= 0.5d0) then
tmp = x * (-3.0d0)
else if ((z <= 7d+87) .or. (.not. (z <= 1.1d+157))) 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 <= -2.8e+177) {
tmp = t_0;
} else if (z <= -2.8e+141) {
tmp = t_1;
} else if (z <= -60000000000000.0) {
tmp = t_0;
} else if (z <= 2.6e-86) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if ((z <= 7e+87) || !(z <= 1.1e+157)) {
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 <= -2.8e+177: tmp = t_0 elif z <= -2.8e+141: tmp = t_1 elif z <= -60000000000000.0: tmp = t_0 elif z <= 2.6e-86: tmp = y * 4.0 elif z <= 0.5: tmp = x * -3.0 elif (z <= 7e+87) or not (z <= 1.1e+157): 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 <= -2.8e+177) tmp = t_0; elseif (z <= -2.8e+141) tmp = t_1; elseif (z <= -60000000000000.0) tmp = t_0; elseif (z <= 2.6e-86) tmp = Float64(y * 4.0); elseif (z <= 0.5) tmp = Float64(x * -3.0); elseif ((z <= 7e+87) || !(z <= 1.1e+157)) 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 <= -2.8e+177) tmp = t_0; elseif (z <= -2.8e+141) tmp = t_1; elseif (z <= -60000000000000.0) tmp = t_0; elseif (z <= 2.6e-86) tmp = y * 4.0; elseif (z <= 0.5) tmp = x * -3.0; elseif ((z <= 7e+87) || ~((z <= 1.1e+157))) 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, -2.8e+177], t$95$0, If[LessEqual[z, -2.8e+141], t$95$1, If[LessEqual[z, -60000000000000.0], t$95$0, If[LessEqual[z, 2.6e-86], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], If[Or[LessEqual[z, 7e+87], N[Not[LessEqual[z, 1.1e+157]], $MachinePrecision]], 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 -2.8 \cdot 10^{+177}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{+141}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -60000000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-86}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 7 \cdot 10^{+87} \lor \neg \left(z \leq 1.1 \cdot 10^{+157}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.80000000000000002e177 or -2.79999999999999991e141 < z < -6e13 or 0.5 < z < 6.99999999999999972e87 or 1.1000000000000001e157 < z Initial program 99.7%
Taylor expanded in x around inf 68.8%
+-commutative68.8%
sub-neg68.8%
distribute-rgt-in68.8%
metadata-eval68.8%
neg-mul-168.8%
associate-*r*68.8%
*-commutative68.8%
metadata-eval68.8%
distribute-lft-in68.8%
+-commutative68.8%
distribute-rgt-in68.8%
metadata-eval68.8%
associate-+r+68.8%
metadata-eval68.8%
*-commutative68.8%
associate-*l*68.8%
metadata-eval68.8%
Simplified68.8%
Taylor expanded in z around inf 67.7%
*-commutative67.7%
Simplified67.7%
if -2.80000000000000002e177 < z < -2.79999999999999991e141 or 6.99999999999999972e87 < z < 1.1000000000000001e157Initial program 99.9%
+-commutative99.9%
associate-*l*99.7%
fma-define99.7%
sub-neg99.7%
+-commutative99.7%
distribute-lft-in99.7%
distribute-rgt-neg-out99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-define99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 85.5%
Taylor expanded in z around inf 85.7%
if -6e13 < z < 2.6000000000000001e-86Initial program 99.4%
+-commutative99.4%
associate-*l*99.9%
fma-define99.9%
sub-neg99.9%
+-commutative99.9%
distribute-lft-in99.9%
distribute-rgt-neg-out99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-define99.9%
metadata-eval99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 65.6%
Taylor expanded in z around 0 63.8%
if 2.6000000000000001e-86 < z < 0.5Initial program 99.5%
Taylor expanded in x around inf 66.6%
+-commutative66.6%
sub-neg66.6%
distribute-rgt-in66.6%
metadata-eval66.6%
neg-mul-166.6%
associate-*r*66.6%
*-commutative66.6%
metadata-eval66.6%
distribute-lft-in66.6%
+-commutative66.6%
distribute-rgt-in66.6%
metadata-eval66.6%
associate-+r+66.6%
metadata-eval66.6%
*-commutative66.6%
associate-*l*66.6%
metadata-eval66.6%
Simplified66.6%
Taylor expanded in z around 0 62.5%
*-commutative62.5%
Simplified62.5%
Final simplification67.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* x z))) (t_1 (* -6.0 (* y z))))
(if (<= z -3.8e+182)
t_0
(if (<= z -2.9e+141)
t_1
(if (<= z -60000000000000.0)
t_0
(if (<= z 1.4e-87)
(* y 4.0)
(if (<= z 0.5)
(* x -3.0)
(if (or (<= z 1.35e+88) (not (<= z 4.6e+156))) t_0 t_1))))))))
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 <= -3.8e+182) {
tmp = t_0;
} else if (z <= -2.9e+141) {
tmp = t_1;
} else if (z <= -60000000000000.0) {
tmp = t_0;
} else if (z <= 1.4e-87) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if ((z <= 1.35e+88) || !(z <= 4.6e+156)) {
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 * (x * z)
t_1 = (-6.0d0) * (y * z)
if (z <= (-3.8d+182)) then
tmp = t_0
else if (z <= (-2.9d+141)) then
tmp = t_1
else if (z <= (-60000000000000.0d0)) then
tmp = t_0
else if (z <= 1.4d-87) then
tmp = y * 4.0d0
else if (z <= 0.5d0) then
tmp = x * (-3.0d0)
else if ((z <= 1.35d+88) .or. (.not. (z <= 4.6d+156))) 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 * (x * z);
double t_1 = -6.0 * (y * z);
double tmp;
if (z <= -3.8e+182) {
tmp = t_0;
} else if (z <= -2.9e+141) {
tmp = t_1;
} else if (z <= -60000000000000.0) {
tmp = t_0;
} else if (z <= 1.4e-87) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if ((z <= 1.35e+88) || !(z <= 4.6e+156)) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (x * z) t_1 = -6.0 * (y * z) tmp = 0 if z <= -3.8e+182: tmp = t_0 elif z <= -2.9e+141: tmp = t_1 elif z <= -60000000000000.0: tmp = t_0 elif z <= 1.4e-87: tmp = y * 4.0 elif z <= 0.5: tmp = x * -3.0 elif (z <= 1.35e+88) or not (z <= 4.6e+156): tmp = t_0 else: tmp = t_1 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 <= -3.8e+182) tmp = t_0; elseif (z <= -2.9e+141) tmp = t_1; elseif (z <= -60000000000000.0) tmp = t_0; elseif (z <= 1.4e-87) tmp = Float64(y * 4.0); elseif (z <= 0.5) tmp = Float64(x * -3.0); elseif ((z <= 1.35e+88) || !(z <= 4.6e+156)) tmp = t_0; else tmp = t_1; 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 <= -3.8e+182) tmp = t_0; elseif (z <= -2.9e+141) tmp = t_1; elseif (z <= -60000000000000.0) tmp = t_0; elseif (z <= 1.4e-87) tmp = y * 4.0; elseif (z <= 0.5) tmp = x * -3.0; elseif ((z <= 1.35e+88) || ~((z <= 4.6e+156))) tmp = t_0; else tmp = t_1; 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, -3.8e+182], t$95$0, If[LessEqual[z, -2.9e+141], t$95$1, If[LessEqual[z, -60000000000000.0], t$95$0, If[LessEqual[z, 1.4e-87], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], If[Or[LessEqual[z, 1.35e+88], N[Not[LessEqual[z, 4.6e+156]], $MachinePrecision]], t$95$0, t$95$1]]]]]]]]
\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 -3.8 \cdot 10^{+182}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{+141}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -60000000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-87}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{+88} \lor \neg \left(z \leq 4.6 \cdot 10^{+156}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.80000000000000013e182 or -2.90000000000000007e141 < z < -6e13 or 0.5 < z < 1.35000000000000008e88 or 4.5999999999999998e156 < z Initial program 99.7%
Taylor expanded in x around inf 68.8%
+-commutative68.8%
sub-neg68.8%
distribute-rgt-in68.8%
metadata-eval68.8%
neg-mul-168.8%
associate-*r*68.8%
*-commutative68.8%
metadata-eval68.8%
distribute-lft-in68.8%
+-commutative68.8%
distribute-rgt-in68.8%
metadata-eval68.8%
associate-+r+68.8%
metadata-eval68.8%
*-commutative68.8%
associate-*l*68.8%
metadata-eval68.8%
Simplified68.8%
Taylor expanded in z around inf 67.5%
if -3.80000000000000013e182 < z < -2.90000000000000007e141 or 1.35000000000000008e88 < z < 4.5999999999999998e156Initial program 99.9%
+-commutative99.9%
associate-*l*99.7%
fma-define99.7%
sub-neg99.7%
+-commutative99.7%
distribute-lft-in99.7%
distribute-rgt-neg-out99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-define99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 85.5%
Taylor expanded in z around inf 85.7%
if -6e13 < z < 1.4e-87Initial program 99.4%
+-commutative99.4%
associate-*l*99.9%
fma-define99.9%
sub-neg99.9%
+-commutative99.9%
distribute-lft-in99.9%
distribute-rgt-neg-out99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-define99.9%
metadata-eval99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 65.6%
Taylor expanded in z around 0 63.8%
if 1.4e-87 < z < 0.5Initial program 99.5%
Taylor expanded in x around inf 66.6%
+-commutative66.6%
sub-neg66.6%
distribute-rgt-in66.6%
metadata-eval66.6%
neg-mul-166.6%
associate-*r*66.6%
*-commutative66.6%
metadata-eval66.6%
distribute-lft-in66.6%
+-commutative66.6%
distribute-rgt-in66.6%
metadata-eval66.6%
associate-+r+66.6%
metadata-eval66.6%
*-commutative66.6%
associate-*l*66.6%
metadata-eval66.6%
Simplified66.6%
Taylor expanded in z around 0 62.5%
*-commutative62.5%
Simplified62.5%
Final simplification67.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -0.65)
t_0
(if (<= z 6.5e-88) (* y 4.0) (if (<= z 0.65) (* x -3.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 <= 6.5e-88) {
tmp = y * 4.0;
} else if (z <= 0.65) {
tmp = x * -3.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 <= 6.5d-88) then
tmp = y * 4.0d0
else if (z <= 0.65d0) then
tmp = x * (-3.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 <= 6.5e-88) {
tmp = y * 4.0;
} else if (z <= 0.65) {
tmp = x * -3.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 <= 6.5e-88: tmp = y * 4.0 elif z <= 0.65: tmp = x * -3.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 <= 6.5e-88) tmp = Float64(y * 4.0); elseif (z <= 0.65) tmp = Float64(x * -3.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 <= 6.5e-88) tmp = y * 4.0; elseif (z <= 0.65) tmp = x * -3.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, 6.5e-88], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.65], N[(x * -3.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 6.5 \cdot 10^{-88}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.65:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.650000000000000022 or 0.650000000000000022 < z Initial program 99.7%
+-commutative99.7%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
distribute-rgt-neg-out99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 49.5%
Taylor expanded in z around inf 49.0%
if -0.650000000000000022 < z < 6.50000000000000006e-88Initial program 99.4%
+-commutative99.4%
associate-*l*99.9%
fma-define99.9%
sub-neg99.9%
+-commutative99.9%
distribute-lft-in99.9%
distribute-rgt-neg-out99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-define99.9%
metadata-eval99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 65.2%
Taylor expanded in z around 0 64.3%
if 6.50000000000000006e-88 < z < 0.650000000000000022Initial program 99.5%
Taylor expanded in x around inf 66.6%
+-commutative66.6%
sub-neg66.6%
distribute-rgt-in66.6%
metadata-eval66.6%
neg-mul-166.6%
associate-*r*66.6%
*-commutative66.6%
metadata-eval66.6%
distribute-lft-in66.6%
+-commutative66.6%
distribute-rgt-in66.6%
metadata-eval66.6%
associate-+r+66.6%
metadata-eval66.6%
*-commutative66.6%
associate-*l*66.6%
metadata-eval66.6%
Simplified66.6%
Taylor expanded in z around 0 62.5%
*-commutative62.5%
Simplified62.5%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.65) (not (<= z 0.5))) (+ x (* (- y x) (* z -6.0))) (+ x (* (- y x) 4.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.65) || !(z <= 0.5)) {
tmp = x + ((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.65d0)) .or. (.not. (z <= 0.5d0))) then
tmp = x + ((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.65) || !(z <= 0.5)) {
tmp = x + ((y - x) * (z * -6.0));
} else {
tmp = x + ((y - x) * 4.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.65) or not (z <= 0.5): tmp = x + ((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.65) || !(z <= 0.5)) tmp = Float64(x + 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.65) || ~((z <= 0.5))) tmp = x + ((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.65], N[Not[LessEqual[z, 0.5]], $MachinePrecision]], N[(x + N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.65 \lor \neg \left(z \leq 0.5\right):\\
\;\;\;\;x + \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.650000000000000022 or 0.5 < z Initial program 99.7%
+-commutative99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 98.3%
*-commutative98.3%
*-commutative98.3%
associate-*r*98.4%
*-commutative98.4%
Simplified98.4%
if -0.650000000000000022 < z < 0.5Initial program 99.4%
Taylor expanded in z around 0 98.2%
Final simplification98.3%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.65) (not (<= z 0.62))) (+ x (* -6.0 (* (- y x) z))) (+ x (* (- y x) 4.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.65) || !(z <= 0.62)) {
tmp = x + (-6.0 * ((y - x) * z));
} 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.65d0)) .or. (.not. (z <= 0.62d0))) then
tmp = x + ((-6.0d0) * ((y - x) * z))
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.65) || !(z <= 0.62)) {
tmp = x + (-6.0 * ((y - x) * z));
} else {
tmp = x + ((y - x) * 4.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.65) or not (z <= 0.62): tmp = x + (-6.0 * ((y - x) * z)) else: tmp = x + ((y - x) * 4.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.65) || !(z <= 0.62)) tmp = Float64(x + Float64(-6.0 * Float64(Float64(y - x) * z))); 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.65) || ~((z <= 0.62))) tmp = x + (-6.0 * ((y - x) * z)); else tmp = x + ((y - x) * 4.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.65], N[Not[LessEqual[z, 0.62]], $MachinePrecision]], N[(x + N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.65 \lor \neg \left(z \leq 0.62\right):\\
\;\;\;\;x + -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\end{array}
\end{array}
if z < -0.650000000000000022 or 0.619999999999999996 < z Initial program 99.7%
Taylor expanded in z around inf 98.3%
if -0.650000000000000022 < z < 0.619999999999999996Initial program 99.4%
Taylor expanded in z around 0 98.2%
Final simplification98.3%
(FPCore (x y z) :precision binary64 (if (<= z -0.65) (+ x (* z (* (- y x) -6.0))) (if (<= z 0.5) (+ x (* (- y x) 4.0)) (+ x (* -6.0 (* (- y x) z))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.65) {
tmp = x + (z * ((y - x) * -6.0));
} else if (z <= 0.5) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = x + (-6.0 * ((y - x) * z));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-0.65d0)) then
tmp = x + (z * ((y - x) * (-6.0d0)))
else if (z <= 0.5d0) then
tmp = x + ((y - x) * 4.0d0)
else
tmp = x + ((-6.0d0) * ((y - x) * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.65) {
tmp = x + (z * ((y - x) * -6.0));
} else if (z <= 0.5) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = x + (-6.0 * ((y - x) * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.65: tmp = x + (z * ((y - x) * -6.0)) elif z <= 0.5: tmp = x + ((y - x) * 4.0) else: tmp = x + (-6.0 * ((y - x) * z)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.65) tmp = Float64(x + Float64(z * Float64(Float64(y - x) * -6.0))); elseif (z <= 0.5) tmp = Float64(x + Float64(Float64(y - x) * 4.0)); else tmp = Float64(x + Float64(-6.0 * Float64(Float64(y - x) * z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.65) tmp = x + (z * ((y - x) * -6.0)); elseif (z <= 0.5) tmp = x + ((y - x) * 4.0); else tmp = x + (-6.0 * ((y - x) * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.65], N[(x + N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.5], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision], N[(x + N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.65:\\
\;\;\;\;x + z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x + -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\end{array}
\end{array}
if z < -0.650000000000000022Initial program 99.8%
Taylor expanded in z around inf 99.6%
associate-*r*99.7%
*-commutative99.7%
associate-*r*99.6%
Simplified99.6%
if -0.650000000000000022 < z < 0.5Initial program 99.4%
Taylor expanded in z around 0 98.2%
if 0.5 < z Initial program 99.7%
Taylor expanded in z around inf 97.1%
Final simplification98.3%
(FPCore (x y z) :precision binary64 (if (or (<= y -9.6e-60) (not (<= y 2.8e-53))) (* y (+ 4.0 (* z -6.0))) (* x (+ -3.0 (* z 6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -9.6e-60) || !(y <= 2.8e-53)) {
tmp = y * (4.0 + (z * -6.0));
} else {
tmp = x * (-3.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 ((y <= (-9.6d-60)) .or. (.not. (y <= 2.8d-53))) then
tmp = y * (4.0d0 + (z * (-6.0d0)))
else
tmp = x * ((-3.0d0) + (z * 6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -9.6e-60) || !(y <= 2.8e-53)) {
tmp = y * (4.0 + (z * -6.0));
} else {
tmp = x * (-3.0 + (z * 6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -9.6e-60) or not (y <= 2.8e-53): tmp = y * (4.0 + (z * -6.0)) else: tmp = x * (-3.0 + (z * 6.0)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -9.6e-60) || !(y <= 2.8e-53)) tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); else tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -9.6e-60) || ~((y <= 2.8e-53))) tmp = y * (4.0 + (z * -6.0)); else tmp = x * (-3.0 + (z * 6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -9.6e-60], N[Not[LessEqual[y, 2.8e-53]], $MachinePrecision]], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.6 \cdot 10^{-60} \lor \neg \left(y \leq 2.8 \cdot 10^{-53}\right):\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\end{array}
\end{array}
if y < -9.60000000000000038e-60 or 2.79999999999999985e-53 < y Initial program 99.6%
+-commutative99.6%
associate-*l*99.9%
fma-define99.9%
sub-neg99.9%
+-commutative99.9%
distribute-lft-in99.9%
distribute-rgt-neg-out99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-define99.9%
metadata-eval99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 79.9%
if -9.60000000000000038e-60 < y < 2.79999999999999985e-53Initial program 99.5%
Taylor expanded in x around inf 83.2%
+-commutative83.2%
sub-neg83.2%
distribute-rgt-in83.2%
metadata-eval83.2%
neg-mul-183.2%
associate-*r*83.2%
*-commutative83.2%
metadata-eval83.2%
distribute-lft-in83.2%
+-commutative83.2%
distribute-rgt-in83.2%
metadata-eval83.2%
associate-+r+83.2%
metadata-eval83.2%
*-commutative83.2%
associate-*l*83.2%
metadata-eval83.2%
Simplified83.2%
Final simplification81.3%
(FPCore (x y z) :precision binary64 (if (or (<= y -7e-58) (not (<= y 2.7e-53))) (* 6.0 (* y (- 0.6666666666666666 z))) (* x (+ -3.0 (* z 6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -7e-58) || !(y <= 2.7e-53)) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else {
tmp = x * (-3.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 ((y <= (-7d-58)) .or. (.not. (y <= 2.7d-53))) then
tmp = 6.0d0 * (y * (0.6666666666666666d0 - z))
else
tmp = x * ((-3.0d0) + (z * 6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -7e-58) || !(y <= 2.7e-53)) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else {
tmp = x * (-3.0 + (z * 6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -7e-58) or not (y <= 2.7e-53): tmp = 6.0 * (y * (0.6666666666666666 - z)) else: tmp = x * (-3.0 + (z * 6.0)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -7e-58) || !(y <= 2.7e-53)) tmp = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))); else tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -7e-58) || ~((y <= 2.7e-53))) tmp = 6.0 * (y * (0.6666666666666666 - z)); else tmp = x * (-3.0 + (z * 6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -7e-58], N[Not[LessEqual[y, 2.7e-53]], $MachinePrecision]], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{-58} \lor \neg \left(y \leq 2.7 \cdot 10^{-53}\right):\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\end{array}
\end{array}
if y < -6.9999999999999998e-58 or 2.6999999999999999e-53 < y Initial program 99.7%
Taylor expanded in x around inf 82.0%
Taylor expanded in x around 0 80.2%
if -6.9999999999999998e-58 < y < 2.6999999999999999e-53Initial program 99.5%
Taylor expanded in x around inf 82.7%
+-commutative82.7%
sub-neg82.7%
distribute-rgt-in82.7%
metadata-eval82.7%
neg-mul-182.7%
associate-*r*82.7%
*-commutative82.7%
metadata-eval82.7%
distribute-lft-in82.7%
+-commutative82.7%
distribute-rgt-in82.7%
metadata-eval82.7%
associate-+r+82.7%
metadata-eval82.7%
*-commutative82.7%
associate-*l*82.7%
metadata-eval82.7%
Simplified82.7%
Final simplification81.2%
(FPCore (x y z) :precision binary64 (if (or (<= y -6.4e-159) (not (<= y 9.4e-54))) (* 6.0 (* y (- 0.6666666666666666 z))) (* x (* z 6.0))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -6.4e-159) || !(y <= 9.4e-54)) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else {
tmp = x * (z * 6.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-6.4d-159)) .or. (.not. (y <= 9.4d-54))) then
tmp = 6.0d0 * (y * (0.6666666666666666d0 - z))
else
tmp = x * (z * 6.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -6.4e-159) || !(y <= 9.4e-54)) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else {
tmp = x * (z * 6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -6.4e-159) or not (y <= 9.4e-54): tmp = 6.0 * (y * (0.6666666666666666 - z)) else: tmp = x * (z * 6.0) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -6.4e-159) || !(y <= 9.4e-54)) tmp = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))); else tmp = Float64(x * Float64(z * 6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -6.4e-159) || ~((y <= 9.4e-54))) tmp = 6.0 * (y * (0.6666666666666666 - z)); else tmp = x * (z * 6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -6.4e-159], N[Not[LessEqual[y, 9.4e-54]], $MachinePrecision]], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.4 \cdot 10^{-159} \lor \neg \left(y \leq 9.4 \cdot 10^{-54}\right):\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\end{array}
\end{array}
if y < -6.3999999999999999e-159 or 9.4e-54 < y Initial program 99.6%
Taylor expanded in x around inf 83.3%
Taylor expanded in x around 0 76.2%
if -6.3999999999999999e-159 < y < 9.4e-54Initial program 99.5%
Taylor expanded in x around inf 86.7%
+-commutative86.7%
sub-neg86.7%
distribute-rgt-in86.7%
metadata-eval86.7%
neg-mul-186.7%
associate-*r*86.7%
*-commutative86.7%
metadata-eval86.7%
distribute-lft-in86.7%
+-commutative86.7%
distribute-rgt-in86.7%
metadata-eval86.7%
associate-+r+86.7%
metadata-eval86.7%
*-commutative86.7%
associate-*l*86.7%
metadata-eval86.7%
Simplified86.7%
Taylor expanded in z around inf 53.4%
*-commutative53.4%
Simplified53.4%
Final simplification67.9%
(FPCore (x y z) :precision binary64 (if (or (<= y -2.5e-68) (not (<= y 1.2e-54))) (* y 4.0) (* x -3.0)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -2.5e-68) || !(y <= 1.2e-54)) {
tmp = y * 4.0;
} else {
tmp = x * -3.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 <= (-2.5d-68)) .or. (.not. (y <= 1.2d-54))) then
tmp = y * 4.0d0
else
tmp = x * (-3.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -2.5e-68) || !(y <= 1.2e-54)) {
tmp = y * 4.0;
} else {
tmp = x * -3.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -2.5e-68) or not (y <= 1.2e-54): tmp = y * 4.0 else: tmp = x * -3.0 return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -2.5e-68) || !(y <= 1.2e-54)) tmp = Float64(y * 4.0); else tmp = Float64(x * -3.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -2.5e-68) || ~((y <= 1.2e-54))) tmp = y * 4.0; else tmp = x * -3.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -2.5e-68], N[Not[LessEqual[y, 1.2e-54]], $MachinePrecision]], N[(y * 4.0), $MachinePrecision], N[(x * -3.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{-68} \lor \neg \left(y \leq 1.2 \cdot 10^{-54}\right):\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3\\
\end{array}
\end{array}
if y < -2.49999999999999986e-68 or 1.20000000000000007e-54 < y Initial program 99.6%
+-commutative99.6%
associate-*l*99.9%
fma-define99.9%
sub-neg99.9%
+-commutative99.9%
distribute-lft-in99.9%
distribute-rgt-neg-out99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-define99.9%
metadata-eval99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 79.0%
Taylor expanded in z around 0 42.8%
if -2.49999999999999986e-68 < y < 1.20000000000000007e-54Initial program 99.5%
Taylor expanded in x around inf 83.7%
+-commutative83.7%
sub-neg83.7%
distribute-rgt-in83.7%
metadata-eval83.7%
neg-mul-183.7%
associate-*r*83.7%
*-commutative83.7%
metadata-eval83.7%
distribute-lft-in83.7%
+-commutative83.7%
distribute-rgt-in83.7%
metadata-eval83.7%
associate-+r+83.7%
metadata-eval83.7%
*-commutative83.7%
associate-*l*83.7%
metadata-eval83.7%
Simplified83.7%
Taylor expanded in z around 0 36.3%
*-commutative36.3%
Simplified36.3%
Final simplification40.1%
(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(Float64(y - x) * 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[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)
\end{array}
Initial program 99.6%
+-commutative99.6%
metadata-eval99.6%
Applied egg-rr99.6%
Final simplification99.6%
(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 51.4%
+-commutative51.4%
sub-neg51.4%
distribute-rgt-in51.4%
metadata-eval51.4%
neg-mul-151.4%
associate-*r*51.4%
*-commutative51.4%
metadata-eval51.4%
distribute-lft-in51.4%
+-commutative51.4%
distribute-rgt-in51.4%
metadata-eval51.4%
associate-+r+51.4%
metadata-eval51.4%
*-commutative51.4%
associate-*l*51.4%
metadata-eval51.4%
Simplified51.4%
Taylor expanded in z around 0 20.8%
*-commutative20.8%
Simplified20.8%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.6%
Taylor expanded in z around inf 54.2%
associate-*r*54.3%
*-commutative54.3%
associate-*r*54.3%
Simplified54.3%
Taylor expanded in z around 0 2.7%
herbie shell --seed 2024096
(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))))