
(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 (+ x (* (+ (* x -6.0) (* 6.0 y)) (- 0.6666666666666666 z))))
double code(double x, double y, double z) {
return x + (((x * -6.0) + (6.0 * y)) * (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 + (((x * (-6.0d0)) + (6.0d0 * y)) * (0.6666666666666666d0 - z))
end function
public static double code(double x, double y, double z) {
return x + (((x * -6.0) + (6.0 * y)) * (0.6666666666666666 - z));
}
def code(x, y, z): return x + (((x * -6.0) + (6.0 * y)) * (0.6666666666666666 - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(x * -6.0) + Float64(6.0 * y)) * Float64(0.6666666666666666 - z))) end
function tmp = code(x, y, z) tmp = x + (((x * -6.0) + (6.0 * y)) * (0.6666666666666666 - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(x * -6.0), $MachinePrecision] + N[(6.0 * y), $MachinePrecision]), $MachinePrecision] * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(x \cdot -6 + 6 \cdot y\right) \cdot \left(0.6666666666666666 - z\right)
\end{array}
Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 99.7%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (* 6.0 (- x y)))))
(if (<= z -66000.0)
t_0
(if (<= z -4.7e-163)
(* x (+ -3.0 (* 6.0 z)))
(if (<= z 235000.0) (* y (+ 4.0 (* -6.0 z))) t_0)))))
double code(double x, double y, double z) {
double t_0 = z * (6.0 * (x - y));
double tmp;
if (z <= -66000.0) {
tmp = t_0;
} else if (z <= -4.7e-163) {
tmp = x * (-3.0 + (6.0 * z));
} else if (z <= 235000.0) {
tmp = y * (4.0 + (-6.0 * 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 = z * (6.0d0 * (x - y))
if (z <= (-66000.0d0)) then
tmp = t_0
else if (z <= (-4.7d-163)) then
tmp = x * ((-3.0d0) + (6.0d0 * z))
else if (z <= 235000.0d0) then
tmp = y * (4.0d0 + ((-6.0d0) * z))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * (6.0 * (x - y));
double tmp;
if (z <= -66000.0) {
tmp = t_0;
} else if (z <= -4.7e-163) {
tmp = x * (-3.0 + (6.0 * z));
} else if (z <= 235000.0) {
tmp = y * (4.0 + (-6.0 * z));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * (6.0 * (x - y)) tmp = 0 if z <= -66000.0: tmp = t_0 elif z <= -4.7e-163: tmp = x * (-3.0 + (6.0 * z)) elif z <= 235000.0: tmp = y * (4.0 + (-6.0 * z)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * Float64(6.0 * Float64(x - y))) tmp = 0.0 if (z <= -66000.0) tmp = t_0; elseif (z <= -4.7e-163) tmp = Float64(x * Float64(-3.0 + Float64(6.0 * z))); elseif (z <= 235000.0) tmp = Float64(y * Float64(4.0 + Float64(-6.0 * z))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * (6.0 * (x - y)); tmp = 0.0; if (z <= -66000.0) tmp = t_0; elseif (z <= -4.7e-163) tmp = x * (-3.0 + (6.0 * z)); elseif (z <= 235000.0) tmp = y * (4.0 + (-6.0 * z)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(6.0 * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -66000.0], t$95$0, If[LessEqual[z, -4.7e-163], N[(x * N[(-3.0 + N[(6.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 235000.0], N[(y * N[(4.0 + N[(-6.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(6 \cdot \left(x - y\right)\right)\\
\mathbf{if}\;z \leq -66000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -4.7 \cdot 10^{-163}:\\
\;\;\;\;x \cdot \left(-3 + 6 \cdot z\right)\\
\mathbf{elif}\;z \leq 235000:\\
\;\;\;\;y \cdot \left(4 + -6 \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -66000 or 235000 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 99.8%
+-commutative99.8%
fma-define99.8%
fma-define99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 99.4%
mul-1-neg99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
cancel-sign-sub-inv99.4%
distribute-lft-out--99.4%
distribute-lft-neg-in99.4%
metadata-eval99.4%
Simplified99.4%
if -66000 < z < -4.7e-163Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-define99.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%
Taylor expanded in y around 0 61.7%
*-lft-identity61.7%
*-commutative61.7%
+-commutative61.7%
*-commutative61.7%
fma-define61.7%
associate-*r*61.7%
fma-define61.7%
distribute-lft-in61.7%
neg-mul-161.7%
distribute-lft-neg-in61.7%
metadata-eval61.7%
metadata-eval61.7%
distribute-rgt-in61.7%
+-commutative61.7%
sub-neg61.7%
distribute-rgt-in61.6%
sub-neg61.6%
distribute-rgt-in61.6%
metadata-eval61.6%
distribute-lft-neg-in61.6%
associate-+r+61.7%
Simplified61.7%
if -4.7e-163 < z < 235000Initial program 99.5%
+-commutative99.5%
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 59.4%
(FPCore (x y z)
:precision binary64
(if (<= z -0.025)
(* -6.0 (* y z))
(if (<= z -1.65e-165)
(* x -3.0)
(if (<= z 0.65) (* y 4.0) (* z (* x 6.0))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.025) {
tmp = -6.0 * (y * z);
} else if (z <= -1.65e-165) {
tmp = x * -3.0;
} else if (z <= 0.65) {
tmp = y * 4.0;
} else {
tmp = z * (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.025d0)) then
tmp = (-6.0d0) * (y * z)
else if (z <= (-1.65d-165)) then
tmp = x * (-3.0d0)
else if (z <= 0.65d0) then
tmp = y * 4.0d0
else
tmp = z * (x * 6.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.025) {
tmp = -6.0 * (y * z);
} else if (z <= -1.65e-165) {
tmp = x * -3.0;
} else if (z <= 0.65) {
tmp = y * 4.0;
} else {
tmp = z * (x * 6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.025: tmp = -6.0 * (y * z) elif z <= -1.65e-165: tmp = x * -3.0 elif z <= 0.65: tmp = y * 4.0 else: tmp = z * (x * 6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.025) tmp = Float64(-6.0 * Float64(y * z)); elseif (z <= -1.65e-165) tmp = Float64(x * -3.0); elseif (z <= 0.65) tmp = Float64(y * 4.0); else tmp = Float64(z * Float64(x * 6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.025) tmp = -6.0 * (y * z); elseif (z <= -1.65e-165) tmp = x * -3.0; elseif (z <= 0.65) tmp = y * 4.0; else tmp = z * (x * 6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.025], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.65e-165], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.65], N[(y * 4.0), $MachinePrecision], N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.025:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;z \leq -1.65 \cdot 10^{-165}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.65:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(x \cdot 6\right)\\
\end{array}
\end{array}
if z < -0.025000000000000001Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 91.9%
Taylor expanded in z around inf 99.4%
Taylor expanded in y around inf 58.0%
if -0.025000000000000001 < z < -1.6499999999999999e-165Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-define99.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%
Taylor expanded in y around 0 61.7%
*-lft-identity61.7%
*-commutative61.7%
+-commutative61.7%
*-commutative61.7%
fma-define61.7%
associate-*r*61.7%
fma-define61.7%
distribute-lft-in61.7%
neg-mul-161.7%
distribute-lft-neg-in61.7%
metadata-eval61.7%
metadata-eval61.7%
distribute-rgt-in61.7%
+-commutative61.7%
sub-neg61.7%
distribute-rgt-in61.6%
sub-neg61.6%
distribute-rgt-in61.6%
metadata-eval61.6%
distribute-lft-neg-in61.6%
associate-+r+61.7%
Simplified61.7%
Taylor expanded in z around 0 59.9%
*-commutative59.9%
Simplified59.9%
if -1.6499999999999999e-165 < z < 0.650000000000000022Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around 0 99.5%
Taylor expanded in x around 0 59.2%
associate-*r*59.1%
*-commutative59.1%
associate-*r*59.4%
sub-neg59.4%
neg-mul-159.4%
distribute-lft-in59.4%
metadata-eval59.4%
neg-mul-159.4%
distribute-rgt-neg-in59.4%
distribute-lft-neg-in59.4%
metadata-eval59.4%
+-commutative59.4%
*-commutative59.4%
fma-define59.4%
Simplified59.4%
Taylor expanded in z around 0 58.2%
*-commutative58.2%
Simplified58.2%
if 0.650000000000000022 < z Initial program 99.9%
+-commutative99.9%
associate-*l*99.9%
fma-define99.9%
sub-neg99.9%
distribute-rgt-in99.9%
metadata-eval99.9%
metadata-eval99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 63.9%
*-lft-identity63.9%
*-commutative63.9%
+-commutative63.9%
*-commutative63.9%
fma-define63.8%
associate-*r*63.8%
fma-define63.9%
distribute-lft-in63.9%
neg-mul-163.9%
distribute-lft-neg-in63.9%
metadata-eval63.9%
metadata-eval63.9%
distribute-rgt-in63.9%
+-commutative63.9%
sub-neg63.9%
distribute-rgt-in63.9%
sub-neg63.9%
distribute-rgt-in63.9%
metadata-eval63.9%
distribute-lft-neg-in63.9%
associate-+r+63.9%
Simplified63.9%
Taylor expanded in z around inf 63.5%
associate-*r*63.5%
Simplified63.5%
Final simplification59.8%
(FPCore (x y z)
:precision binary64
(if (<= z -9.5)
(* -6.0 (* y z))
(if (<= z -2.1e-163)
(* x -3.0)
(if (<= z 0.66) (* y 4.0) (* x (* 6.0 z))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -9.5) {
tmp = -6.0 * (y * z);
} else if (z <= -2.1e-163) {
tmp = x * -3.0;
} else if (z <= 0.66) {
tmp = y * 4.0;
} else {
tmp = x * (6.0 * z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-9.5d0)) then
tmp = (-6.0d0) * (y * z)
else if (z <= (-2.1d-163)) then
tmp = x * (-3.0d0)
else if (z <= 0.66d0) then
tmp = y * 4.0d0
else
tmp = x * (6.0d0 * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -9.5) {
tmp = -6.0 * (y * z);
} else if (z <= -2.1e-163) {
tmp = x * -3.0;
} else if (z <= 0.66) {
tmp = y * 4.0;
} else {
tmp = x * (6.0 * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -9.5: tmp = -6.0 * (y * z) elif z <= -2.1e-163: tmp = x * -3.0 elif z <= 0.66: tmp = y * 4.0 else: tmp = x * (6.0 * z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -9.5) tmp = Float64(-6.0 * Float64(y * z)); elseif (z <= -2.1e-163) tmp = Float64(x * -3.0); elseif (z <= 0.66) tmp = Float64(y * 4.0); else tmp = Float64(x * Float64(6.0 * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -9.5) tmp = -6.0 * (y * z); elseif (z <= -2.1e-163) tmp = x * -3.0; elseif (z <= 0.66) tmp = y * 4.0; else tmp = x * (6.0 * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -9.5], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.1e-163], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.66], N[(y * 4.0), $MachinePrecision], N[(x * N[(6.0 * z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;z \leq -2.1 \cdot 10^{-163}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(6 \cdot z\right)\\
\end{array}
\end{array}
if z < -9.5Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 91.9%
Taylor expanded in z around inf 99.4%
Taylor expanded in y around inf 58.0%
if -9.5 < z < -2.09999999999999998e-163Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-define99.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%
Taylor expanded in y around 0 61.7%
*-lft-identity61.7%
*-commutative61.7%
+-commutative61.7%
*-commutative61.7%
fma-define61.7%
associate-*r*61.7%
fma-define61.7%
distribute-lft-in61.7%
neg-mul-161.7%
distribute-lft-neg-in61.7%
metadata-eval61.7%
metadata-eval61.7%
distribute-rgt-in61.7%
+-commutative61.7%
sub-neg61.7%
distribute-rgt-in61.6%
sub-neg61.6%
distribute-rgt-in61.6%
metadata-eval61.6%
distribute-lft-neg-in61.6%
associate-+r+61.7%
Simplified61.7%
Taylor expanded in z around 0 59.9%
*-commutative59.9%
Simplified59.9%
if -2.09999999999999998e-163 < z < 0.660000000000000031Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around 0 99.5%
Taylor expanded in x around 0 59.2%
associate-*r*59.1%
*-commutative59.1%
associate-*r*59.4%
sub-neg59.4%
neg-mul-159.4%
distribute-lft-in59.4%
metadata-eval59.4%
neg-mul-159.4%
distribute-rgt-neg-in59.4%
distribute-lft-neg-in59.4%
metadata-eval59.4%
+-commutative59.4%
*-commutative59.4%
fma-define59.4%
Simplified59.4%
Taylor expanded in z around 0 58.2%
*-commutative58.2%
Simplified58.2%
if 0.660000000000000031 < z Initial program 99.9%
+-commutative99.9%
associate-*l*99.9%
fma-define99.9%
sub-neg99.9%
distribute-rgt-in99.9%
metadata-eval99.9%
metadata-eval99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 63.9%
*-lft-identity63.9%
*-commutative63.9%
+-commutative63.9%
*-commutative63.9%
fma-define63.8%
associate-*r*63.8%
fma-define63.9%
distribute-lft-in63.9%
neg-mul-163.9%
distribute-lft-neg-in63.9%
metadata-eval63.9%
metadata-eval63.9%
distribute-rgt-in63.9%
+-commutative63.9%
sub-neg63.9%
distribute-rgt-in63.9%
sub-neg63.9%
distribute-rgt-in63.9%
metadata-eval63.9%
distribute-lft-neg-in63.9%
associate-+r+63.9%
Simplified63.9%
Taylor expanded in z around inf 63.5%
(FPCore (x y z)
:precision binary64
(if (<= z -6.8)
(* -6.0 (* y z))
(if (<= z -2.7e-163)
(* x -3.0)
(if (<= z 0.52) (* y 4.0) (* 6.0 (* x z))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -6.8) {
tmp = -6.0 * (y * z);
} else if (z <= -2.7e-163) {
tmp = x * -3.0;
} else if (z <= 0.52) {
tmp = y * 4.0;
} else {
tmp = 6.0 * (x * z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-6.8d0)) then
tmp = (-6.0d0) * (y * z)
else if (z <= (-2.7d-163)) then
tmp = x * (-3.0d0)
else if (z <= 0.52d0) then
tmp = y * 4.0d0
else
tmp = 6.0d0 * (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -6.8) {
tmp = -6.0 * (y * z);
} else if (z <= -2.7e-163) {
tmp = x * -3.0;
} else if (z <= 0.52) {
tmp = y * 4.0;
} else {
tmp = 6.0 * (x * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -6.8: tmp = -6.0 * (y * z) elif z <= -2.7e-163: tmp = x * -3.0 elif z <= 0.52: tmp = y * 4.0 else: tmp = 6.0 * (x * z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -6.8) tmp = Float64(-6.0 * Float64(y * z)); elseif (z <= -2.7e-163) tmp = Float64(x * -3.0); elseif (z <= 0.52) tmp = Float64(y * 4.0); else tmp = Float64(6.0 * Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -6.8) tmp = -6.0 * (y * z); elseif (z <= -2.7e-163) tmp = x * -3.0; elseif (z <= 0.52) tmp = y * 4.0; else tmp = 6.0 * (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -6.8], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.7e-163], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.52], N[(y * 4.0), $MachinePrecision], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.8:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;z \leq -2.7 \cdot 10^{-163}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.52:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if z < -6.79999999999999982Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 91.9%
Taylor expanded in z around inf 99.4%
Taylor expanded in y around inf 58.0%
if -6.79999999999999982 < z < -2.70000000000000015e-163Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-define99.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%
Taylor expanded in y around 0 61.7%
*-lft-identity61.7%
*-commutative61.7%
+-commutative61.7%
*-commutative61.7%
fma-define61.7%
associate-*r*61.7%
fma-define61.7%
distribute-lft-in61.7%
neg-mul-161.7%
distribute-lft-neg-in61.7%
metadata-eval61.7%
metadata-eval61.7%
distribute-rgt-in61.7%
+-commutative61.7%
sub-neg61.7%
distribute-rgt-in61.6%
sub-neg61.6%
distribute-rgt-in61.6%
metadata-eval61.6%
distribute-lft-neg-in61.6%
associate-+r+61.7%
Simplified61.7%
Taylor expanded in z around 0 59.9%
*-commutative59.9%
Simplified59.9%
if -2.70000000000000015e-163 < z < 0.52000000000000002Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around 0 99.5%
Taylor expanded in x around 0 59.2%
associate-*r*59.1%
*-commutative59.1%
associate-*r*59.4%
sub-neg59.4%
neg-mul-159.4%
distribute-lft-in59.4%
metadata-eval59.4%
neg-mul-159.4%
distribute-rgt-neg-in59.4%
distribute-lft-neg-in59.4%
metadata-eval59.4%
+-commutative59.4%
*-commutative59.4%
fma-define59.4%
Simplified59.4%
Taylor expanded in z around 0 58.2%
*-commutative58.2%
Simplified58.2%
if 0.52000000000000002 < z Initial program 99.9%
+-commutative99.9%
associate-*l*99.9%
fma-define99.9%
sub-neg99.9%
distribute-rgt-in99.9%
metadata-eval99.9%
metadata-eval99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 63.9%
*-lft-identity63.9%
*-commutative63.9%
+-commutative63.9%
*-commutative63.9%
fma-define63.8%
associate-*r*63.8%
fma-define63.9%
distribute-lft-in63.9%
neg-mul-163.9%
distribute-lft-neg-in63.9%
metadata-eval63.9%
metadata-eval63.9%
distribute-rgt-in63.9%
+-commutative63.9%
sub-neg63.9%
distribute-rgt-in63.9%
sub-neg63.9%
distribute-rgt-in63.9%
metadata-eval63.9%
distribute-lft-neg-in63.9%
associate-+r+63.9%
Simplified63.9%
Taylor expanded in z around inf 63.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -0.116)
t_0
(if (<= z -8.2e-165)
(* x -3.0)
(if (<= z 64000000000.0) (* y 4.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -0.116) {
tmp = t_0;
} else if (z <= -8.2e-165) {
tmp = x * -3.0;
} else if (z <= 64000000000.0) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
if (z <= (-0.116d0)) then
tmp = t_0
else if (z <= (-8.2d-165)) then
tmp = x * (-3.0d0)
else if (z <= 64000000000.0d0) then
tmp = y * 4.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -0.116) {
tmp = t_0;
} else if (z <= -8.2e-165) {
tmp = x * -3.0;
} else if (z <= 64000000000.0) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -0.116: tmp = t_0 elif z <= -8.2e-165: tmp = x * -3.0 elif z <= 64000000000.0: tmp = y * 4.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -0.116) tmp = t_0; elseif (z <= -8.2e-165) tmp = Float64(x * -3.0); elseif (z <= 64000000000.0) tmp = Float64(y * 4.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); tmp = 0.0; if (z <= -0.116) tmp = t_0; elseif (z <= -8.2e-165) tmp = x * -3.0; elseif (z <= 64000000000.0) tmp = y * 4.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.116], t$95$0, If[LessEqual[z, -8.2e-165], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 64000000000.0], N[(y * 4.0), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -0.116:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -8.2 \cdot 10^{-165}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 64000000000:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.116000000000000006 or 6.4e10 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 95.6%
Taylor expanded in z around inf 99.6%
Taylor expanded in y around inf 51.0%
if -0.116000000000000006 < z < -8.2000000000000004e-165Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-define99.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%
Taylor expanded in y around 0 61.7%
*-lft-identity61.7%
*-commutative61.7%
+-commutative61.7%
*-commutative61.7%
fma-define61.7%
associate-*r*61.7%
fma-define61.7%
distribute-lft-in61.7%
neg-mul-161.7%
distribute-lft-neg-in61.7%
metadata-eval61.7%
metadata-eval61.7%
distribute-rgt-in61.7%
+-commutative61.7%
sub-neg61.7%
distribute-rgt-in61.6%
sub-neg61.6%
distribute-rgt-in61.6%
metadata-eval61.6%
distribute-lft-neg-in61.6%
associate-+r+61.7%
Simplified61.7%
Taylor expanded in z around 0 59.9%
*-commutative59.9%
Simplified59.9%
if -8.2000000000000004e-165 < z < 6.4e10Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around 0 99.5%
Taylor expanded in x around 0 58.5%
associate-*r*58.4%
*-commutative58.4%
associate-*r*58.7%
sub-neg58.7%
neg-mul-158.7%
distribute-lft-in58.7%
metadata-eval58.7%
neg-mul-158.7%
distribute-rgt-neg-in58.7%
distribute-lft-neg-in58.7%
metadata-eval58.7%
+-commutative58.7%
*-commutative58.7%
fma-define58.7%
Simplified58.7%
Taylor expanded in z around 0 57.5%
*-commutative57.5%
Simplified57.5%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.6) (not (<= z 0.56))) (* z (* 6.0 (- x y))) (+ (* x -3.0) (* y 4.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.6) || !(z <= 0.56)) {
tmp = z * (6.0 * (x - y));
} else {
tmp = (x * -3.0) + (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 ((z <= (-0.6d0)) .or. (.not. (z <= 0.56d0))) then
tmp = z * (6.0d0 * (x - y))
else
tmp = (x * (-3.0d0)) + (y * 4.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.6) || !(z <= 0.56)) {
tmp = z * (6.0 * (x - y));
} else {
tmp = (x * -3.0) + (y * 4.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.6) or not (z <= 0.56): tmp = z * (6.0 * (x - y)) else: tmp = (x * -3.0) + (y * 4.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.6) || !(z <= 0.56)) tmp = Float64(z * Float64(6.0 * Float64(x - y))); else tmp = Float64(Float64(x * -3.0) + Float64(y * 4.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.6) || ~((z <= 0.56))) tmp = z * (6.0 * (x - y)); else tmp = (x * -3.0) + (y * 4.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.6], N[Not[LessEqual[z, 0.56]], $MachinePrecision]], N[(z * N[(6.0 * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * -3.0), $MachinePrecision] + N[(y * 4.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.6 \lor \neg \left(z \leq 0.56\right):\\
\;\;\;\;z \cdot \left(6 \cdot \left(x - y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3 + y \cdot 4\\
\end{array}
\end{array}
if z < -0.599999999999999978 or 0.56000000000000005 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 99.8%
+-commutative99.8%
fma-define99.8%
fma-define99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 99.4%
mul-1-neg99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
cancel-sign-sub-inv99.4%
distribute-lft-out--99.4%
distribute-lft-neg-in99.4%
metadata-eval99.4%
Simplified99.4%
if -0.599999999999999978 < z < 0.56000000000000005Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 99.7%
Taylor expanded in z around 0 98.5%
Final simplification99.0%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.56) (not (<= z 0.56))) (* z (* 6.0 (- x y))) (+ x (* (- y x) 4.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.56) || !(z <= 0.56)) {
tmp = z * (6.0 * (x - y));
} else {
tmp = x + ((y - x) * 4.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-0.56d0)) .or. (.not. (z <= 0.56d0))) then
tmp = z * (6.0d0 * (x - y))
else
tmp = x + ((y - x) * 4.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.56) || !(z <= 0.56)) {
tmp = z * (6.0 * (x - y));
} else {
tmp = x + ((y - x) * 4.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.56) or not (z <= 0.56): tmp = z * (6.0 * (x - y)) else: tmp = x + ((y - x) * 4.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.56) || !(z <= 0.56)) tmp = Float64(z * Float64(6.0 * Float64(x - y))); else tmp = Float64(x + Float64(Float64(y - x) * 4.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.56) || ~((z <= 0.56))) tmp = z * (6.0 * (x - y)); else tmp = x + ((y - x) * 4.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.56], N[Not[LessEqual[z, 0.56]], $MachinePrecision]], N[(z * N[(6.0 * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.56 \lor \neg \left(z \leq 0.56\right):\\
\;\;\;\;z \cdot \left(6 \cdot \left(x - y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\end{array}
\end{array}
if z < -0.56000000000000005 or 0.56000000000000005 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 99.8%
+-commutative99.8%
fma-define99.8%
fma-define99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 99.4%
mul-1-neg99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
cancel-sign-sub-inv99.4%
distribute-lft-out--99.4%
distribute-lft-neg-in99.4%
metadata-eval99.4%
Simplified99.4%
if -0.56000000000000005 < z < 0.56000000000000005Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 98.5%
Final simplification99.0%
(FPCore (x y z) :precision binary64 (if (or (<= x -6.5e+17) (not (<= x 2.75e-73))) (* x (+ -3.0 (* 6.0 z))) (* 6.0 (* y (- 0.6666666666666666 z)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -6.5e+17) || !(x <= 2.75e-73)) {
tmp = x * (-3.0 + (6.0 * z));
} else {
tmp = 6.0 * (y * (0.6666666666666666 - z));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-6.5d+17)) .or. (.not. (x <= 2.75d-73))) then
tmp = x * ((-3.0d0) + (6.0d0 * z))
else
tmp = 6.0d0 * (y * (0.6666666666666666d0 - z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -6.5e+17) || !(x <= 2.75e-73)) {
tmp = x * (-3.0 + (6.0 * z));
} else {
tmp = 6.0 * (y * (0.6666666666666666 - z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -6.5e+17) or not (x <= 2.75e-73): tmp = x * (-3.0 + (6.0 * z)) else: tmp = 6.0 * (y * (0.6666666666666666 - z)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -6.5e+17) || !(x <= 2.75e-73)) tmp = Float64(x * Float64(-3.0 + Float64(6.0 * z))); else tmp = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -6.5e+17) || ~((x <= 2.75e-73))) tmp = x * (-3.0 + (6.0 * z)); else tmp = 6.0 * (y * (0.6666666666666666 - z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -6.5e+17], N[Not[LessEqual[x, 2.75e-73]], $MachinePrecision]], N[(x * N[(-3.0 + N[(6.0 * z), $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 -6.5 \cdot 10^{+17} \lor \neg \left(x \leq 2.75 \cdot 10^{-73}\right):\\
\;\;\;\;x \cdot \left(-3 + 6 \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\end{array}
\end{array}
if x < -6.5e17 or 2.75000000000000003e-73 < x Initial program 99.7%
+-commutative99.7%
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 0 74.4%
*-lft-identity74.4%
*-commutative74.4%
+-commutative74.4%
*-commutative74.4%
fma-define74.3%
associate-*r*74.3%
fma-define74.4%
distribute-lft-in74.4%
neg-mul-174.4%
distribute-lft-neg-in74.4%
metadata-eval74.4%
metadata-eval74.4%
distribute-rgt-in74.4%
+-commutative74.4%
sub-neg74.4%
distribute-rgt-in74.4%
sub-neg74.4%
distribute-rgt-in74.4%
metadata-eval74.4%
distribute-lft-neg-in74.4%
associate-+r+74.4%
Simplified74.4%
if -6.5e17 < x < 2.75000000000000003e-73Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 99.6%
Taylor expanded in x around 0 81.4%
Final simplification77.5%
(FPCore (x y z) :precision binary64 (if (<= z -0.6) (* z (+ (* -6.0 y) (* x 6.0))) (if (<= z 0.65) (+ (* x -3.0) (* y 4.0)) (* z (* 6.0 (- x y))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.6) {
tmp = z * ((-6.0 * y) + (x * 6.0));
} else if (z <= 0.65) {
tmp = (x * -3.0) + (y * 4.0);
} else {
tmp = z * (6.0 * (x - y));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-0.6d0)) then
tmp = z * (((-6.0d0) * y) + (x * 6.0d0))
else if (z <= 0.65d0) then
tmp = (x * (-3.0d0)) + (y * 4.0d0)
else
tmp = z * (6.0d0 * (x - y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.6) {
tmp = z * ((-6.0 * y) + (x * 6.0));
} else if (z <= 0.65) {
tmp = (x * -3.0) + (y * 4.0);
} else {
tmp = z * (6.0 * (x - y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.6: tmp = z * ((-6.0 * y) + (x * 6.0)) elif z <= 0.65: tmp = (x * -3.0) + (y * 4.0) else: tmp = z * (6.0 * (x - y)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.6) tmp = Float64(z * Float64(Float64(-6.0 * y) + Float64(x * 6.0))); elseif (z <= 0.65) tmp = Float64(Float64(x * -3.0) + Float64(y * 4.0)); else tmp = Float64(z * Float64(6.0 * Float64(x - y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.6) tmp = z * ((-6.0 * y) + (x * 6.0)); elseif (z <= 0.65) tmp = (x * -3.0) + (y * 4.0); else tmp = z * (6.0 * (x - y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.6], N[(z * N[(N[(-6.0 * y), $MachinePrecision] + N[(x * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.65], N[(N[(x * -3.0), $MachinePrecision] + N[(y * 4.0), $MachinePrecision]), $MachinePrecision], N[(z * N[(6.0 * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.6:\\
\;\;\;\;z \cdot \left(-6 \cdot y + x \cdot 6\right)\\
\mathbf{elif}\;z \leq 0.65:\\
\;\;\;\;x \cdot -3 + y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(6 \cdot \left(x - y\right)\right)\\
\end{array}
\end{array}
if z < -0.599999999999999978Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 91.9%
Taylor expanded in z around inf 99.4%
if -0.599999999999999978 < z < 0.650000000000000022Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 99.7%
Taylor expanded in z around 0 98.5%
if 0.650000000000000022 < z Initial program 99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 99.9%
+-commutative99.9%
fma-define99.9%
fma-define99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 99.5%
mul-1-neg99.5%
distribute-rgt-neg-in99.5%
metadata-eval99.5%
cancel-sign-sub-inv99.5%
distribute-lft-out--99.5%
distribute-lft-neg-in99.5%
metadata-eval99.5%
Simplified99.5%
Final simplification99.0%
(FPCore (x y z) :precision binary64 (if (<= x -4.6e+21) (* z (* x 6.0)) (if (<= x 4e+83) (* 6.0 (* y (- 0.6666666666666666 z))) (* x (* 6.0 z)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -4.6e+21) {
tmp = z * (x * 6.0);
} else if (x <= 4e+83) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else {
tmp = x * (6.0 * 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 <= (-4.6d+21)) then
tmp = z * (x * 6.0d0)
else if (x <= 4d+83) then
tmp = 6.0d0 * (y * (0.6666666666666666d0 - z))
else
tmp = x * (6.0d0 * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -4.6e+21) {
tmp = z * (x * 6.0);
} else if (x <= 4e+83) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else {
tmp = x * (6.0 * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -4.6e+21: tmp = z * (x * 6.0) elif x <= 4e+83: tmp = 6.0 * (y * (0.6666666666666666 - z)) else: tmp = x * (6.0 * z) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -4.6e+21) tmp = Float64(z * Float64(x * 6.0)); elseif (x <= 4e+83) tmp = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))); else tmp = Float64(x * Float64(6.0 * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -4.6e+21) tmp = z * (x * 6.0); elseif (x <= 4e+83) tmp = 6.0 * (y * (0.6666666666666666 - z)); else tmp = x * (6.0 * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -4.6e+21], N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4e+83], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(6.0 * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.6 \cdot 10^{+21}:\\
\;\;\;\;z \cdot \left(x \cdot 6\right)\\
\mathbf{elif}\;x \leq 4 \cdot 10^{+83}:\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(6 \cdot z\right)\\
\end{array}
\end{array}
if x < -4.6e21Initial program 99.9%
+-commutative99.9%
associate-*l*99.9%
fma-define99.9%
sub-neg99.9%
distribute-rgt-in99.9%
metadata-eval99.9%
metadata-eval99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 81.8%
*-lft-identity81.8%
*-commutative81.8%
+-commutative81.8%
*-commutative81.8%
fma-define81.8%
associate-*r*81.8%
fma-define81.8%
distribute-lft-in81.8%
neg-mul-181.8%
distribute-lft-neg-in81.8%
metadata-eval81.8%
metadata-eval81.8%
distribute-rgt-in81.8%
+-commutative81.8%
sub-neg81.8%
distribute-rgt-in81.8%
sub-neg81.8%
distribute-rgt-in81.8%
metadata-eval81.8%
distribute-lft-neg-in81.8%
associate-+r+81.8%
Simplified81.8%
Taylor expanded in z around inf 54.0%
associate-*r*54.1%
Simplified54.1%
if -4.6e21 < x < 4.00000000000000012e83Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around 0 99.6%
Taylor expanded in x around 0 73.4%
if 4.00000000000000012e83 < x Initial program 99.7%
+-commutative99.7%
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 0 76.3%
*-lft-identity76.3%
*-commutative76.3%
+-commutative76.3%
*-commutative76.3%
fma-define76.3%
associate-*r*76.3%
fma-define76.3%
distribute-lft-in76.3%
neg-mul-176.3%
distribute-lft-neg-in76.3%
metadata-eval76.3%
metadata-eval76.3%
distribute-rgt-in76.3%
+-commutative76.3%
sub-neg76.3%
distribute-rgt-in76.3%
sub-neg76.3%
distribute-rgt-in76.3%
metadata-eval76.3%
distribute-lft-neg-in76.3%
associate-+r+76.3%
Simplified76.3%
Taylor expanded in z around inf 55.9%
Final simplification65.2%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.04e-109) (not (<= x 3.7e+219))) (* x -3.0) (* y 4.0)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.04e-109) || !(x <= 3.7e+219)) {
tmp = x * -3.0;
} else {
tmp = y * 4.0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-1.04d-109)) .or. (.not. (x <= 3.7d+219))) then
tmp = x * (-3.0d0)
else
tmp = y * 4.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -1.04e-109) || !(x <= 3.7e+219)) {
tmp = x * -3.0;
} else {
tmp = y * 4.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.04e-109) or not (x <= 3.7e+219): tmp = x * -3.0 else: tmp = y * 4.0 return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.04e-109) || !(x <= 3.7e+219)) tmp = Float64(x * -3.0); else tmp = Float64(y * 4.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.04e-109) || ~((x <= 3.7e+219))) tmp = x * -3.0; else tmp = y * 4.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.04e-109], N[Not[LessEqual[x, 3.7e+219]], $MachinePrecision]], N[(x * -3.0), $MachinePrecision], N[(y * 4.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.04 \cdot 10^{-109} \lor \neg \left(x \leq 3.7 \cdot 10^{+219}\right):\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4\\
\end{array}
\end{array}
if x < -1.03999999999999996e-109 or 3.7e219 < x Initial program 99.8%
+-commutative99.8%
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 0 74.8%
*-lft-identity74.8%
*-commutative74.8%
+-commutative74.8%
*-commutative74.8%
fma-define74.8%
associate-*r*74.8%
fma-define74.8%
distribute-lft-in74.8%
neg-mul-174.8%
distribute-lft-neg-in74.8%
metadata-eval74.8%
metadata-eval74.8%
distribute-rgt-in74.8%
+-commutative74.8%
sub-neg74.8%
distribute-rgt-in74.8%
sub-neg74.8%
distribute-rgt-in74.8%
metadata-eval74.8%
distribute-lft-neg-in74.8%
associate-+r+74.8%
Simplified74.8%
Taylor expanded in z around 0 32.7%
*-commutative32.7%
Simplified32.7%
if -1.03999999999999996e-109 < x < 3.7e219Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around 0 99.6%
Taylor expanded in x around 0 68.9%
associate-*r*68.8%
*-commutative68.8%
associate-*r*68.4%
sub-neg68.4%
neg-mul-168.4%
distribute-lft-in68.4%
metadata-eval68.4%
neg-mul-168.4%
distribute-rgt-neg-in68.4%
distribute-lft-neg-in68.4%
metadata-eval68.4%
+-commutative68.4%
*-commutative68.4%
fma-define68.3%
Simplified68.3%
Taylor expanded in z around 0 37.5%
*-commutative37.5%
Simplified37.5%
Final simplification35.4%
(FPCore (x y z) :precision binary64 (+ x (* (- 0.6666666666666666 z) (* 6.0 (- y x)))))
double code(double x, double y, double z) {
return x + ((0.6666666666666666 - z) * (6.0 * (y - 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 + ((0.6666666666666666d0 - z) * (6.0d0 * (y - x)))
end function
public static double code(double x, double y, double z) {
return x + ((0.6666666666666666 - z) * (6.0 * (y - x)));
}
def code(x, y, z): return x + ((0.6666666666666666 - z) * (6.0 * (y - x)))
function code(x, y, z) return Float64(x + Float64(Float64(0.6666666666666666 - z) * Float64(6.0 * Float64(y - x)))) end
function tmp = code(x, y, z) tmp = x + ((0.6666666666666666 - z) * (6.0 * (y - x))); end
code[x_, y_, z_] := N[(x + N[(N[(0.6666666666666666 - z), $MachinePrecision] * N[(6.0 * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(0.6666666666666666 - z\right) \cdot \left(6 \cdot \left(y - x\right)\right)
\end{array}
Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Final simplification99.7%
(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.7%
+-commutative99.7%
associate-*l*99.4%
fma-define99.4%
sub-neg99.4%
distribute-rgt-in99.4%
metadata-eval99.4%
metadata-eval99.4%
distribute-lft-neg-out99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around 0 50.7%
*-lft-identity50.7%
*-commutative50.7%
+-commutative50.7%
*-commutative50.7%
fma-define50.6%
associate-*r*50.6%
fma-define50.7%
distribute-lft-in50.7%
neg-mul-150.7%
distribute-lft-neg-in50.7%
metadata-eval50.7%
metadata-eval50.7%
distribute-rgt-in50.7%
+-commutative50.7%
sub-neg50.7%
distribute-rgt-in50.6%
sub-neg50.6%
distribute-rgt-in50.6%
metadata-eval50.6%
distribute-lft-neg-in50.6%
associate-+r+50.6%
Simplified50.6%
Taylor expanded in z around 0 21.7%
*-commutative21.7%
Simplified21.7%
herbie shell --seed 2024160
(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))))