
(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 16 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 (+ (+ x (* (- y x) (* z -6.0))) (* (- y x) 4.0)))
double code(double x, double y, double z) {
return (x + ((y - x) * (z * -6.0))) + ((y - x) * 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 = (x + ((y - x) * (z * (-6.0d0)))) + ((y - x) * 4.0d0)
end function
public static double code(double x, double y, double z) {
return (x + ((y - x) * (z * -6.0))) + ((y - x) * 4.0);
}
def code(x, y, z): return (x + ((y - x) * (z * -6.0))) + ((y - x) * 4.0)
function code(x, y, z) return Float64(Float64(x + Float64(Float64(y - x) * Float64(z * -6.0))) + Float64(Float64(y - x) * 4.0)) end
function tmp = code(x, y, z) tmp = (x + ((y - x) * (z * -6.0))) + ((y - x) * 4.0); end
code[x_, y_, z_] := N[(N[(x + N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + \left(y - x\right) \cdot \left(z \cdot -6\right)\right) + \left(y - x\right) \cdot 4
\end{array}
Initial program 99.5%
+-commutative99.5%
associate-*l*99.7%
fma-def99.7%
sub-neg99.7%
distribute-rgt-in99.7%
metadata-eval99.7%
metadata-eval99.7%
distribute-lft-neg-out99.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
fma-udef99.8%
+-commutative99.8%
fma-udef99.8%
+-commutative99.8%
fma-udef99.8%
distribute-lft-in99.7%
associate-+r+99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (* z -6.0))) (t_1 (* x (* z 6.0))))
(if (<= z -1.5e+44)
t_0
(if (<= z -7.8e-13)
t_1
(if (<= z 1.65e-268)
(* x -3.0)
(if (<= z 1.6e-226)
(* y 4.0)
(if (<= z 0.6) (* x -3.0) (if (<= z 1.8e+65) t_0 t_1))))))))
double code(double x, double y, double z) {
double t_0 = y * (z * -6.0);
double t_1 = x * (z * 6.0);
double tmp;
if (z <= -1.5e+44) {
tmp = t_0;
} else if (z <= -7.8e-13) {
tmp = t_1;
} else if (z <= 1.65e-268) {
tmp = x * -3.0;
} else if (z <= 1.6e-226) {
tmp = y * 4.0;
} else if (z <= 0.6) {
tmp = x * -3.0;
} else if (z <= 1.8e+65) {
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 = y * (z * (-6.0d0))
t_1 = x * (z * 6.0d0)
if (z <= (-1.5d+44)) then
tmp = t_0
else if (z <= (-7.8d-13)) then
tmp = t_1
else if (z <= 1.65d-268) then
tmp = x * (-3.0d0)
else if (z <= 1.6d-226) then
tmp = y * 4.0d0
else if (z <= 0.6d0) then
tmp = x * (-3.0d0)
else if (z <= 1.8d+65) 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 = y * (z * -6.0);
double t_1 = x * (z * 6.0);
double tmp;
if (z <= -1.5e+44) {
tmp = t_0;
} else if (z <= -7.8e-13) {
tmp = t_1;
} else if (z <= 1.65e-268) {
tmp = x * -3.0;
} else if (z <= 1.6e-226) {
tmp = y * 4.0;
} else if (z <= 0.6) {
tmp = x * -3.0;
} else if (z <= 1.8e+65) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = y * (z * -6.0) t_1 = x * (z * 6.0) tmp = 0 if z <= -1.5e+44: tmp = t_0 elif z <= -7.8e-13: tmp = t_1 elif z <= 1.65e-268: tmp = x * -3.0 elif z <= 1.6e-226: tmp = y * 4.0 elif z <= 0.6: tmp = x * -3.0 elif z <= 1.8e+65: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(y * Float64(z * -6.0)) t_1 = Float64(x * Float64(z * 6.0)) tmp = 0.0 if (z <= -1.5e+44) tmp = t_0; elseif (z <= -7.8e-13) tmp = t_1; elseif (z <= 1.65e-268) tmp = Float64(x * -3.0); elseif (z <= 1.6e-226) tmp = Float64(y * 4.0); elseif (z <= 0.6) tmp = Float64(x * -3.0); elseif (z <= 1.8e+65) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (z * -6.0); t_1 = x * (z * 6.0); tmp = 0.0; if (z <= -1.5e+44) tmp = t_0; elseif (z <= -7.8e-13) tmp = t_1; elseif (z <= 1.65e-268) tmp = x * -3.0; elseif (z <= 1.6e-226) tmp = y * 4.0; elseif (z <= 0.6) tmp = x * -3.0; elseif (z <= 1.8e+65) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.5e+44], t$95$0, If[LessEqual[z, -7.8e-13], t$95$1, If[LessEqual[z, 1.65e-268], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.6e-226], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.6], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.8e+65], t$95$0, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(z \cdot -6\right)\\
t_1 := x \cdot \left(z \cdot 6\right)\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{+44}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -7.8 \cdot 10^{-13}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-268}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-226}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.6:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{+65}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.49999999999999993e44 or 0.599999999999999978 < z < 1.79999999999999989e65Initial program 99.8%
+-commutative99.8%
associate-*l*99.8%
fma-def99.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 62.7%
Taylor expanded in z around inf 62.7%
if -1.49999999999999993e44 < z < -7.80000000000000009e-13 or 1.79999999999999989e65 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 75.6%
sub-neg75.6%
distribute-lft-in75.6%
metadata-eval75.6%
metadata-eval75.6%
mul-1-neg75.6%
*-commutative75.6%
associate-*l*75.6%
*-commutative75.6%
*-commutative75.6%
associate-+r+75.6%
metadata-eval75.6%
metadata-eval75.6%
*-commutative75.6%
associate-*l*75.6%
metadata-eval75.6%
Simplified75.6%
Taylor expanded in z around inf 74.7%
if -7.80000000000000009e-13 < z < 1.64999999999999996e-268 or 1.59999999999999991e-226 < z < 0.599999999999999978Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around inf 62.0%
sub-neg62.0%
distribute-lft-in62.1%
metadata-eval62.1%
metadata-eval62.1%
mul-1-neg62.1%
*-commutative62.1%
associate-*l*62.1%
*-commutative62.1%
*-commutative62.1%
associate-+r+62.1%
metadata-eval62.1%
metadata-eval62.1%
*-commutative62.1%
associate-*l*62.1%
metadata-eval62.1%
Simplified62.1%
Taylor expanded in z around 0 61.4%
*-commutative61.4%
Simplified61.4%
if 1.64999999999999996e-268 < z < 1.59999999999999991e-226Initial program 99.3%
+-commutative99.3%
associate-*l*99.8%
fma-def99.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 79.3%
Taylor expanded in z around 0 79.3%
Final simplification65.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (* z -6.0))))
(if (<= z -4.6e+44)
t_0
(if (<= z -7.8e-13)
(* z (* x 6.0))
(if (<= z 4.5e-266)
(* x -3.0)
(if (<= z 1.65e-226)
(* y 4.0)
(if (<= z 0.5)
(* x -3.0)
(if (<= z 2.1e+65) t_0 (* x (* z 6.0))))))))))
double code(double x, double y, double z) {
double t_0 = y * (z * -6.0);
double tmp;
if (z <= -4.6e+44) {
tmp = t_0;
} else if (z <= -7.8e-13) {
tmp = z * (x * 6.0);
} else if (z <= 4.5e-266) {
tmp = x * -3.0;
} else if (z <= 1.65e-226) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if (z <= 2.1e+65) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = y * (z * (-6.0d0))
if (z <= (-4.6d+44)) then
tmp = t_0
else if (z <= (-7.8d-13)) then
tmp = z * (x * 6.0d0)
else if (z <= 4.5d-266) then
tmp = x * (-3.0d0)
else if (z <= 1.65d-226) then
tmp = y * 4.0d0
else if (z <= 0.5d0) then
tmp = x * (-3.0d0)
else if (z <= 2.1d+65) then
tmp = t_0
else
tmp = x * (z * 6.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (z * -6.0);
double tmp;
if (z <= -4.6e+44) {
tmp = t_0;
} else if (z <= -7.8e-13) {
tmp = z * (x * 6.0);
} else if (z <= 4.5e-266) {
tmp = x * -3.0;
} else if (z <= 1.65e-226) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if (z <= 2.1e+65) {
tmp = t_0;
} else {
tmp = x * (z * 6.0);
}
return tmp;
}
def code(x, y, z): t_0 = y * (z * -6.0) tmp = 0 if z <= -4.6e+44: tmp = t_0 elif z <= -7.8e-13: tmp = z * (x * 6.0) elif z <= 4.5e-266: tmp = x * -3.0 elif z <= 1.65e-226: tmp = y * 4.0 elif z <= 0.5: tmp = x * -3.0 elif z <= 2.1e+65: tmp = t_0 else: tmp = x * (z * 6.0) return tmp
function code(x, y, z) t_0 = Float64(y * Float64(z * -6.0)) tmp = 0.0 if (z <= -4.6e+44) tmp = t_0; elseif (z <= -7.8e-13) tmp = Float64(z * Float64(x * 6.0)); elseif (z <= 4.5e-266) tmp = Float64(x * -3.0); elseif (z <= 1.65e-226) tmp = Float64(y * 4.0); elseif (z <= 0.5) tmp = Float64(x * -3.0); elseif (z <= 2.1e+65) tmp = t_0; else tmp = Float64(x * Float64(z * 6.0)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (z * -6.0); tmp = 0.0; if (z <= -4.6e+44) tmp = t_0; elseif (z <= -7.8e-13) tmp = z * (x * 6.0); elseif (z <= 4.5e-266) tmp = x * -3.0; elseif (z <= 1.65e-226) tmp = y * 4.0; elseif (z <= 0.5) tmp = x * -3.0; elseif (z <= 2.1e+65) tmp = t_0; else tmp = x * (z * 6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.6e+44], t$95$0, If[LessEqual[z, -7.8e-13], N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.5e-266], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.65e-226], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.1e+65], t$95$0, N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(z \cdot -6\right)\\
\mathbf{if}\;z \leq -4.6 \cdot 10^{+44}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -7.8 \cdot 10^{-13}:\\
\;\;\;\;z \cdot \left(x \cdot 6\right)\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-266}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-226}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+65}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\end{array}
\end{array}
if z < -4.60000000000000009e44 or 0.5 < z < 2.09999999999999991e65Initial program 99.8%
+-commutative99.8%
associate-*l*99.8%
fma-def99.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 62.7%
Taylor expanded in z around inf 62.7%
if -4.60000000000000009e44 < z < -7.80000000000000009e-13Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 99.5%
Taylor expanded in z around inf 84.6%
Taylor expanded in y around 0 75.4%
*-commutative75.4%
Simplified75.4%
if -7.80000000000000009e-13 < z < 4.5000000000000003e-266 or 1.65e-226 < z < 0.5Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around inf 62.0%
sub-neg62.0%
distribute-lft-in62.1%
metadata-eval62.1%
metadata-eval62.1%
mul-1-neg62.1%
*-commutative62.1%
associate-*l*62.1%
*-commutative62.1%
*-commutative62.1%
associate-+r+62.1%
metadata-eval62.1%
metadata-eval62.1%
*-commutative62.1%
associate-*l*62.1%
metadata-eval62.1%
Simplified62.1%
Taylor expanded in z around 0 61.4%
*-commutative61.4%
Simplified61.4%
if 4.5000000000000003e-266 < z < 1.65e-226Initial program 99.3%
+-commutative99.3%
associate-*l*99.8%
fma-def99.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 79.3%
Taylor expanded in z around 0 79.3%
if 2.09999999999999991e65 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 74.6%
sub-neg74.6%
distribute-lft-in74.6%
metadata-eval74.6%
metadata-eval74.6%
mul-1-neg74.6%
*-commutative74.6%
associate-*l*74.6%
*-commutative74.6%
*-commutative74.6%
associate-+r+74.6%
metadata-eval74.6%
metadata-eval74.6%
*-commutative74.6%
associate-*l*74.6%
metadata-eval74.6%
Simplified74.6%
Taylor expanded in z around inf 74.6%
Final simplification65.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (* y -6.0))))
(if (<= z -6e+44)
t_0
(if (<= z -7.8e-13)
(* z (* x 6.0))
(if (<= z 5.5e-266)
(* x -3.0)
(if (<= z 9.5e-227)
(* y 4.0)
(if (<= z 0.55)
(* x -3.0)
(if (<= z 1.15e+66) t_0 (* x (* z 6.0))))))))))
double code(double x, double y, double z) {
double t_0 = z * (y * -6.0);
double tmp;
if (z <= -6e+44) {
tmp = t_0;
} else if (z <= -7.8e-13) {
tmp = z * (x * 6.0);
} else if (z <= 5.5e-266) {
tmp = x * -3.0;
} else if (z <= 9.5e-227) {
tmp = y * 4.0;
} else if (z <= 0.55) {
tmp = x * -3.0;
} else if (z <= 1.15e+66) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = z * (y * (-6.0d0))
if (z <= (-6d+44)) then
tmp = t_0
else if (z <= (-7.8d-13)) then
tmp = z * (x * 6.0d0)
else if (z <= 5.5d-266) then
tmp = x * (-3.0d0)
else if (z <= 9.5d-227) then
tmp = y * 4.0d0
else if (z <= 0.55d0) then
tmp = x * (-3.0d0)
else if (z <= 1.15d+66) then
tmp = t_0
else
tmp = x * (z * 6.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * (y * -6.0);
double tmp;
if (z <= -6e+44) {
tmp = t_0;
} else if (z <= -7.8e-13) {
tmp = z * (x * 6.0);
} else if (z <= 5.5e-266) {
tmp = x * -3.0;
} else if (z <= 9.5e-227) {
tmp = y * 4.0;
} else if (z <= 0.55) {
tmp = x * -3.0;
} else if (z <= 1.15e+66) {
tmp = t_0;
} else {
tmp = x * (z * 6.0);
}
return tmp;
}
def code(x, y, z): t_0 = z * (y * -6.0) tmp = 0 if z <= -6e+44: tmp = t_0 elif z <= -7.8e-13: tmp = z * (x * 6.0) elif z <= 5.5e-266: tmp = x * -3.0 elif z <= 9.5e-227: tmp = y * 4.0 elif z <= 0.55: tmp = x * -3.0 elif z <= 1.15e+66: tmp = t_0 else: tmp = x * (z * 6.0) return tmp
function code(x, y, z) t_0 = Float64(z * Float64(y * -6.0)) tmp = 0.0 if (z <= -6e+44) tmp = t_0; elseif (z <= -7.8e-13) tmp = Float64(z * Float64(x * 6.0)); elseif (z <= 5.5e-266) tmp = Float64(x * -3.0); elseif (z <= 9.5e-227) tmp = Float64(y * 4.0); elseif (z <= 0.55) tmp = Float64(x * -3.0); elseif (z <= 1.15e+66) tmp = t_0; else tmp = Float64(x * Float64(z * 6.0)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * (y * -6.0); tmp = 0.0; if (z <= -6e+44) tmp = t_0; elseif (z <= -7.8e-13) tmp = z * (x * 6.0); elseif (z <= 5.5e-266) tmp = x * -3.0; elseif (z <= 9.5e-227) tmp = y * 4.0; elseif (z <= 0.55) tmp = x * -3.0; elseif (z <= 1.15e+66) tmp = t_0; else tmp = x * (z * 6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(y * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6e+44], t$95$0, If[LessEqual[z, -7.8e-13], N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.5e-266], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 9.5e-227], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.55], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.15e+66], t$95$0, N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(y \cdot -6\right)\\
\mathbf{if}\;z \leq -6 \cdot 10^{+44}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -7.8 \cdot 10^{-13}:\\
\;\;\;\;z \cdot \left(x \cdot 6\right)\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-266}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-227}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.55:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{+66}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\end{array}
\end{array}
if z < -5.99999999999999974e44 or 0.55000000000000004 < z < 1.15e66Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 98.3%
Taylor expanded in z around inf 99.7%
Taylor expanded in y around inf 62.6%
*-commutative62.6%
*-commutative62.6%
associate-*r*62.8%
Simplified62.8%
if -5.99999999999999974e44 < z < -7.80000000000000009e-13Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 99.5%
Taylor expanded in z around inf 84.6%
Taylor expanded in y around 0 75.4%
*-commutative75.4%
Simplified75.4%
if -7.80000000000000009e-13 < z < 5.50000000000000026e-266 or 9.49999999999999953e-227 < z < 0.55000000000000004Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around inf 62.0%
sub-neg62.0%
distribute-lft-in62.1%
metadata-eval62.1%
metadata-eval62.1%
mul-1-neg62.1%
*-commutative62.1%
associate-*l*62.1%
*-commutative62.1%
*-commutative62.1%
associate-+r+62.1%
metadata-eval62.1%
metadata-eval62.1%
*-commutative62.1%
associate-*l*62.1%
metadata-eval62.1%
Simplified62.1%
Taylor expanded in z around 0 61.4%
*-commutative61.4%
Simplified61.4%
if 5.50000000000000026e-266 < z < 9.49999999999999953e-227Initial program 99.3%
+-commutative99.3%
associate-*l*99.8%
fma-def99.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 79.3%
Taylor expanded in z around 0 79.3%
if 1.15e66 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 74.6%
sub-neg74.6%
distribute-lft-in74.6%
metadata-eval74.6%
metadata-eval74.6%
mul-1-neg74.6%
*-commutative74.6%
associate-*l*74.6%
*-commutative74.6%
*-commutative74.6%
associate-+r+74.6%
metadata-eval74.6%
metadata-eval74.6%
*-commutative74.6%
associate-*l*74.6%
metadata-eval74.6%
Simplified74.6%
Taylor expanded in z around inf 74.6%
Final simplification65.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (* y -6.0))))
(if (<= z -1.05e+44)
t_0
(if (<= z -0.14)
(* -6.0 (* x (- 0.6666666666666666 z)))
(if (<= z 9.2e-266)
(* x -3.0)
(if (<= z 2.5e-226)
(* y 4.0)
(if (<= z 0.5)
(* x -3.0)
(if (<= z 6.3e+65) t_0 (* x (* z 6.0))))))))))
double code(double x, double y, double z) {
double t_0 = z * (y * -6.0);
double tmp;
if (z <= -1.05e+44) {
tmp = t_0;
} else if (z <= -0.14) {
tmp = -6.0 * (x * (0.6666666666666666 - z));
} else if (z <= 9.2e-266) {
tmp = x * -3.0;
} else if (z <= 2.5e-226) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if (z <= 6.3e+65) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = z * (y * (-6.0d0))
if (z <= (-1.05d+44)) then
tmp = t_0
else if (z <= (-0.14d0)) then
tmp = (-6.0d0) * (x * (0.6666666666666666d0 - z))
else if (z <= 9.2d-266) then
tmp = x * (-3.0d0)
else if (z <= 2.5d-226) then
tmp = y * 4.0d0
else if (z <= 0.5d0) then
tmp = x * (-3.0d0)
else if (z <= 6.3d+65) then
tmp = t_0
else
tmp = x * (z * 6.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * (y * -6.0);
double tmp;
if (z <= -1.05e+44) {
tmp = t_0;
} else if (z <= -0.14) {
tmp = -6.0 * (x * (0.6666666666666666 - z));
} else if (z <= 9.2e-266) {
tmp = x * -3.0;
} else if (z <= 2.5e-226) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if (z <= 6.3e+65) {
tmp = t_0;
} else {
tmp = x * (z * 6.0);
}
return tmp;
}
def code(x, y, z): t_0 = z * (y * -6.0) tmp = 0 if z <= -1.05e+44: tmp = t_0 elif z <= -0.14: tmp = -6.0 * (x * (0.6666666666666666 - z)) elif z <= 9.2e-266: tmp = x * -3.0 elif z <= 2.5e-226: tmp = y * 4.0 elif z <= 0.5: tmp = x * -3.0 elif z <= 6.3e+65: tmp = t_0 else: tmp = x * (z * 6.0) return tmp
function code(x, y, z) t_0 = Float64(z * Float64(y * -6.0)) tmp = 0.0 if (z <= -1.05e+44) tmp = t_0; elseif (z <= -0.14) tmp = Float64(-6.0 * Float64(x * Float64(0.6666666666666666 - z))); elseif (z <= 9.2e-266) tmp = Float64(x * -3.0); elseif (z <= 2.5e-226) tmp = Float64(y * 4.0); elseif (z <= 0.5) tmp = Float64(x * -3.0); elseif (z <= 6.3e+65) tmp = t_0; else tmp = Float64(x * Float64(z * 6.0)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * (y * -6.0); tmp = 0.0; if (z <= -1.05e+44) tmp = t_0; elseif (z <= -0.14) tmp = -6.0 * (x * (0.6666666666666666 - z)); elseif (z <= 9.2e-266) tmp = x * -3.0; elseif (z <= 2.5e-226) tmp = y * 4.0; elseif (z <= 0.5) tmp = x * -3.0; elseif (z <= 6.3e+65) tmp = t_0; else tmp = x * (z * 6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(y * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.05e+44], t$95$0, If[LessEqual[z, -0.14], N[(-6.0 * N[(x * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.2e-266], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.5e-226], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 6.3e+65], t$95$0, N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(y \cdot -6\right)\\
\mathbf{if}\;z \leq -1.05 \cdot 10^{+44}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -0.14:\\
\;\;\;\;-6 \cdot \left(x \cdot \left(0.6666666666666666 - z\right)\right)\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{-266}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-226}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 6.3 \cdot 10^{+65}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\end{array}
\end{array}
if z < -1.04999999999999993e44 or 0.5 < z < 6.29999999999999997e65Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 98.3%
Taylor expanded in z around inf 99.7%
Taylor expanded in y around inf 62.6%
*-commutative62.6%
*-commutative62.6%
associate-*r*62.8%
Simplified62.8%
if -1.04999999999999993e44 < z < -0.14000000000000001Initial program 100.0%
metadata-eval100.0%
Simplified100.0%
add-sqr-sqrt66.7%
fma-def66.7%
associate-*l*66.5%
Applied egg-rr66.5%
Taylor expanded in x around inf 83.6%
if -0.14000000000000001 < z < 9.19999999999999986e-266 or 2.4999999999999999e-226 < z < 0.5Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around inf 61.6%
sub-neg61.6%
distribute-lft-in61.6%
metadata-eval61.6%
metadata-eval61.6%
mul-1-neg61.6%
*-commutative61.6%
associate-*l*61.6%
*-commutative61.6%
*-commutative61.6%
associate-+r+61.6%
metadata-eval61.6%
metadata-eval61.6%
*-commutative61.6%
associate-*l*61.6%
metadata-eval61.6%
Simplified61.6%
Taylor expanded in z around 0 60.9%
*-commutative60.9%
Simplified60.9%
if 9.19999999999999986e-266 < z < 2.4999999999999999e-226Initial program 99.3%
+-commutative99.3%
associate-*l*99.8%
fma-def99.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 79.3%
Taylor expanded in z around 0 79.3%
if 6.29999999999999997e65 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 74.6%
sub-neg74.6%
distribute-lft-in74.6%
metadata-eval74.6%
metadata-eval74.6%
mul-1-neg74.6%
*-commutative74.6%
associate-*l*74.6%
*-commutative74.6%
*-commutative74.6%
associate-+r+74.6%
metadata-eval74.6%
metadata-eval74.6%
*-commutative74.6%
associate-*l*74.6%
metadata-eval74.6%
Simplified74.6%
Taylor expanded in z around inf 74.6%
Final simplification65.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ -3.0 (* z 6.0)))))
(if (<= z -4.2e+44)
(* z (* y -6.0))
(if (<= z -8.5e-7)
t_0
(if (<= z 1.55e-9)
(+ x (* (- y x) 4.0))
(if (<= z 5.2e+66) (* (- 0.6666666666666666 z) (* y 6.0)) t_0))))))
double code(double x, double y, double z) {
double t_0 = x * (-3.0 + (z * 6.0));
double tmp;
if (z <= -4.2e+44) {
tmp = z * (y * -6.0);
} else if (z <= -8.5e-7) {
tmp = t_0;
} else if (z <= 1.55e-9) {
tmp = x + ((y - x) * 4.0);
} else if (z <= 5.2e+66) {
tmp = (0.6666666666666666 - z) * (y * 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 = x * ((-3.0d0) + (z * 6.0d0))
if (z <= (-4.2d+44)) then
tmp = z * (y * (-6.0d0))
else if (z <= (-8.5d-7)) then
tmp = t_0
else if (z <= 1.55d-9) then
tmp = x + ((y - x) * 4.0d0)
else if (z <= 5.2d+66) then
tmp = (0.6666666666666666d0 - z) * (y * 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 = x * (-3.0 + (z * 6.0));
double tmp;
if (z <= -4.2e+44) {
tmp = z * (y * -6.0);
} else if (z <= -8.5e-7) {
tmp = t_0;
} else if (z <= 1.55e-9) {
tmp = x + ((y - x) * 4.0);
} else if (z <= 5.2e+66) {
tmp = (0.6666666666666666 - z) * (y * 6.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (-3.0 + (z * 6.0)) tmp = 0 if z <= -4.2e+44: tmp = z * (y * -6.0) elif z <= -8.5e-7: tmp = t_0 elif z <= 1.55e-9: tmp = x + ((y - x) * 4.0) elif z <= 5.2e+66: tmp = (0.6666666666666666 - z) * (y * 6.0) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(-3.0 + Float64(z * 6.0))) tmp = 0.0 if (z <= -4.2e+44) tmp = Float64(z * Float64(y * -6.0)); elseif (z <= -8.5e-7) tmp = t_0; elseif (z <= 1.55e-9) tmp = Float64(x + Float64(Float64(y - x) * 4.0)); elseif (z <= 5.2e+66) tmp = Float64(Float64(0.6666666666666666 - z) * Float64(y * 6.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (-3.0 + (z * 6.0)); tmp = 0.0; if (z <= -4.2e+44) tmp = z * (y * -6.0); elseif (z <= -8.5e-7) tmp = t_0; elseif (z <= 1.55e-9) tmp = x + ((y - x) * 4.0); elseif (z <= 5.2e+66) tmp = (0.6666666666666666 - z) * (y * 6.0); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.2e+44], N[(z * N[(y * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -8.5e-7], t$95$0, If[LessEqual[z, 1.55e-9], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.2e+66], N[(N[(0.6666666666666666 - z), $MachinePrecision] * N[(y * 6.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{if}\;z \leq -4.2 \cdot 10^{+44}:\\
\;\;\;\;z \cdot \left(y \cdot -6\right)\\
\mathbf{elif}\;z \leq -8.5 \cdot 10^{-7}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{-9}:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{+66}:\\
\;\;\;\;\left(0.6666666666666666 - z\right) \cdot \left(y \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -4.19999999999999974e44Initial program 99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 97.9%
Taylor expanded in z around inf 99.9%
Taylor expanded in y around inf 61.7%
*-commutative61.7%
*-commutative61.7%
associate-*r*61.8%
Simplified61.8%
if -4.19999999999999974e44 < z < -8.50000000000000014e-7 or 5.20000000000000024e66 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 77.0%
sub-neg77.0%
distribute-lft-in77.0%
metadata-eval77.0%
metadata-eval77.0%
mul-1-neg77.0%
*-commutative77.0%
associate-*l*77.0%
*-commutative77.0%
*-commutative77.0%
associate-+r+77.0%
metadata-eval77.0%
metadata-eval77.0%
*-commutative77.0%
associate-*l*77.0%
metadata-eval77.0%
Simplified77.0%
if -8.50000000000000014e-7 < z < 1.55000000000000002e-9Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in z around 0 99.4%
if 1.55000000000000002e-9 < z < 5.20000000000000024e66Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 99.4%
Taylor expanded in y around inf 65.8%
associate-*r*66.1%
*-commutative66.1%
Simplified66.1%
Final simplification84.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ -3.0 (* z 6.0)))))
(if (<= z -2.5e+44)
(* z (* y -6.0))
(if (<= z -1.16e-8)
t_0
(if (<= z 1.15e-9)
(+ (* y 4.0) (* x -3.0))
(if (<= z 6.2e+67) (* (- 0.6666666666666666 z) (* y 6.0)) t_0))))))
double code(double x, double y, double z) {
double t_0 = x * (-3.0 + (z * 6.0));
double tmp;
if (z <= -2.5e+44) {
tmp = z * (y * -6.0);
} else if (z <= -1.16e-8) {
tmp = t_0;
} else if (z <= 1.15e-9) {
tmp = (y * 4.0) + (x * -3.0);
} else if (z <= 6.2e+67) {
tmp = (0.6666666666666666 - z) * (y * 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 = x * ((-3.0d0) + (z * 6.0d0))
if (z <= (-2.5d+44)) then
tmp = z * (y * (-6.0d0))
else if (z <= (-1.16d-8)) then
tmp = t_0
else if (z <= 1.15d-9) then
tmp = (y * 4.0d0) + (x * (-3.0d0))
else if (z <= 6.2d+67) then
tmp = (0.6666666666666666d0 - z) * (y * 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 = x * (-3.0 + (z * 6.0));
double tmp;
if (z <= -2.5e+44) {
tmp = z * (y * -6.0);
} else if (z <= -1.16e-8) {
tmp = t_0;
} else if (z <= 1.15e-9) {
tmp = (y * 4.0) + (x * -3.0);
} else if (z <= 6.2e+67) {
tmp = (0.6666666666666666 - z) * (y * 6.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (-3.0 + (z * 6.0)) tmp = 0 if z <= -2.5e+44: tmp = z * (y * -6.0) elif z <= -1.16e-8: tmp = t_0 elif z <= 1.15e-9: tmp = (y * 4.0) + (x * -3.0) elif z <= 6.2e+67: tmp = (0.6666666666666666 - z) * (y * 6.0) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(-3.0 + Float64(z * 6.0))) tmp = 0.0 if (z <= -2.5e+44) tmp = Float64(z * Float64(y * -6.0)); elseif (z <= -1.16e-8) tmp = t_0; elseif (z <= 1.15e-9) tmp = Float64(Float64(y * 4.0) + Float64(x * -3.0)); elseif (z <= 6.2e+67) tmp = Float64(Float64(0.6666666666666666 - z) * Float64(y * 6.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (-3.0 + (z * 6.0)); tmp = 0.0; if (z <= -2.5e+44) tmp = z * (y * -6.0); elseif (z <= -1.16e-8) tmp = t_0; elseif (z <= 1.15e-9) tmp = (y * 4.0) + (x * -3.0); elseif (z <= 6.2e+67) tmp = (0.6666666666666666 - z) * (y * 6.0); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.5e+44], N[(z * N[(y * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.16e-8], t$95$0, If[LessEqual[z, 1.15e-9], N[(N[(y * 4.0), $MachinePrecision] + N[(x * -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.2e+67], N[(N[(0.6666666666666666 - z), $MachinePrecision] * N[(y * 6.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{if}\;z \leq -2.5 \cdot 10^{+44}:\\
\;\;\;\;z \cdot \left(y \cdot -6\right)\\
\mathbf{elif}\;z \leq -1.16 \cdot 10^{-8}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-9}:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{+67}:\\
\;\;\;\;\left(0.6666666666666666 - z\right) \cdot \left(y \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -2.4999999999999998e44Initial program 99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 97.9%
Taylor expanded in z around inf 99.9%
Taylor expanded in y around inf 61.7%
*-commutative61.7%
*-commutative61.7%
associate-*r*61.8%
Simplified61.8%
if -2.4999999999999998e44 < z < -1.15999999999999996e-8 or 6.19999999999999992e67 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 77.0%
sub-neg77.0%
distribute-lft-in77.0%
metadata-eval77.0%
metadata-eval77.0%
mul-1-neg77.0%
*-commutative77.0%
associate-*l*77.0%
*-commutative77.0%
*-commutative77.0%
associate-+r+77.0%
metadata-eval77.0%
metadata-eval77.0%
*-commutative77.0%
associate-*l*77.0%
metadata-eval77.0%
Simplified77.0%
if -1.15999999999999996e-8 < z < 1.15e-9Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around 0 99.5%
Taylor expanded in z around 0 99.4%
if 1.15e-9 < z < 6.19999999999999992e67Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 99.4%
Taylor expanded in y around inf 65.8%
associate-*r*66.1%
*-commutative66.1%
Simplified66.1%
Final simplification84.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* x z))))
(if (<= z -7.8e-13)
t_0
(if (<= z 2.1e-267)
(* x -3.0)
(if (<= z 5.3e-226) (* 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 * (x * z);
double tmp;
if (z <= -7.8e-13) {
tmp = t_0;
} else if (z <= 2.1e-267) {
tmp = x * -3.0;
} else if (z <= 5.3e-226) {
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 * (x * z)
if (z <= (-7.8d-13)) then
tmp = t_0
else if (z <= 2.1d-267) then
tmp = x * (-3.0d0)
else if (z <= 5.3d-226) 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 * (x * z);
double tmp;
if (z <= -7.8e-13) {
tmp = t_0;
} else if (z <= 2.1e-267) {
tmp = x * -3.0;
} else if (z <= 5.3e-226) {
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 * (x * z) tmp = 0 if z <= -7.8e-13: tmp = t_0 elif z <= 2.1e-267: tmp = x * -3.0 elif z <= 5.3e-226: 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(x * z)) tmp = 0.0 if (z <= -7.8e-13) tmp = t_0; elseif (z <= 2.1e-267) tmp = Float64(x * -3.0); elseif (z <= 5.3e-226) 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 * (x * z); tmp = 0.0; if (z <= -7.8e-13) tmp = t_0; elseif (z <= 2.1e-267) tmp = x * -3.0; elseif (z <= 5.3e-226) 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[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.8e-13], t$95$0, If[LessEqual[z, 2.1e-267], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 5.3e-226], 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(x \cdot z\right)\\
\mathbf{if}\;z \leq -7.8 \cdot 10^{-13}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-267}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 5.3 \cdot 10^{-226}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -7.80000000000000009e-13 or 0.5 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 55.2%
sub-neg55.2%
distribute-lft-in55.2%
metadata-eval55.2%
metadata-eval55.2%
mul-1-neg55.2%
*-commutative55.2%
associate-*l*55.2%
*-commutative55.2%
*-commutative55.2%
associate-+r+55.2%
metadata-eval55.2%
metadata-eval55.2%
*-commutative55.2%
associate-*l*55.2%
metadata-eval55.2%
Simplified55.2%
+-commutative55.2%
fma-def55.1%
Applied egg-rr55.1%
Taylor expanded in z around inf 54.7%
if -7.80000000000000009e-13 < z < 2.1000000000000001e-267 or 5.3000000000000004e-226 < z < 0.5Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around inf 62.0%
sub-neg62.0%
distribute-lft-in62.1%
metadata-eval62.1%
metadata-eval62.1%
mul-1-neg62.1%
*-commutative62.1%
associate-*l*62.1%
*-commutative62.1%
*-commutative62.1%
associate-+r+62.1%
metadata-eval62.1%
metadata-eval62.1%
*-commutative62.1%
associate-*l*62.1%
metadata-eval62.1%
Simplified62.1%
Taylor expanded in z around 0 61.4%
*-commutative61.4%
Simplified61.4%
if 2.1000000000000001e-267 < z < 5.3000000000000004e-226Initial program 99.3%
+-commutative99.3%
associate-*l*99.8%
fma-def99.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 79.3%
Taylor expanded in z around 0 79.3%
Final simplification58.7%
(FPCore (x y z)
:precision binary64
(if (<= z -7.8e-13)
(* 6.0 (* x z))
(if (<= z 1.42e-266)
(* x -3.0)
(if (<= z 2e-226) (* y 4.0) (if (<= z 0.5) (* x -3.0) (* x (* z 6.0)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -7.8e-13) {
tmp = 6.0 * (x * z);
} else if (z <= 1.42e-266) {
tmp = x * -3.0;
} else if (z <= 2e-226) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} 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 (z <= (-7.8d-13)) then
tmp = 6.0d0 * (x * z)
else if (z <= 1.42d-266) then
tmp = x * (-3.0d0)
else if (z <= 2d-226) then
tmp = y * 4.0d0
else if (z <= 0.5d0) then
tmp = x * (-3.0d0)
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 (z <= -7.8e-13) {
tmp = 6.0 * (x * z);
} else if (z <= 1.42e-266) {
tmp = x * -3.0;
} else if (z <= 2e-226) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else {
tmp = x * (z * 6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -7.8e-13: tmp = 6.0 * (x * z) elif z <= 1.42e-266: tmp = x * -3.0 elif z <= 2e-226: tmp = y * 4.0 elif z <= 0.5: tmp = x * -3.0 else: tmp = x * (z * 6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -7.8e-13) tmp = Float64(6.0 * Float64(x * z)); elseif (z <= 1.42e-266) tmp = Float64(x * -3.0); elseif (z <= 2e-226) tmp = Float64(y * 4.0); elseif (z <= 0.5) tmp = Float64(x * -3.0); else tmp = Float64(x * Float64(z * 6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -7.8e-13) tmp = 6.0 * (x * z); elseif (z <= 1.42e-266) tmp = x * -3.0; elseif (z <= 2e-226) tmp = y * 4.0; elseif (z <= 0.5) tmp = x * -3.0; else tmp = x * (z * 6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -7.8e-13], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.42e-266], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2e-226], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{-13}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;z \leq 1.42 \cdot 10^{-266}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 2 \cdot 10^{-226}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\end{array}
\end{array}
if z < -7.80000000000000009e-13Initial program 99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 46.2%
sub-neg46.2%
distribute-lft-in46.2%
metadata-eval46.2%
metadata-eval46.2%
mul-1-neg46.2%
*-commutative46.2%
associate-*l*46.2%
*-commutative46.2%
*-commutative46.2%
associate-+r+46.2%
metadata-eval46.2%
metadata-eval46.2%
*-commutative46.2%
associate-*l*46.2%
metadata-eval46.2%
Simplified46.2%
+-commutative46.2%
fma-def46.1%
Applied egg-rr46.1%
Taylor expanded in z around inf 45.4%
if -7.80000000000000009e-13 < z < 1.42000000000000001e-266 or 1.99999999999999984e-226 < z < 0.5Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around inf 62.0%
sub-neg62.0%
distribute-lft-in62.1%
metadata-eval62.1%
metadata-eval62.1%
mul-1-neg62.1%
*-commutative62.1%
associate-*l*62.1%
*-commutative62.1%
*-commutative62.1%
associate-+r+62.1%
metadata-eval62.1%
metadata-eval62.1%
*-commutative62.1%
associate-*l*62.1%
metadata-eval62.1%
Simplified62.1%
Taylor expanded in z around 0 61.4%
*-commutative61.4%
Simplified61.4%
if 1.42000000000000001e-266 < z < 1.99999999999999984e-226Initial program 99.3%
+-commutative99.3%
associate-*l*99.8%
fma-def99.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 79.3%
Taylor expanded in z around 0 79.3%
if 0.5 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 64.3%
sub-neg64.3%
distribute-lft-in64.3%
metadata-eval64.3%
metadata-eval64.3%
mul-1-neg64.3%
*-commutative64.3%
associate-*l*64.3%
*-commutative64.3%
*-commutative64.3%
associate-+r+64.3%
metadata-eval64.3%
metadata-eval64.3%
*-commutative64.3%
associate-*l*64.3%
metadata-eval64.3%
Simplified64.3%
Taylor expanded in z around inf 64.2%
Final simplification58.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ -3.0 (* z 6.0)))))
(if (<= x -4e-157)
t_0
(if (<= x 1.2e-159)
(+ x (* y 4.0))
(if (<= x 9e-109) (* y (* z -6.0)) t_0)))))
double code(double x, double y, double z) {
double t_0 = x * (-3.0 + (z * 6.0));
double tmp;
if (x <= -4e-157) {
tmp = t_0;
} else if (x <= 1.2e-159) {
tmp = x + (y * 4.0);
} else if (x <= 9e-109) {
tmp = y * (z * -6.0);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = x * ((-3.0d0) + (z * 6.0d0))
if (x <= (-4d-157)) then
tmp = t_0
else if (x <= 1.2d-159) then
tmp = x + (y * 4.0d0)
else if (x <= 9d-109) then
tmp = y * (z * (-6.0d0))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (-3.0 + (z * 6.0));
double tmp;
if (x <= -4e-157) {
tmp = t_0;
} else if (x <= 1.2e-159) {
tmp = x + (y * 4.0);
} else if (x <= 9e-109) {
tmp = y * (z * -6.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (-3.0 + (z * 6.0)) tmp = 0 if x <= -4e-157: tmp = t_0 elif x <= 1.2e-159: tmp = x + (y * 4.0) elif x <= 9e-109: tmp = y * (z * -6.0) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(-3.0 + Float64(z * 6.0))) tmp = 0.0 if (x <= -4e-157) tmp = t_0; elseif (x <= 1.2e-159) tmp = Float64(x + Float64(y * 4.0)); elseif (x <= 9e-109) tmp = Float64(y * Float64(z * -6.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (-3.0 + (z * 6.0)); tmp = 0.0; if (x <= -4e-157) tmp = t_0; elseif (x <= 1.2e-159) tmp = x + (y * 4.0); elseif (x <= 9e-109) tmp = y * (z * -6.0); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4e-157], t$95$0, If[LessEqual[x, 1.2e-159], N[(x + N[(y * 4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9e-109], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{if}\;x \leq -4 \cdot 10^{-157}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{-159}:\\
\;\;\;\;x + y \cdot 4\\
\mathbf{elif}\;x \leq 9 \cdot 10^{-109}:\\
\;\;\;\;y \cdot \left(z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -3.99999999999999977e-157 or 9.0000000000000002e-109 < x Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 73.6%
sub-neg73.6%
distribute-lft-in73.6%
metadata-eval73.6%
metadata-eval73.6%
mul-1-neg73.6%
*-commutative73.6%
associate-*l*73.6%
*-commutative73.6%
*-commutative73.6%
associate-+r+73.6%
metadata-eval73.6%
metadata-eval73.6%
*-commutative73.6%
associate-*l*73.6%
metadata-eval73.6%
Simplified73.6%
if -3.99999999999999977e-157 < x < 1.19999999999999999e-159Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 89.8%
associate-*r*90.0%
*-commutative90.0%
Simplified90.0%
Taylor expanded in z around 0 53.3%
*-commutative53.3%
Simplified53.3%
if 1.19999999999999999e-159 < x < 9.0000000000000002e-109Initial program 99.8%
+-commutative99.8%
associate-*l*99.8%
fma-def99.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 89.3%
Taylor expanded in z around inf 78.2%
Final simplification69.2%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.58) (not (<= z 0.55))) (* z (+ (* y -6.0) (* x 6.0))) (+ (* y 4.0) (* x -3.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.58) || !(z <= 0.55)) {
tmp = z * ((y * -6.0) + (x * 6.0));
} else {
tmp = (y * 4.0) + (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 ((z <= (-0.58d0)) .or. (.not. (z <= 0.55d0))) then
tmp = z * ((y * (-6.0d0)) + (x * 6.0d0))
else
tmp = (y * 4.0d0) + (x * (-3.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.58) || !(z <= 0.55)) {
tmp = z * ((y * -6.0) + (x * 6.0));
} else {
tmp = (y * 4.0) + (x * -3.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.58) or not (z <= 0.55): tmp = z * ((y * -6.0) + (x * 6.0)) else: tmp = (y * 4.0) + (x * -3.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.58) || !(z <= 0.55)) tmp = Float64(z * Float64(Float64(y * -6.0) + Float64(x * 6.0))); else tmp = Float64(Float64(y * 4.0) + Float64(x * -3.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.58) || ~((z <= 0.55))) tmp = z * ((y * -6.0) + (x * 6.0)); else tmp = (y * 4.0) + (x * -3.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.58], N[Not[LessEqual[z, 0.55]], $MachinePrecision]], N[(z * N[(N[(y * -6.0), $MachinePrecision] + N[(x * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 4.0), $MachinePrecision] + N[(x * -3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.58 \lor \neg \left(z \leq 0.55\right):\\
\;\;\;\;z \cdot \left(y \cdot -6 + x \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\end{array}
\end{array}
if z < -0.57999999999999996 or 0.55000000000000004 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 97.3%
Taylor expanded in z around inf 99.2%
if -0.57999999999999996 < z < 0.55000000000000004Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around 0 99.5%
Taylor expanded in z around 0 98.2%
Final simplification98.7%
(FPCore (x y z) :precision binary64 (if (<= z -0.55) (* z (+ (* y -6.0) (* x 6.0))) (if (<= z 0.5) (+ (* y 4.0) (* x -3.0)) (+ x (* (- y x) (* z -6.0))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.55) {
tmp = z * ((y * -6.0) + (x * 6.0));
} else if (z <= 0.5) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = x + ((y - 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 (z <= (-0.55d0)) then
tmp = z * ((y * (-6.0d0)) + (x * 6.0d0))
else if (z <= 0.5d0) then
tmp = (y * 4.0d0) + (x * (-3.0d0))
else
tmp = x + ((y - x) * (z * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.55) {
tmp = z * ((y * -6.0) + (x * 6.0));
} else if (z <= 0.5) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = x + ((y - x) * (z * -6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.55: tmp = z * ((y * -6.0) + (x * 6.0)) elif z <= 0.5: tmp = (y * 4.0) + (x * -3.0) else: tmp = x + ((y - x) * (z * -6.0)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.55) tmp = Float64(z * Float64(Float64(y * -6.0) + Float64(x * 6.0))); elseif (z <= 0.5) tmp = Float64(Float64(y * 4.0) + Float64(x * -3.0)); else tmp = Float64(x + Float64(Float64(y - x) * Float64(z * -6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.55) tmp = z * ((y * -6.0) + (x * 6.0)); elseif (z <= 0.5) tmp = (y * 4.0) + (x * -3.0); else tmp = x + ((y - x) * (z * -6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.55], N[(z * N[(N[(y * -6.0), $MachinePrecision] + N[(x * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.5], N[(N[(y * 4.0), $MachinePrecision] + N[(x * -3.0), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.55:\\
\;\;\;\;z \cdot \left(y \cdot -6 + x \cdot 6\right)\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right) \cdot \left(z \cdot -6\right)\\
\end{array}
\end{array}
if z < -0.55000000000000004Initial program 99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 98.1%
Taylor expanded in z around inf 98.9%
if -0.55000000000000004 < z < 0.5Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around 0 99.5%
Taylor expanded in z around 0 98.2%
if 0.5 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 99.6%
*-commutative99.6%
*-commutative99.6%
associate-*r*99.6%
*-commutative99.6%
Simplified99.6%
Final simplification98.7%
(FPCore (x y z) :precision binary64 (if (or (<= x -3.2e-111) (not (<= x 6e-107))) (* x (+ -3.0 (* z 6.0))) (* y (+ 4.0 (* z -6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -3.2e-111) || !(x <= 6e-107)) {
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 <= (-3.2d-111)) .or. (.not. (x <= 6d-107))) 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 <= -3.2e-111) || !(x <= 6e-107)) {
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 <= -3.2e-111) or not (x <= 6e-107): 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 <= -3.2e-111) || !(x <= 6e-107)) 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 <= -3.2e-111) || ~((x <= 6e-107))) 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, -3.2e-111], N[Not[LessEqual[x, 6e-107]], $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 -3.2 \cdot 10^{-111} \lor \neg \left(x \leq 6 \cdot 10^{-107}\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 < -3.1999999999999998e-111 or 5.9999999999999994e-107 < x Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 76.8%
sub-neg76.8%
distribute-lft-in76.8%
metadata-eval76.8%
metadata-eval76.8%
mul-1-neg76.8%
*-commutative76.8%
associate-*l*76.8%
*-commutative76.8%
*-commutative76.8%
associate-+r+76.8%
metadata-eval76.8%
metadata-eval76.8%
*-commutative76.8%
associate-*l*76.8%
metadata-eval76.8%
Simplified76.8%
if -3.1999999999999998e-111 < x < 5.9999999999999994e-107Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-def99.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 85.1%
Final simplification79.5%
(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.5%
metadata-eval99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z) :precision binary64 (if (or (<= x -5.4e+85) (not (<= x 1.45e-102))) (* x -3.0) (* y 4.0)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -5.4e+85) || !(x <= 1.45e-102)) {
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 <= (-5.4d+85)) .or. (.not. (x <= 1.45d-102))) 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 <= -5.4e+85) || !(x <= 1.45e-102)) {
tmp = x * -3.0;
} else {
tmp = y * 4.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -5.4e+85) or not (x <= 1.45e-102): tmp = x * -3.0 else: tmp = y * 4.0 return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -5.4e+85) || !(x <= 1.45e-102)) 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 <= -5.4e+85) || ~((x <= 1.45e-102))) tmp = x * -3.0; else tmp = y * 4.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -5.4e+85], N[Not[LessEqual[x, 1.45e-102]], $MachinePrecision]], N[(x * -3.0), $MachinePrecision], N[(y * 4.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.4 \cdot 10^{+85} \lor \neg \left(x \leq 1.45 \cdot 10^{-102}\right):\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4\\
\end{array}
\end{array}
if x < -5.39999999999999966e85 or 1.44999999999999993e-102 < x Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 81.9%
sub-neg81.9%
distribute-lft-in81.9%
metadata-eval81.9%
metadata-eval81.9%
mul-1-neg81.9%
*-commutative81.9%
associate-*l*81.9%
*-commutative81.9%
*-commutative81.9%
associate-+r+81.9%
metadata-eval81.9%
metadata-eval81.9%
*-commutative81.9%
associate-*l*81.9%
metadata-eval81.9%
Simplified81.9%
Taylor expanded in z around 0 48.7%
*-commutative48.7%
Simplified48.7%
if -5.39999999999999966e85 < x < 1.44999999999999993e-102Initial program 99.5%
+-commutative99.5%
associate-*l*99.7%
fma-def99.7%
sub-neg99.7%
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 70.4%
Taylor expanded in z around 0 36.9%
Final simplification43.0%
(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.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 57.4%
sub-neg57.4%
distribute-lft-in57.4%
metadata-eval57.4%
metadata-eval57.4%
mul-1-neg57.4%
*-commutative57.4%
associate-*l*57.4%
*-commutative57.4%
*-commutative57.4%
associate-+r+57.4%
metadata-eval57.4%
metadata-eval57.4%
*-commutative57.4%
associate-*l*57.4%
metadata-eval57.4%
Simplified57.4%
Taylor expanded in z around 0 31.4%
*-commutative31.4%
Simplified31.4%
Final simplification31.4%
herbie shell --seed 2023301
(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))))