
(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) (+ 4.0 (* z -6.0)) x))
double code(double x, double y, double z) {
return fma((y - x), (4.0 + (z * -6.0)), x);
}
function code(x, y, z) return fma(Float64(y - x), Float64(4.0 + Float64(z * -6.0)), x) end
code[x_, y_, z_] := N[(N[(y - x), $MachinePrecision] * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - x, 4 + z \cdot -6, x\right)
\end{array}
Initial program 99.2%
+-commutative99.2%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (fma (* (- y x) (- 0.6666666666666666 z)) 6.0 x))
double code(double x, double y, double z) {
return fma(((y - x) * (0.6666666666666666 - z)), 6.0, x);
}
function code(x, y, z) return fma(Float64(Float64(y - x) * Float64(0.6666666666666666 - z)), 6.0, x) end
code[x_, y_, z_] := N[(N[(N[(y - x), $MachinePrecision] * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision] * 6.0 + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\left(y - x\right) \cdot \left(0.6666666666666666 - z\right), 6, x\right)
\end{array}
Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
+-commutative99.2%
*-commutative99.2%
associate-*r*99.5%
fma-define99.4%
Applied egg-rr99.4%
Final simplification99.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -0.09)
t_0
(if (<= z -1.15e-82)
(* y 4.0)
(if (<= z -2.15e-185)
(* x -3.0)
(if (<= z -3.6e-226)
(* y 4.0)
(if (<= z 1.05e-303)
(* x -3.0)
(if (<= z 4.4e-266)
(* y 4.0)
(if (<= z 3.2e-72)
(* x -3.0)
(if (<= z 0.52)
(* y 4.0)
(if (<= z 1.85e+137) (* 6.0 (* x z)) t_0)))))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -0.09) {
tmp = t_0;
} else if (z <= -1.15e-82) {
tmp = y * 4.0;
} else if (z <= -2.15e-185) {
tmp = x * -3.0;
} else if (z <= -3.6e-226) {
tmp = y * 4.0;
} else if (z <= 1.05e-303) {
tmp = x * -3.0;
} else if (z <= 4.4e-266) {
tmp = y * 4.0;
} else if (z <= 3.2e-72) {
tmp = x * -3.0;
} else if (z <= 0.52) {
tmp = y * 4.0;
} else if (z <= 1.85e+137) {
tmp = 6.0 * (x * z);
} 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.09d0)) then
tmp = t_0
else if (z <= (-1.15d-82)) then
tmp = y * 4.0d0
else if (z <= (-2.15d-185)) then
tmp = x * (-3.0d0)
else if (z <= (-3.6d-226)) then
tmp = y * 4.0d0
else if (z <= 1.05d-303) then
tmp = x * (-3.0d0)
else if (z <= 4.4d-266) then
tmp = y * 4.0d0
else if (z <= 3.2d-72) then
tmp = x * (-3.0d0)
else if (z <= 0.52d0) then
tmp = y * 4.0d0
else if (z <= 1.85d+137) then
tmp = 6.0d0 * (x * z)
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.09) {
tmp = t_0;
} else if (z <= -1.15e-82) {
tmp = y * 4.0;
} else if (z <= -2.15e-185) {
tmp = x * -3.0;
} else if (z <= -3.6e-226) {
tmp = y * 4.0;
} else if (z <= 1.05e-303) {
tmp = x * -3.0;
} else if (z <= 4.4e-266) {
tmp = y * 4.0;
} else if (z <= 3.2e-72) {
tmp = x * -3.0;
} else if (z <= 0.52) {
tmp = y * 4.0;
} else if (z <= 1.85e+137) {
tmp = 6.0 * (x * z);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -0.09: tmp = t_0 elif z <= -1.15e-82: tmp = y * 4.0 elif z <= -2.15e-185: tmp = x * -3.0 elif z <= -3.6e-226: tmp = y * 4.0 elif z <= 1.05e-303: tmp = x * -3.0 elif z <= 4.4e-266: tmp = y * 4.0 elif z <= 3.2e-72: tmp = x * -3.0 elif z <= 0.52: tmp = y * 4.0 elif z <= 1.85e+137: tmp = 6.0 * (x * z) 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.09) tmp = t_0; elseif (z <= -1.15e-82) tmp = Float64(y * 4.0); elseif (z <= -2.15e-185) tmp = Float64(x * -3.0); elseif (z <= -3.6e-226) tmp = Float64(y * 4.0); elseif (z <= 1.05e-303) tmp = Float64(x * -3.0); elseif (z <= 4.4e-266) tmp = Float64(y * 4.0); elseif (z <= 3.2e-72) tmp = Float64(x * -3.0); elseif (z <= 0.52) tmp = Float64(y * 4.0); elseif (z <= 1.85e+137) tmp = Float64(6.0 * Float64(x * z)); 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.09) tmp = t_0; elseif (z <= -1.15e-82) tmp = y * 4.0; elseif (z <= -2.15e-185) tmp = x * -3.0; elseif (z <= -3.6e-226) tmp = y * 4.0; elseif (z <= 1.05e-303) tmp = x * -3.0; elseif (z <= 4.4e-266) tmp = y * 4.0; elseif (z <= 3.2e-72) tmp = x * -3.0; elseif (z <= 0.52) tmp = y * 4.0; elseif (z <= 1.85e+137) tmp = 6.0 * (x * z); 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.09], t$95$0, If[LessEqual[z, -1.15e-82], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -2.15e-185], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -3.6e-226], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.05e-303], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 4.4e-266], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 3.2e-72], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.52], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.85e+137], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -0.09:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.15 \cdot 10^{-82}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -2.15 \cdot 10^{-185}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{-226}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-303}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-266}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-72}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.52:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{+137}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.089999999999999997 or 1.8500000000000001e137 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
+-commutative99.8%
*-commutative99.8%
associate-*r*99.8%
fma-define99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 59.1%
Taylor expanded in z around inf 58.6%
if -0.089999999999999997 < z < -1.14999999999999998e-82 or -2.15e-185 < z < -3.59999999999999994e-226 or 1.05e-303 < z < 4.3999999999999999e-266 or 3.19999999999999999e-72 < z < 0.52000000000000002Initial program 98.2%
metadata-eval98.2%
Simplified98.2%
+-commutative98.2%
*-commutative98.2%
associate-*r*99.2%
fma-define99.2%
Applied egg-rr99.2%
Taylor expanded in y around inf 71.1%
Taylor expanded in z around 0 70.5%
if -1.14999999999999998e-82 < z < -2.15e-185 or -3.59999999999999994e-226 < z < 1.05e-303 or 4.3999999999999999e-266 < z < 3.19999999999999999e-72Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around inf 66.6%
+-commutative66.6%
+-commutative66.6%
metadata-eval66.6%
cancel-sign-sub-inv66.6%
*-commutative66.6%
cancel-sign-sub-inv66.6%
distribute-lft-neg-in66.6%
*-commutative66.6%
sub-neg66.6%
distribute-lft-in66.6%
metadata-eval66.6%
distribute-rgt-neg-in66.6%
distribute-lft-neg-in66.6%
metadata-eval66.6%
mul-1-neg66.6%
distribute-lft-in66.6%
metadata-eval66.6%
associate-+r+66.6%
metadata-eval66.6%
Simplified66.6%
Taylor expanded in z around 0 66.6%
*-commutative66.6%
Simplified66.6%
if 0.52000000000000002 < z < 1.8500000000000001e137Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 63.0%
+-commutative63.0%
+-commutative63.0%
metadata-eval63.0%
cancel-sign-sub-inv63.0%
*-commutative63.0%
cancel-sign-sub-inv63.0%
distribute-lft-neg-in63.0%
*-commutative63.0%
sub-neg63.0%
distribute-lft-in63.0%
metadata-eval63.0%
distribute-rgt-neg-in63.0%
distribute-lft-neg-in63.0%
metadata-eval63.0%
mul-1-neg63.0%
distribute-lft-in63.0%
metadata-eval63.0%
associate-+r+63.0%
metadata-eval63.0%
Simplified63.0%
Taylor expanded in z around inf 63.2%
Final simplification64.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -0.09)
t_0
(if (<= z -3.5e-82)
(* y 4.0)
(if (<= z -4.5e-184)
(* x -3.0)
(if (<= z -2.2e-225)
(* y 4.0)
(if (<= z 3.3e-304)
(* x -3.0)
(if (<= z 1.9e-257)
(* y 4.0)
(if (<= z 2.35e-73)
(* x -3.0)
(if (<= z 0.6)
(* y 4.0)
(if (<= z 3.7e+136) (* z (* x 6.0)) t_0)))))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -0.09) {
tmp = t_0;
} else if (z <= -3.5e-82) {
tmp = y * 4.0;
} else if (z <= -4.5e-184) {
tmp = x * -3.0;
} else if (z <= -2.2e-225) {
tmp = y * 4.0;
} else if (z <= 3.3e-304) {
tmp = x * -3.0;
} else if (z <= 1.9e-257) {
tmp = y * 4.0;
} else if (z <= 2.35e-73) {
tmp = x * -3.0;
} else if (z <= 0.6) {
tmp = y * 4.0;
} else if (z <= 3.7e+136) {
tmp = z * (x * 6.0);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
if (z <= (-0.09d0)) then
tmp = t_0
else if (z <= (-3.5d-82)) then
tmp = y * 4.0d0
else if (z <= (-4.5d-184)) then
tmp = x * (-3.0d0)
else if (z <= (-2.2d-225)) then
tmp = y * 4.0d0
else if (z <= 3.3d-304) then
tmp = x * (-3.0d0)
else if (z <= 1.9d-257) then
tmp = y * 4.0d0
else if (z <= 2.35d-73) then
tmp = x * (-3.0d0)
else if (z <= 0.6d0) then
tmp = y * 4.0d0
else if (z <= 3.7d+136) then
tmp = z * (x * 6.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -0.09) {
tmp = t_0;
} else if (z <= -3.5e-82) {
tmp = y * 4.0;
} else if (z <= -4.5e-184) {
tmp = x * -3.0;
} else if (z <= -2.2e-225) {
tmp = y * 4.0;
} else if (z <= 3.3e-304) {
tmp = x * -3.0;
} else if (z <= 1.9e-257) {
tmp = y * 4.0;
} else if (z <= 2.35e-73) {
tmp = x * -3.0;
} else if (z <= 0.6) {
tmp = y * 4.0;
} else if (z <= 3.7e+136) {
tmp = z * (x * 6.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -0.09: tmp = t_0 elif z <= -3.5e-82: tmp = y * 4.0 elif z <= -4.5e-184: tmp = x * -3.0 elif z <= -2.2e-225: tmp = y * 4.0 elif z <= 3.3e-304: tmp = x * -3.0 elif z <= 1.9e-257: tmp = y * 4.0 elif z <= 2.35e-73: tmp = x * -3.0 elif z <= 0.6: tmp = y * 4.0 elif z <= 3.7e+136: tmp = z * (x * 6.0) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -0.09) tmp = t_0; elseif (z <= -3.5e-82) tmp = Float64(y * 4.0); elseif (z <= -4.5e-184) tmp = Float64(x * -3.0); elseif (z <= -2.2e-225) tmp = Float64(y * 4.0); elseif (z <= 3.3e-304) tmp = Float64(x * -3.0); elseif (z <= 1.9e-257) tmp = Float64(y * 4.0); elseif (z <= 2.35e-73) tmp = Float64(x * -3.0); elseif (z <= 0.6) tmp = Float64(y * 4.0); elseif (z <= 3.7e+136) tmp = Float64(z * Float64(x * 6.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); tmp = 0.0; if (z <= -0.09) tmp = t_0; elseif (z <= -3.5e-82) tmp = y * 4.0; elseif (z <= -4.5e-184) tmp = x * -3.0; elseif (z <= -2.2e-225) tmp = y * 4.0; elseif (z <= 3.3e-304) tmp = x * -3.0; elseif (z <= 1.9e-257) tmp = y * 4.0; elseif (z <= 2.35e-73) tmp = x * -3.0; elseif (z <= 0.6) tmp = y * 4.0; elseif (z <= 3.7e+136) tmp = z * (x * 6.0); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.09], t$95$0, If[LessEqual[z, -3.5e-82], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -4.5e-184], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -2.2e-225], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 3.3e-304], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.9e-257], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.35e-73], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.6], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 3.7e+136], N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -0.09:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{-82}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{-184}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-225}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{-304}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-257}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 2.35 \cdot 10^{-73}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.6:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{+136}:\\
\;\;\;\;z \cdot \left(x \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.089999999999999997 or 3.7000000000000001e136 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
+-commutative99.8%
*-commutative99.8%
associate-*r*99.8%
fma-define99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 59.1%
Taylor expanded in z around inf 58.6%
if -0.089999999999999997 < z < -3.4999999999999999e-82 or -4.5000000000000001e-184 < z < -2.2e-225 or 3.30000000000000013e-304 < z < 1.9000000000000002e-257 or 2.34999999999999997e-73 < z < 0.599999999999999978Initial program 98.2%
metadata-eval98.2%
Simplified98.2%
+-commutative98.2%
*-commutative98.2%
associate-*r*99.2%
fma-define99.2%
Applied egg-rr99.2%
Taylor expanded in y around inf 71.1%
Taylor expanded in z around 0 70.5%
if -3.4999999999999999e-82 < z < -4.5000000000000001e-184 or -2.2e-225 < z < 3.30000000000000013e-304 or 1.9000000000000002e-257 < z < 2.34999999999999997e-73Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around inf 66.6%
+-commutative66.6%
+-commutative66.6%
metadata-eval66.6%
cancel-sign-sub-inv66.6%
*-commutative66.6%
cancel-sign-sub-inv66.6%
distribute-lft-neg-in66.6%
*-commutative66.6%
sub-neg66.6%
distribute-lft-in66.6%
metadata-eval66.6%
distribute-rgt-neg-in66.6%
distribute-lft-neg-in66.6%
metadata-eval66.6%
mul-1-neg66.6%
distribute-lft-in66.6%
metadata-eval66.6%
associate-+r+66.6%
metadata-eval66.6%
Simplified66.6%
Taylor expanded in z around 0 66.6%
*-commutative66.6%
Simplified66.6%
if 0.599999999999999978 < z < 3.7000000000000001e136Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 63.0%
+-commutative63.0%
+-commutative63.0%
metadata-eval63.0%
cancel-sign-sub-inv63.0%
*-commutative63.0%
cancel-sign-sub-inv63.0%
distribute-lft-neg-in63.0%
*-commutative63.0%
sub-neg63.0%
distribute-lft-in63.0%
metadata-eval63.0%
distribute-rgt-neg-in63.0%
distribute-lft-neg-in63.0%
metadata-eval63.0%
mul-1-neg63.0%
distribute-lft-in63.0%
metadata-eval63.0%
associate-+r+63.0%
metadata-eval63.0%
Simplified63.0%
Taylor expanded in z around inf 63.4%
Taylor expanded in z around inf 63.4%
*-commutative63.4%
Simplified63.4%
Final simplification64.3%
(FPCore (x y z)
:precision binary64
(if (<= z -0.09)
(* -6.0 (* y z))
(if (<= z -8.5e-84)
(* y 4.0)
(if (<= z -1.4e-184)
(* x -3.0)
(if (<= z -4.5e-226)
(* y 4.0)
(if (<= z 2.6e-303)
(* x -3.0)
(if (<= z 5.5e-262)
(* y 4.0)
(if (<= z 1.66e-71)
(* x -3.0)
(if (<= z 0.52)
(* y 4.0)
(if (<= z 3.2e+138) (* z (* x 6.0)) (* z (* y -6.0))))))))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.09) {
tmp = -6.0 * (y * z);
} else if (z <= -8.5e-84) {
tmp = y * 4.0;
} else if (z <= -1.4e-184) {
tmp = x * -3.0;
} else if (z <= -4.5e-226) {
tmp = y * 4.0;
} else if (z <= 2.6e-303) {
tmp = x * -3.0;
} else if (z <= 5.5e-262) {
tmp = y * 4.0;
} else if (z <= 1.66e-71) {
tmp = x * -3.0;
} else if (z <= 0.52) {
tmp = y * 4.0;
} else if (z <= 3.2e+138) {
tmp = z * (x * 6.0);
} else {
tmp = z * (y * -6.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-0.09d0)) then
tmp = (-6.0d0) * (y * z)
else if (z <= (-8.5d-84)) then
tmp = y * 4.0d0
else if (z <= (-1.4d-184)) then
tmp = x * (-3.0d0)
else if (z <= (-4.5d-226)) then
tmp = y * 4.0d0
else if (z <= 2.6d-303) then
tmp = x * (-3.0d0)
else if (z <= 5.5d-262) then
tmp = y * 4.0d0
else if (z <= 1.66d-71) then
tmp = x * (-3.0d0)
else if (z <= 0.52d0) then
tmp = y * 4.0d0
else if (z <= 3.2d+138) then
tmp = z * (x * 6.0d0)
else
tmp = z * (y * (-6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.09) {
tmp = -6.0 * (y * z);
} else if (z <= -8.5e-84) {
tmp = y * 4.0;
} else if (z <= -1.4e-184) {
tmp = x * -3.0;
} else if (z <= -4.5e-226) {
tmp = y * 4.0;
} else if (z <= 2.6e-303) {
tmp = x * -3.0;
} else if (z <= 5.5e-262) {
tmp = y * 4.0;
} else if (z <= 1.66e-71) {
tmp = x * -3.0;
} else if (z <= 0.52) {
tmp = y * 4.0;
} else if (z <= 3.2e+138) {
tmp = z * (x * 6.0);
} else {
tmp = z * (y * -6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.09: tmp = -6.0 * (y * z) elif z <= -8.5e-84: tmp = y * 4.0 elif z <= -1.4e-184: tmp = x * -3.0 elif z <= -4.5e-226: tmp = y * 4.0 elif z <= 2.6e-303: tmp = x * -3.0 elif z <= 5.5e-262: tmp = y * 4.0 elif z <= 1.66e-71: tmp = x * -3.0 elif z <= 0.52: tmp = y * 4.0 elif z <= 3.2e+138: tmp = z * (x * 6.0) else: tmp = z * (y * -6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.09) tmp = Float64(-6.0 * Float64(y * z)); elseif (z <= -8.5e-84) tmp = Float64(y * 4.0); elseif (z <= -1.4e-184) tmp = Float64(x * -3.0); elseif (z <= -4.5e-226) tmp = Float64(y * 4.0); elseif (z <= 2.6e-303) tmp = Float64(x * -3.0); elseif (z <= 5.5e-262) tmp = Float64(y * 4.0); elseif (z <= 1.66e-71) tmp = Float64(x * -3.0); elseif (z <= 0.52) tmp = Float64(y * 4.0); elseif (z <= 3.2e+138) tmp = Float64(z * Float64(x * 6.0)); else tmp = Float64(z * Float64(y * -6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.09) tmp = -6.0 * (y * z); elseif (z <= -8.5e-84) tmp = y * 4.0; elseif (z <= -1.4e-184) tmp = x * -3.0; elseif (z <= -4.5e-226) tmp = y * 4.0; elseif (z <= 2.6e-303) tmp = x * -3.0; elseif (z <= 5.5e-262) tmp = y * 4.0; elseif (z <= 1.66e-71) tmp = x * -3.0; elseif (z <= 0.52) tmp = y * 4.0; elseif (z <= 3.2e+138) tmp = z * (x * 6.0); else tmp = z * (y * -6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.09], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -8.5e-84], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -1.4e-184], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -4.5e-226], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.6e-303], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 5.5e-262], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.66e-71], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.52], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 3.2e+138], N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision], N[(z * N[(y * -6.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.09:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;z \leq -8.5 \cdot 10^{-84}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -1.4 \cdot 10^{-184}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{-226}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-303}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-262}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.66 \cdot 10^{-71}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.52:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+138}:\\
\;\;\;\;z \cdot \left(x \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y \cdot -6\right)\\
\end{array}
\end{array}
if z < -0.089999999999999997Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
+-commutative99.7%
*-commutative99.7%
associate-*r*99.8%
fma-define99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 59.5%
Taylor expanded in z around inf 58.7%
if -0.089999999999999997 < z < -8.4999999999999994e-84 or -1.3999999999999999e-184 < z < -4.50000000000000011e-226 or 2.60000000000000005e-303 < z < 5.5000000000000004e-262 or 1.6599999999999999e-71 < z < 0.52000000000000002Initial program 98.2%
metadata-eval98.2%
Simplified98.2%
+-commutative98.2%
*-commutative98.2%
associate-*r*99.2%
fma-define99.2%
Applied egg-rr99.2%
Taylor expanded in y around inf 71.1%
Taylor expanded in z around 0 70.5%
if -8.4999999999999994e-84 < z < -1.3999999999999999e-184 or -4.50000000000000011e-226 < z < 2.60000000000000005e-303 or 5.5000000000000004e-262 < z < 1.6599999999999999e-71Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around inf 66.6%
+-commutative66.6%
+-commutative66.6%
metadata-eval66.6%
cancel-sign-sub-inv66.6%
*-commutative66.6%
cancel-sign-sub-inv66.6%
distribute-lft-neg-in66.6%
*-commutative66.6%
sub-neg66.6%
distribute-lft-in66.6%
metadata-eval66.6%
distribute-rgt-neg-in66.6%
distribute-lft-neg-in66.6%
metadata-eval66.6%
mul-1-neg66.6%
distribute-lft-in66.6%
metadata-eval66.6%
associate-+r+66.6%
metadata-eval66.6%
Simplified66.6%
Taylor expanded in z around 0 66.6%
*-commutative66.6%
Simplified66.6%
if 0.52000000000000002 < z < 3.2000000000000001e138Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 63.0%
+-commutative63.0%
+-commutative63.0%
metadata-eval63.0%
cancel-sign-sub-inv63.0%
*-commutative63.0%
cancel-sign-sub-inv63.0%
distribute-lft-neg-in63.0%
*-commutative63.0%
sub-neg63.0%
distribute-lft-in63.0%
metadata-eval63.0%
distribute-rgt-neg-in63.0%
distribute-lft-neg-in63.0%
metadata-eval63.0%
mul-1-neg63.0%
distribute-lft-in63.0%
metadata-eval63.0%
associate-+r+63.0%
metadata-eval63.0%
Simplified63.0%
Taylor expanded in z around inf 63.4%
Taylor expanded in z around inf 63.4%
*-commutative63.4%
Simplified63.4%
if 3.2000000000000001e138 < z Initial program 99.9%
metadata-eval99.9%
Simplified99.9%
+-commutative99.9%
*-commutative99.9%
associate-*r*99.8%
fma-define99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 58.4%
Taylor expanded in z around inf 58.4%
associate-*r*58.5%
*-commutative58.5%
associate-*r*58.4%
Simplified58.4%
Taylor expanded in y around 0 58.4%
associate-*r*58.5%
*-commutative58.5%
*-commutative58.5%
Simplified58.5%
Final simplification64.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -0.09)
t_0
(if (<= z -3.3e-83)
(* y 4.0)
(if (<= z -2e-184)
(* x -3.0)
(if (<= z -9.5e-225)
(* y 4.0)
(if (<= z 1.02e-303)
(* x -3.0)
(if (<= z 1.35e-257)
(* y 4.0)
(if (<= z 5.5e-74)
(* 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 * z);
double tmp;
if (z <= -0.09) {
tmp = t_0;
} else if (z <= -3.3e-83) {
tmp = y * 4.0;
} else if (z <= -2e-184) {
tmp = x * -3.0;
} else if (z <= -9.5e-225) {
tmp = y * 4.0;
} else if (z <= 1.02e-303) {
tmp = x * -3.0;
} else if (z <= 1.35e-257) {
tmp = y * 4.0;
} else if (z <= 5.5e-74) {
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 * z)
if (z <= (-0.09d0)) then
tmp = t_0
else if (z <= (-3.3d-83)) then
tmp = y * 4.0d0
else if (z <= (-2d-184)) then
tmp = x * (-3.0d0)
else if (z <= (-9.5d-225)) then
tmp = y * 4.0d0
else if (z <= 1.02d-303) then
tmp = x * (-3.0d0)
else if (z <= 1.35d-257) then
tmp = y * 4.0d0
else if (z <= 5.5d-74) 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 * z);
double tmp;
if (z <= -0.09) {
tmp = t_0;
} else if (z <= -3.3e-83) {
tmp = y * 4.0;
} else if (z <= -2e-184) {
tmp = x * -3.0;
} else if (z <= -9.5e-225) {
tmp = y * 4.0;
} else if (z <= 1.02e-303) {
tmp = x * -3.0;
} else if (z <= 1.35e-257) {
tmp = y * 4.0;
} else if (z <= 5.5e-74) {
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 * z) tmp = 0 if z <= -0.09: tmp = t_0 elif z <= -3.3e-83: tmp = y * 4.0 elif z <= -2e-184: tmp = x * -3.0 elif z <= -9.5e-225: tmp = y * 4.0 elif z <= 1.02e-303: tmp = x * -3.0 elif z <= 1.35e-257: tmp = y * 4.0 elif z <= 5.5e-74: 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(y * z)) tmp = 0.0 if (z <= -0.09) tmp = t_0; elseif (z <= -3.3e-83) tmp = Float64(y * 4.0); elseif (z <= -2e-184) tmp = Float64(x * -3.0); elseif (z <= -9.5e-225) tmp = Float64(y * 4.0); elseif (z <= 1.02e-303) tmp = Float64(x * -3.0); elseif (z <= 1.35e-257) tmp = Float64(y * 4.0); elseif (z <= 5.5e-74) 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 * z); tmp = 0.0; if (z <= -0.09) tmp = t_0; elseif (z <= -3.3e-83) tmp = y * 4.0; elseif (z <= -2e-184) tmp = x * -3.0; elseif (z <= -9.5e-225) tmp = y * 4.0; elseif (z <= 1.02e-303) tmp = x * -3.0; elseif (z <= 1.35e-257) tmp = y * 4.0; elseif (z <= 5.5e-74) 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[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.09], t$95$0, If[LessEqual[z, -3.3e-83], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -2e-184], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -9.5e-225], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.02e-303], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.35e-257], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 5.5e-74], 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(y \cdot z\right)\\
\mathbf{if}\;z \leq -0.09:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -3.3 \cdot 10^{-83}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -2 \cdot 10^{-184}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-225}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{-303}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-257}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-74}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.089999999999999997 or 0.660000000000000031 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
+-commutative99.8%
*-commutative99.8%
associate-*r*99.7%
fma-define99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 56.2%
Taylor expanded in z around inf 54.5%
if -0.089999999999999997 < z < -3.2999999999999999e-83 or -2.0000000000000001e-184 < z < -9.50000000000000006e-225 or 1.01999999999999996e-303 < z < 1.3499999999999999e-257 or 5.5000000000000001e-74 < z < 0.660000000000000031Initial program 98.2%
metadata-eval98.2%
Simplified98.2%
+-commutative98.2%
*-commutative98.2%
associate-*r*99.2%
fma-define99.2%
Applied egg-rr99.2%
Taylor expanded in y around inf 71.1%
Taylor expanded in z around 0 70.5%
if -3.2999999999999999e-83 < z < -2.0000000000000001e-184 or -9.50000000000000006e-225 < z < 1.01999999999999996e-303 or 1.3499999999999999e-257 < z < 5.5000000000000001e-74Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around inf 66.6%
+-commutative66.6%
+-commutative66.6%
metadata-eval66.6%
cancel-sign-sub-inv66.6%
*-commutative66.6%
cancel-sign-sub-inv66.6%
distribute-lft-neg-in66.6%
*-commutative66.6%
sub-neg66.6%
distribute-lft-in66.6%
metadata-eval66.6%
distribute-rgt-neg-in66.6%
distribute-lft-neg-in66.6%
metadata-eval66.6%
mul-1-neg66.6%
distribute-lft-in66.6%
metadata-eval66.6%
associate-+r+66.6%
metadata-eval66.6%
Simplified66.6%
Taylor expanded in z around 0 66.6%
*-commutative66.6%
Simplified66.6%
Final simplification62.2%
(FPCore (x y z)
:precision binary64
(if (or (<= x -6e+79)
(not
(or (<= x -2.36e-51) (and (not (<= x -2.5e-156)) (<= x 5.4e-41)))))
(* x -3.0)
(* y 4.0)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -6e+79) || !((x <= -2.36e-51) || (!(x <= -2.5e-156) && (x <= 5.4e-41)))) {
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 <= (-6d+79)) .or. (.not. (x <= (-2.36d-51)) .or. (.not. (x <= (-2.5d-156))) .and. (x <= 5.4d-41))) 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 <= -6e+79) || !((x <= -2.36e-51) || (!(x <= -2.5e-156) && (x <= 5.4e-41)))) {
tmp = x * -3.0;
} else {
tmp = y * 4.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -6e+79) or not ((x <= -2.36e-51) or (not (x <= -2.5e-156) and (x <= 5.4e-41))): tmp = x * -3.0 else: tmp = y * 4.0 return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -6e+79) || !((x <= -2.36e-51) || (!(x <= -2.5e-156) && (x <= 5.4e-41)))) 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 <= -6e+79) || ~(((x <= -2.36e-51) || (~((x <= -2.5e-156)) && (x <= 5.4e-41))))) tmp = x * -3.0; else tmp = y * 4.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -6e+79], N[Not[Or[LessEqual[x, -2.36e-51], And[N[Not[LessEqual[x, -2.5e-156]], $MachinePrecision], LessEqual[x, 5.4e-41]]]], $MachinePrecision]], N[(x * -3.0), $MachinePrecision], N[(y * 4.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6 \cdot 10^{+79} \lor \neg \left(x \leq -2.36 \cdot 10^{-51} \lor \neg \left(x \leq -2.5 \cdot 10^{-156}\right) \land x \leq 5.4 \cdot 10^{-41}\right):\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4\\
\end{array}
\end{array}
if x < -5.99999999999999948e79 or -2.36000000000000008e-51 < x < -2.50000000000000004e-156 or 5.4e-41 < x Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 72.3%
+-commutative72.3%
+-commutative72.3%
metadata-eval72.3%
cancel-sign-sub-inv72.3%
*-commutative72.3%
cancel-sign-sub-inv72.3%
distribute-lft-neg-in72.3%
*-commutative72.3%
sub-neg72.3%
distribute-lft-in72.3%
metadata-eval72.3%
distribute-rgt-neg-in72.3%
distribute-lft-neg-in72.3%
metadata-eval72.3%
mul-1-neg72.3%
distribute-lft-in72.3%
metadata-eval72.3%
associate-+r+72.3%
metadata-eval72.3%
Simplified72.3%
Taylor expanded in z around 0 48.2%
*-commutative48.2%
Simplified48.2%
if -5.99999999999999948e79 < x < -2.36000000000000008e-51 or -2.50000000000000004e-156 < x < 5.4e-41Initial program 99.0%
metadata-eval99.0%
Simplified99.0%
+-commutative99.0%
*-commutative99.0%
associate-*r*99.5%
fma-define99.4%
Applied egg-rr99.4%
Taylor expanded in y around inf 74.3%
Taylor expanded in z around 0 46.7%
Final simplification47.5%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.25e+88) (not (<= x 1.5e-16))) (* x -3.0) (* 6.0 (* y (- 0.6666666666666666 z)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.25e+88) || !(x <= 1.5e-16)) {
tmp = x * -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 <= (-1.25d+88)) .or. (.not. (x <= 1.5d-16))) then
tmp = x * (-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 <= -1.25e+88) || !(x <= 1.5e-16)) {
tmp = x * -3.0;
} else {
tmp = 6.0 * (y * (0.6666666666666666 - z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.25e+88) or not (x <= 1.5e-16): tmp = x * -3.0 else: tmp = 6.0 * (y * (0.6666666666666666 - z)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.25e+88) || !(x <= 1.5e-16)) tmp = Float64(x * -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 <= -1.25e+88) || ~((x <= 1.5e-16))) tmp = x * -3.0; else tmp = 6.0 * (y * (0.6666666666666666 - z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.25e+88], N[Not[LessEqual[x, 1.5e-16]], $MachinePrecision]], N[(x * -3.0), $MachinePrecision], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{+88} \lor \neg \left(x \leq 1.5 \cdot 10^{-16}\right):\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\end{array}
\end{array}
if x < -1.24999999999999999e88 or 1.49999999999999997e-16 < x Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 76.2%
+-commutative76.2%
+-commutative76.2%
metadata-eval76.2%
cancel-sign-sub-inv76.2%
*-commutative76.2%
cancel-sign-sub-inv76.2%
distribute-lft-neg-in76.2%
*-commutative76.2%
sub-neg76.2%
distribute-lft-in76.2%
metadata-eval76.2%
distribute-rgt-neg-in76.2%
distribute-lft-neg-in76.2%
metadata-eval76.2%
mul-1-neg76.2%
distribute-lft-in76.2%
metadata-eval76.2%
associate-+r+76.2%
metadata-eval76.2%
Simplified76.2%
Taylor expanded in z around 0 51.3%
*-commutative51.3%
Simplified51.3%
if -1.24999999999999999e88 < x < 1.49999999999999997e-16Initial program 99.1%
metadata-eval99.1%
Simplified99.1%
+-commutative99.1%
*-commutative99.1%
associate-*r*99.5%
fma-define99.5%
Applied egg-rr99.5%
Taylor expanded in y around inf 68.9%
Final simplification61.8%
(FPCore (x y z) :precision binary64 (if (or (<= x -5.6e-118) (not (<= x 7.5e-38))) (* x (+ -3.0 (* z 6.0))) (* 6.0 (* y (- 0.6666666666666666 z)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -5.6e-118) || !(x <= 7.5e-38)) {
tmp = x * (-3.0 + (z * 6.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 <= (-5.6d-118)) .or. (.not. (x <= 7.5d-38))) then
tmp = x * ((-3.0d0) + (z * 6.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 <= -5.6e-118) || !(x <= 7.5e-38)) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = 6.0 * (y * (0.6666666666666666 - z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -5.6e-118) or not (x <= 7.5e-38): tmp = x * (-3.0 + (z * 6.0)) else: tmp = 6.0 * (y * (0.6666666666666666 - z)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -5.6e-118) || !(x <= 7.5e-38)) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.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 <= -5.6e-118) || ~((x <= 7.5e-38))) tmp = x * (-3.0 + (z * 6.0)); else tmp = 6.0 * (y * (0.6666666666666666 - z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -5.6e-118], N[Not[LessEqual[x, 7.5e-38]], $MachinePrecision]], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.6 \cdot 10^{-118} \lor \neg \left(x \leq 7.5 \cdot 10^{-38}\right):\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\end{array}
\end{array}
if x < -5.6e-118 or 7.5e-38 < x Initial program 99.0%
metadata-eval99.0%
Simplified99.0%
Taylor expanded in x around inf 69.0%
+-commutative69.0%
+-commutative69.0%
metadata-eval69.0%
cancel-sign-sub-inv69.0%
*-commutative69.0%
cancel-sign-sub-inv69.0%
distribute-lft-neg-in69.0%
*-commutative69.0%
sub-neg69.0%
distribute-lft-in69.0%
metadata-eval69.0%
distribute-rgt-neg-in69.0%
distribute-lft-neg-in69.0%
metadata-eval69.0%
mul-1-neg69.0%
distribute-lft-in69.0%
metadata-eval69.0%
associate-+r+69.0%
metadata-eval69.0%
Simplified69.0%
if -5.6e-118 < x < 7.5e-38Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
+-commutative99.6%
*-commutative99.6%
associate-*r*99.5%
fma-define99.4%
Applied egg-rr99.4%
Taylor expanded in y around inf 81.8%
Final simplification73.9%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.26e-120) (not (<= x 8.5e-41))) (* x (+ -3.0 (* z 6.0))) (* y (+ 4.0 (* z -6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.26e-120) || !(x <= 8.5e-41)) {
tmp = x * (-3.0 + (z * 6.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 <= (-1.26d-120)) .or. (.not. (x <= 8.5d-41))) then
tmp = x * ((-3.0d0) + (z * 6.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 <= -1.26e-120) || !(x <= 8.5e-41)) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = y * (4.0 + (z * -6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.26e-120) or not (x <= 8.5e-41): tmp = x * (-3.0 + (z * 6.0)) else: tmp = y * (4.0 + (z * -6.0)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.26e-120) || !(x <= 8.5e-41)) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.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 <= -1.26e-120) || ~((x <= 8.5e-41))) tmp = x * (-3.0 + (z * 6.0)); else tmp = y * (4.0 + (z * -6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.26e-120], N[Not[LessEqual[x, 8.5e-41]], $MachinePrecision]], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.26 \cdot 10^{-120} \lor \neg \left(x \leq 8.5 \cdot 10^{-41}\right):\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\end{array}
\end{array}
if x < -1.25999999999999992e-120 or 8.4999999999999996e-41 < x Initial program 99.0%
metadata-eval99.0%
Simplified99.0%
Taylor expanded in x around inf 69.0%
+-commutative69.0%
+-commutative69.0%
metadata-eval69.0%
cancel-sign-sub-inv69.0%
*-commutative69.0%
cancel-sign-sub-inv69.0%
distribute-lft-neg-in69.0%
*-commutative69.0%
sub-neg69.0%
distribute-lft-in69.0%
metadata-eval69.0%
distribute-rgt-neg-in69.0%
distribute-lft-neg-in69.0%
metadata-eval69.0%
mul-1-neg69.0%
distribute-lft-in69.0%
metadata-eval69.0%
associate-+r+69.0%
metadata-eval69.0%
Simplified69.0%
if -1.25999999999999992e-120 < x < 8.4999999999999996e-41Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 82.0%
Final simplification74.0%
(FPCore (x y z) :precision binary64 (if (<= z -0.58) (* (- y x) (* z -6.0)) (if (<= z 0.6) (+ x (* (- y x) 4.0)) (* z (* (- y x) -6.0)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.58) {
tmp = (y - x) * (z * -6.0);
} else if (z <= 0.6) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = z * ((y - x) * -6.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-0.58d0)) then
tmp = (y - x) * (z * (-6.0d0))
else if (z <= 0.6d0) then
tmp = x + ((y - x) * 4.0d0)
else
tmp = z * ((y - x) * (-6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.58) {
tmp = (y - x) * (z * -6.0);
} else if (z <= 0.6) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = z * ((y - x) * -6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.58: tmp = (y - x) * (z * -6.0) elif z <= 0.6: tmp = x + ((y - x) * 4.0) else: tmp = z * ((y - x) * -6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.58) tmp = Float64(Float64(y - x) * Float64(z * -6.0)); elseif (z <= 0.6) tmp = Float64(x + Float64(Float64(y - x) * 4.0)); else tmp = Float64(z * Float64(Float64(y - x) * -6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.58) tmp = (y - x) * (z * -6.0); elseif (z <= 0.6) tmp = x + ((y - x) * 4.0); else tmp = z * ((y - x) * -6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.58], N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.6], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.58:\\
\;\;\;\;\left(y - x\right) \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq 0.6:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\end{array}
\end{array}
if z < -0.57999999999999996Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
+-commutative99.7%
*-commutative99.7%
associate-*r*99.8%
fma-define99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 97.7%
associate-*r*97.7%
*-commutative97.7%
Simplified97.7%
if -0.57999999999999996 < z < 0.599999999999999978Initial program 98.9%
metadata-eval98.9%
Simplified98.9%
Taylor expanded in z around 0 98.5%
if 0.599999999999999978 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 99.8%
Taylor expanded in z around inf 96.9%
*-commutative96.9%
Simplified96.9%
Final simplification98.0%
(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.2%
metadata-eval99.2%
Simplified99.2%
Final simplification99.2%
(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.2%
metadata-eval99.2%
Simplified99.2%
+-commutative99.2%
*-commutative99.2%
associate-*r*99.5%
fma-define99.4%
Applied egg-rr99.4%
Taylor expanded in y around inf 52.3%
Taylor expanded in z around 0 29.3%
Final simplification29.3%
(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.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in y around inf 51.8%
Taylor expanded in x around inf 2.4%
Final simplification2.4%
herbie shell --seed 2024053
(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))))