
(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 13 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%
distribute-rgt-neg-out99.8%
*-commutative99.8%
distribute-rgt-neg-in99.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))))
(if (<= z -5.4e+87)
(* -6.0 (* y z))
(if (<= z -0.0027)
t_0
(if (<= z -5.1e-113)
(* x -3.0)
(if (<= z -1.25e-288)
(* y 4.0)
(if (<= z 1e-248)
(* x -3.0)
(if (<= z 6.2e-210)
(* y 4.0)
(if (<= z 15000.0) (* x -3.0) t_0)))))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (x * z);
double tmp;
if (z <= -5.4e+87) {
tmp = -6.0 * (y * z);
} else if (z <= -0.0027) {
tmp = t_0;
} else if (z <= -5.1e-113) {
tmp = x * -3.0;
} else if (z <= -1.25e-288) {
tmp = y * 4.0;
} else if (z <= 1e-248) {
tmp = x * -3.0;
} else if (z <= 6.2e-210) {
tmp = y * 4.0;
} else if (z <= 15000.0) {
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 * (x * z)
if (z <= (-5.4d+87)) then
tmp = (-6.0d0) * (y * z)
else if (z <= (-0.0027d0)) then
tmp = t_0
else if (z <= (-5.1d-113)) then
tmp = x * (-3.0d0)
else if (z <= (-1.25d-288)) then
tmp = y * 4.0d0
else if (z <= 1d-248) then
tmp = x * (-3.0d0)
else if (z <= 6.2d-210) then
tmp = y * 4.0d0
else if (z <= 15000.0d0) 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 * (x * z);
double tmp;
if (z <= -5.4e+87) {
tmp = -6.0 * (y * z);
} else if (z <= -0.0027) {
tmp = t_0;
} else if (z <= -5.1e-113) {
tmp = x * -3.0;
} else if (z <= -1.25e-288) {
tmp = y * 4.0;
} else if (z <= 1e-248) {
tmp = x * -3.0;
} else if (z <= 6.2e-210) {
tmp = y * 4.0;
} else if (z <= 15000.0) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (x * z) tmp = 0 if z <= -5.4e+87: tmp = -6.0 * (y * z) elif z <= -0.0027: tmp = t_0 elif z <= -5.1e-113: tmp = x * -3.0 elif z <= -1.25e-288: tmp = y * 4.0 elif z <= 1e-248: tmp = x * -3.0 elif z <= 6.2e-210: tmp = y * 4.0 elif z <= 15000.0: tmp = x * -3.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(x * z)) tmp = 0.0 if (z <= -5.4e+87) tmp = Float64(-6.0 * Float64(y * z)); elseif (z <= -0.0027) tmp = t_0; elseif (z <= -5.1e-113) tmp = Float64(x * -3.0); elseif (z <= -1.25e-288) tmp = Float64(y * 4.0); elseif (z <= 1e-248) tmp = Float64(x * -3.0); elseif (z <= 6.2e-210) tmp = Float64(y * 4.0); elseif (z <= 15000.0) tmp = Float64(x * -3.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (x * z); tmp = 0.0; if (z <= -5.4e+87) tmp = -6.0 * (y * z); elseif (z <= -0.0027) tmp = t_0; elseif (z <= -5.1e-113) tmp = x * -3.0; elseif (z <= -1.25e-288) tmp = y * 4.0; elseif (z <= 1e-248) tmp = x * -3.0; elseif (z <= 6.2e-210) tmp = y * 4.0; elseif (z <= 15000.0) 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[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.4e+87], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -0.0027], t$95$0, If[LessEqual[z, -5.1e-113], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.25e-288], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1e-248], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 6.2e-210], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 15000.0], N[(x * -3.0), $MachinePrecision], t$95$0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -5.4 \cdot 10^{+87}:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;z \leq -0.0027:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -5.1 \cdot 10^{-113}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{-288}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 10^{-248}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{-210}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 15000:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -5.40000000000000013e87Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 90.4%
fma-def90.4%
*-commutative90.4%
Simplified90.4%
Taylor expanded in z around 0 68.1%
Taylor expanded in z around inf 67.5%
if -5.40000000000000013e87 < z < -0.0027000000000000001 or 15000 < z Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 63.2%
sub-neg63.2%
distribute-rgt-in63.2%
metadata-eval63.2%
metadata-eval63.2%
neg-mul-163.2%
associate-*r*63.2%
*-commutative63.2%
distribute-lft-in63.2%
distribute-lft-in63.2%
associate-+r+63.2%
metadata-eval63.2%
metadata-eval63.2%
associate-*r*63.2%
metadata-eval63.2%
*-commutative63.2%
Simplified63.2%
Taylor expanded in z around inf 62.4%
if -0.0027000000000000001 < z < -5.09999999999999979e-113 or -1.25000000000000003e-288 < z < 9.9999999999999998e-249 or 6.19999999999999973e-210 < z < 15000Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 63.8%
sub-neg63.8%
distribute-rgt-in63.9%
metadata-eval63.9%
metadata-eval63.9%
neg-mul-163.9%
associate-*r*63.9%
*-commutative63.9%
distribute-lft-in63.9%
distribute-lft-in63.9%
associate-+r+63.9%
metadata-eval63.9%
metadata-eval63.9%
associate-*r*63.9%
metadata-eval63.9%
*-commutative63.9%
Simplified63.9%
Taylor expanded in z around 0 62.1%
*-commutative62.1%
Simplified62.1%
if -5.09999999999999979e-113 < z < -1.25000000000000003e-288 or 9.9999999999999998e-249 < z < 6.19999999999999973e-210Initial program 99.7%
+-commutative99.7%
*-commutative99.7%
associate-*l*99.5%
fma-def99.4%
metadata-eval99.4%
Simplified99.4%
fma-udef99.5%
associate-*r*99.7%
*-commutative99.7%
associate-*l*99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 99.9%
Taylor expanded in y around inf 73.9%
Final simplification65.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (* y -6.0))) (t_1 (* x (+ -3.0 (* z 6.0)))))
(if (<= x -3e-102)
t_1
(if (<= x -6.8e-127)
t_0
(if (<= x -6.4e-127)
(* 6.0 (* x z))
(if (<= x -2.2e-176)
(* y 4.0)
(if (<= x -6e-301) t_0 (if (<= x 1.05e-121) (* y 4.0) t_1))))))))
double code(double x, double y, double z) {
double t_0 = z * (y * -6.0);
double t_1 = x * (-3.0 + (z * 6.0));
double tmp;
if (x <= -3e-102) {
tmp = t_1;
} else if (x <= -6.8e-127) {
tmp = t_0;
} else if (x <= -6.4e-127) {
tmp = 6.0 * (x * z);
} else if (x <= -2.2e-176) {
tmp = y * 4.0;
} else if (x <= -6e-301) {
tmp = t_0;
} else if (x <= 1.05e-121) {
tmp = y * 4.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 = z * (y * (-6.0d0))
t_1 = x * ((-3.0d0) + (z * 6.0d0))
if (x <= (-3d-102)) then
tmp = t_1
else if (x <= (-6.8d-127)) then
tmp = t_0
else if (x <= (-6.4d-127)) then
tmp = 6.0d0 * (x * z)
else if (x <= (-2.2d-176)) then
tmp = y * 4.0d0
else if (x <= (-6d-301)) then
tmp = t_0
else if (x <= 1.05d-121) then
tmp = y * 4.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * (y * -6.0);
double t_1 = x * (-3.0 + (z * 6.0));
double tmp;
if (x <= -3e-102) {
tmp = t_1;
} else if (x <= -6.8e-127) {
tmp = t_0;
} else if (x <= -6.4e-127) {
tmp = 6.0 * (x * z);
} else if (x <= -2.2e-176) {
tmp = y * 4.0;
} else if (x <= -6e-301) {
tmp = t_0;
} else if (x <= 1.05e-121) {
tmp = y * 4.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = z * (y * -6.0) t_1 = x * (-3.0 + (z * 6.0)) tmp = 0 if x <= -3e-102: tmp = t_1 elif x <= -6.8e-127: tmp = t_0 elif x <= -6.4e-127: tmp = 6.0 * (x * z) elif x <= -2.2e-176: tmp = y * 4.0 elif x <= -6e-301: tmp = t_0 elif x <= 1.05e-121: tmp = y * 4.0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(z * Float64(y * -6.0)) t_1 = Float64(x * Float64(-3.0 + Float64(z * 6.0))) tmp = 0.0 if (x <= -3e-102) tmp = t_1; elseif (x <= -6.8e-127) tmp = t_0; elseif (x <= -6.4e-127) tmp = Float64(6.0 * Float64(x * z)); elseif (x <= -2.2e-176) tmp = Float64(y * 4.0); elseif (x <= -6e-301) tmp = t_0; elseif (x <= 1.05e-121) tmp = Float64(y * 4.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * (y * -6.0); t_1 = x * (-3.0 + (z * 6.0)); tmp = 0.0; if (x <= -3e-102) tmp = t_1; elseif (x <= -6.8e-127) tmp = t_0; elseif (x <= -6.4e-127) tmp = 6.0 * (x * z); elseif (x <= -2.2e-176) tmp = y * 4.0; elseif (x <= -6e-301) tmp = t_0; elseif (x <= 1.05e-121) tmp = y * 4.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(y * -6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3e-102], t$95$1, If[LessEqual[x, -6.8e-127], t$95$0, If[LessEqual[x, -6.4e-127], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.2e-176], N[(y * 4.0), $MachinePrecision], If[LessEqual[x, -6e-301], t$95$0, If[LessEqual[x, 1.05e-121], N[(y * 4.0), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(y \cdot -6\right)\\
t_1 := x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{if}\;x \leq -3 \cdot 10^{-102}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -6.8 \cdot 10^{-127}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -6.4 \cdot 10^{-127}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;x \leq -2.2 \cdot 10^{-176}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;x \leq -6 \cdot 10^{-301}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{-121}:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -3e-102 or 1.0499999999999999e-121 < x Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 71.3%
sub-neg71.3%
distribute-rgt-in71.3%
metadata-eval71.3%
metadata-eval71.3%
neg-mul-171.3%
associate-*r*71.3%
*-commutative71.3%
distribute-lft-in71.3%
distribute-lft-in71.3%
associate-+r+71.3%
metadata-eval71.3%
metadata-eval71.3%
associate-*r*71.3%
metadata-eval71.3%
*-commutative71.3%
Simplified71.3%
if -3e-102 < x < -6.7999999999999997e-127 or -2.1999999999999999e-176 < x < -5.99999999999999998e-301Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 99.7%
fma-def99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in z around 0 97.2%
Taylor expanded in z around inf 66.8%
*-commutative66.8%
*-commutative66.8%
associate-*l*70.6%
Simplified70.6%
if -6.7999999999999997e-127 < x < -6.40000000000000035e-127Initial program 100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
sub-neg100.0%
distribute-rgt-in100.0%
metadata-eval100.0%
metadata-eval100.0%
neg-mul-1100.0%
associate-*r*100.0%
*-commutative100.0%
distribute-lft-in100.0%
distribute-lft-in100.0%
associate-+r+100.0%
metadata-eval100.0%
metadata-eval100.0%
associate-*r*100.0%
metadata-eval100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in z around inf 100.0%
if -6.40000000000000035e-127 < x < -2.1999999999999999e-176 or -5.99999999999999998e-301 < x < 1.0499999999999999e-121Initial program 99.5%
+-commutative99.5%
*-commutative99.5%
associate-*l*99.6%
fma-def99.4%
metadata-eval99.4%
Simplified99.4%
fma-udef99.6%
associate-*r*99.5%
*-commutative99.5%
associate-*l*99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 62.7%
Taylor expanded in y around inf 58.7%
Final simplification69.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -0.00156)
t_0
(if (<= z -1.8e-112)
(* x -3.0)
(if (<= z -1.38e-288)
(* y 4.0)
(if (<= z 1.05e-252)
(* x -3.0)
(if (<= z 4e-208) (* y 4.0) (if (<= z 0.5) (* 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.00156) {
tmp = t_0;
} else if (z <= -1.8e-112) {
tmp = x * -3.0;
} else if (z <= -1.38e-288) {
tmp = y * 4.0;
} else if (z <= 1.05e-252) {
tmp = x * -3.0;
} else if (z <= 4e-208) {
tmp = y * 4.0;
} else if (z <= 0.5) {
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.00156d0)) then
tmp = t_0
else if (z <= (-1.8d-112)) then
tmp = x * (-3.0d0)
else if (z <= (-1.38d-288)) then
tmp = y * 4.0d0
else if (z <= 1.05d-252) then
tmp = x * (-3.0d0)
else if (z <= 4d-208) then
tmp = y * 4.0d0
else if (z <= 0.5d0) 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.00156) {
tmp = t_0;
} else if (z <= -1.8e-112) {
tmp = x * -3.0;
} else if (z <= -1.38e-288) {
tmp = y * 4.0;
} else if (z <= 1.05e-252) {
tmp = x * -3.0;
} else if (z <= 4e-208) {
tmp = y * 4.0;
} else if (z <= 0.5) {
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.00156: tmp = t_0 elif z <= -1.8e-112: tmp = x * -3.0 elif z <= -1.38e-288: tmp = y * 4.0 elif z <= 1.05e-252: tmp = x * -3.0 elif z <= 4e-208: tmp = y * 4.0 elif z <= 0.5: 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.00156) tmp = t_0; elseif (z <= -1.8e-112) tmp = Float64(x * -3.0); elseif (z <= -1.38e-288) tmp = Float64(y * 4.0); elseif (z <= 1.05e-252) tmp = Float64(x * -3.0); elseif (z <= 4e-208) tmp = Float64(y * 4.0); elseif (z <= 0.5) 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.00156) tmp = t_0; elseif (z <= -1.8e-112) tmp = x * -3.0; elseif (z <= -1.38e-288) tmp = y * 4.0; elseif (z <= 1.05e-252) tmp = x * -3.0; elseif (z <= 4e-208) tmp = y * 4.0; elseif (z <= 0.5) 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.00156], t$95$0, If[LessEqual[z, -1.8e-112], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.38e-288], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.05e-252], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 4e-208], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], 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.00156:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{-112}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -1.38 \cdot 10^{-288}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-252}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-208}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -0.00155999999999999997 or 0.5 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 95.3%
fma-def95.3%
*-commutative95.3%
Simplified95.3%
Taylor expanded in z around 0 53.2%
Taylor expanded in z around inf 51.6%
if -0.00155999999999999997 < z < -1.8e-112 or -1.3799999999999999e-288 < z < 1.05e-252 or 4.0000000000000004e-208 < z < 0.5Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 64.6%
sub-neg64.6%
distribute-rgt-in64.7%
metadata-eval64.7%
metadata-eval64.7%
neg-mul-164.7%
associate-*r*64.7%
*-commutative64.7%
distribute-lft-in64.7%
distribute-lft-in64.7%
associate-+r+64.6%
metadata-eval64.6%
metadata-eval64.6%
associate-*r*64.6%
metadata-eval64.6%
*-commutative64.6%
Simplified64.6%
Taylor expanded in z around 0 62.8%
*-commutative62.8%
Simplified62.8%
if -1.8e-112 < z < -1.3799999999999999e-288 or 1.05e-252 < z < 4.0000000000000004e-208Initial program 99.7%
+-commutative99.7%
*-commutative99.7%
associate-*l*99.5%
fma-def99.4%
metadata-eval99.4%
Simplified99.4%
fma-udef99.5%
associate-*r*99.7%
*-commutative99.7%
associate-*l*99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 99.9%
Taylor expanded in y around inf 73.9%
Final simplification58.6%
(FPCore (x y z)
:precision binary64
(if (<= z -9e+86)
(* -6.0 (* y z))
(if (or (<= z -1.1e-13) (not (<= z 2.15e-16)))
(* x (+ -3.0 (* z 6.0)))
(+ x (* (- y x) 4.0)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -9e+86) {
tmp = -6.0 * (y * z);
} else if ((z <= -1.1e-13) || !(z <= 2.15e-16)) {
tmp = x * (-3.0 + (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 <= (-9d+86)) then
tmp = (-6.0d0) * (y * z)
else if ((z <= (-1.1d-13)) .or. (.not. (z <= 2.15d-16))) then
tmp = x * ((-3.0d0) + (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 <= -9e+86) {
tmp = -6.0 * (y * z);
} else if ((z <= -1.1e-13) || !(z <= 2.15e-16)) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = x + ((y - x) * 4.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -9e+86: tmp = -6.0 * (y * z) elif (z <= -1.1e-13) or not (z <= 2.15e-16): tmp = x * (-3.0 + (z * 6.0)) else: tmp = x + ((y - x) * 4.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -9e+86) tmp = Float64(-6.0 * Float64(y * z)); elseif ((z <= -1.1e-13) || !(z <= 2.15e-16)) tmp = Float64(x * Float64(-3.0 + 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 <= -9e+86) tmp = -6.0 * (y * z); elseif ((z <= -1.1e-13) || ~((z <= 2.15e-16))) tmp = x * (-3.0 + (z * 6.0)); else tmp = x + ((y - x) * 4.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -9e+86], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -1.1e-13], N[Not[LessEqual[z, 2.15e-16]], $MachinePrecision]], N[(x * N[(-3.0 + 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 -9 \cdot 10^{+86}:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;z \leq -1.1 \cdot 10^{-13} \lor \neg \left(z \leq 2.15 \cdot 10^{-16}\right):\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\end{array}
\end{array}
if z < -8.99999999999999986e86Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 90.4%
fma-def90.4%
*-commutative90.4%
Simplified90.4%
Taylor expanded in z around 0 68.1%
Taylor expanded in z around inf 67.5%
if -8.99999999999999986e86 < z < -1.09999999999999998e-13 or 2.1499999999999999e-16 < z Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 63.4%
sub-neg63.4%
distribute-rgt-in63.4%
metadata-eval63.4%
metadata-eval63.4%
neg-mul-163.4%
associate-*r*63.4%
*-commutative63.4%
distribute-lft-in63.4%
distribute-lft-in63.4%
associate-+r+63.4%
metadata-eval63.4%
metadata-eval63.4%
associate-*r*63.4%
metadata-eval63.4%
*-commutative63.4%
Simplified63.4%
if -1.09999999999999998e-13 < z < 2.1499999999999999e-16Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 99.9%
Final simplification80.8%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.56) (not (<= z 0.65))) (* z (+ (* y -6.0) (* x 6.0))) (+ x (* (- y x) 4.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.56) || !(z <= 0.65)) {
tmp = z * ((y * -6.0) + (x * 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.65d0))) then
tmp = z * ((y * (-6.0d0)) + (x * 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.65)) {
tmp = z * ((y * -6.0) + (x * 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.65): tmp = z * ((y * -6.0) + (x * 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.65)) tmp = Float64(z * Float64(Float64(y * -6.0) + Float64(x * 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.65))) tmp = z * ((y * -6.0) + (x * 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.65]], $MachinePrecision]], N[(z * N[(N[(y * -6.0), $MachinePrecision] + N[(x * 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.56 \lor \neg \left(z \leq 0.65\right):\\
\;\;\;\;z \cdot \left(y \cdot -6 + x \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\end{array}
\end{array}
if z < -0.56000000000000005 or 0.650000000000000022 < z Initial program 99.7%
+-commutative99.7%
associate-*l*99.7%
fma-def99.7%
sub-neg99.7%
+-commutative99.7%
distribute-lft-in99.7%
distribute-rgt-neg-out99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around -inf 95.2%
Taylor expanded in z around inf 97.9%
if -0.56000000000000005 < z < 0.650000000000000022Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 97.5%
Final simplification97.7%
(FPCore (x y z) :precision binary64 (if (<= z -0.6) (* z (+ (* y -6.0) (* 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.6) {
tmp = z * ((y * -6.0) + (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.6d0)) then
tmp = z * ((y * (-6.0d0)) + (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.6) {
tmp = z * ((y * -6.0) + (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.6: tmp = z * ((y * -6.0) + (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.6) tmp = Float64(z * Float64(Float64(y * -6.0) + Float64(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.6) tmp = z * ((y * -6.0) + (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.6], N[(z * N[(N[(y * -6.0), $MachinePrecision] + N[(x * 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.6:\\
\;\;\;\;z \cdot \left(y \cdot -6 + x \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.599999999999999978Initial program 99.6%
+-commutative99.6%
associate-*l*99.7%
fma-def99.7%
sub-neg99.7%
+-commutative99.7%
distribute-lft-in99.7%
distribute-rgt-neg-out99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-def99.7%
metadata-eval99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around -inf 93.5%
Taylor expanded in z around inf 97.4%
if -0.599999999999999978 < z < 0.5Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 97.5%
if 0.5 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 98.7%
Final simplification97.7%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.85e-37) (not (<= y 3.6e-10))) (* y (+ 4.0 (* z -6.0))) (* x (+ -3.0 (* z 6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.85e-37) || !(y <= 3.6e-10)) {
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 <= (-1.85d-37)) .or. (.not. (y <= 3.6d-10))) 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 <= -1.85e-37) || !(y <= 3.6e-10)) {
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 <= -1.85e-37) or not (y <= 3.6e-10): 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 <= -1.85e-37) || !(y <= 3.6e-10)) 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 <= -1.85e-37) || ~((y <= 3.6e-10))) 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, -1.85e-37], N[Not[LessEqual[y, 3.6e-10]], $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 -1.85 \cdot 10^{-37} \lor \neg \left(y \leq 3.6 \cdot 10^{-10}\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 < -1.85e-37 or 3.6e-10 < y Initial program 99.7%
+-commutative99.7%
associate-*l*99.9%
fma-def99.9%
sub-neg99.9%
+-commutative99.9%
distribute-lft-in99.9%
distribute-rgt-neg-out99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-def99.9%
metadata-eval99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 76.4%
if -1.85e-37 < y < 3.6e-10Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 79.4%
sub-neg79.4%
distribute-rgt-in79.4%
metadata-eval79.4%
metadata-eval79.4%
neg-mul-179.4%
associate-*r*79.4%
*-commutative79.4%
distribute-lft-in79.4%
distribute-lft-in79.4%
associate-+r+79.4%
metadata-eval79.4%
metadata-eval79.4%
associate-*r*79.4%
metadata-eval79.4%
*-commutative79.4%
Simplified79.4%
Final simplification77.8%
(FPCore (x y z) :precision binary64 (+ x (* (- 0.6666666666666666 z) (* (- y x) 6.0))))
double code(double x, double y, double z) {
return x + ((0.6666666666666666 - z) * ((y - x) * 6.0));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + ((0.6666666666666666d0 - z) * ((y - x) * 6.0d0))
end function
public static double code(double x, double y, double z) {
return x + ((0.6666666666666666 - z) * ((y - x) * 6.0));
}
def code(x, y, z): return x + ((0.6666666666666666 - z) * ((y - x) * 6.0))
function code(x, y, z) return Float64(x + Float64(Float64(0.6666666666666666 - z) * Float64(Float64(y - x) * 6.0))) end
function tmp = code(x, y, z) tmp = x + ((0.6666666666666666 - z) * ((y - x) * 6.0)); end
code[x_, y_, z_] := N[(x + N[(N[(0.6666666666666666 - z), $MachinePrecision] * N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(0.6666666666666666 - z\right) \cdot \left(\left(y - x\right) \cdot 6\right)
\end{array}
Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.6%
(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%
+-commutative99.6%
*-commutative99.6%
associate-*l*99.5%
fma-def99.6%
metadata-eval99.6%
Simplified99.6%
fma-udef99.5%
associate-*r*99.6%
*-commutative99.6%
associate-*l*99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.05e-84) (not (<= x 6.4e-121))) (* x -3.0) (* y 4.0)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.05e-84) || !(x <= 6.4e-121)) {
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 ((x <= (-1.05d-84)) .or. (.not. (x <= 6.4d-121))) 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 ((x <= -1.05e-84) || !(x <= 6.4e-121)) {
tmp = x * -3.0;
} else {
tmp = y * 4.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.05e-84) or not (x <= 6.4e-121): tmp = x * -3.0 else: tmp = y * 4.0 return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.05e-84) || !(x <= 6.4e-121)) 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 ((x <= -1.05e-84) || ~((x <= 6.4e-121))) tmp = x * -3.0; else tmp = y * 4.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.05e-84], N[Not[LessEqual[x, 6.4e-121]], $MachinePrecision]], N[(x * -3.0), $MachinePrecision], N[(y * 4.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{-84} \lor \neg \left(x \leq 6.4 \cdot 10^{-121}\right):\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4\\
\end{array}
\end{array}
if x < -1.04999999999999999e-84 or 6.40000000000000038e-121 < x Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 71.7%
sub-neg71.7%
distribute-rgt-in71.8%
metadata-eval71.8%
metadata-eval71.8%
neg-mul-171.8%
associate-*r*71.8%
*-commutative71.8%
distribute-lft-in71.8%
distribute-lft-in71.8%
associate-+r+71.7%
metadata-eval71.7%
metadata-eval71.7%
associate-*r*71.7%
metadata-eval71.7%
*-commutative71.7%
Simplified71.7%
Taylor expanded in z around 0 33.5%
*-commutative33.5%
Simplified33.5%
if -1.04999999999999999e-84 < x < 6.40000000000000038e-121Initial program 99.6%
+-commutative99.6%
*-commutative99.6%
associate-*l*99.6%
fma-def99.5%
metadata-eval99.5%
Simplified99.5%
fma-udef99.6%
associate-*r*99.6%
*-commutative99.6%
associate-*l*99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 52.3%
Taylor expanded in y around inf 48.6%
Final simplification38.1%
(FPCore (x y z) :precision binary64 (* y 4.0))
double code(double x, double y, double z) {
return y * 4.0;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = y * 4.0d0
end function
public static double code(double x, double y, double z) {
return y * 4.0;
}
def code(x, y, z): return y * 4.0
function code(x, y, z) return Float64(y * 4.0) end
function tmp = code(x, y, z) tmp = y * 4.0; end
code[x_, y_, z_] := N[(y * 4.0), $MachinePrecision]
\begin{array}{l}
\\
y \cdot 4
\end{array}
Initial program 99.6%
+-commutative99.6%
*-commutative99.6%
associate-*l*99.5%
fma-def99.6%
metadata-eval99.6%
Simplified99.6%
fma-udef99.5%
associate-*r*99.6%
*-commutative99.6%
associate-*l*99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 48.6%
Taylor expanded in y around inf 25.0%
Final simplification25.0%
(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%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 50.5%
associate-*r*50.6%
Simplified50.6%
Taylor expanded in x around inf 2.5%
Final simplification2.5%
herbie shell --seed 2023308
(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))))