
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) z)))
double code(double x, double y, double z) {
return x + (((y - x) * 6.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) * z)
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * z);
}
def code(x, y, z): return x + (((y - x) * 6.0) * z)
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * z)) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * z); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot z
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) z)))
double code(double x, double y, double z) {
return x + (((y - x) * 6.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) * z)
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * z);
}
def code(x, y, z): return x + (((y - x) * 6.0) * z)
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * z)) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * z); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot z
\end{array}
(FPCore (x y z) :precision binary64 (fma z (* (- x y) -6.0) x))
double code(double x, double y, double z) {
return fma(z, ((x - y) * -6.0), x);
}
function code(x, y, z) return fma(z, Float64(Float64(x - y) * -6.0), x) end
code[x_, y_, z_] := N[(z * N[(N[(x - y), $MachinePrecision] * -6.0), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z, \left(x - y\right) \cdot -6, x\right)
\end{array}
Initial program 99.8%
+-commutative99.8%
*-commutative99.8%
fma-define99.8%
remove-double-neg99.8%
distribute-lft-neg-in99.8%
distribute-rgt-neg-in99.8%
sub-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
+-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* z x))) (t_1 (* 6.0 (* z y))))
(if (<= z -1.2e+214)
t_0
(if (<= z -3.8e+108)
t_1
(if (<= z -5.5e+44)
t_0
(if (<= z -1.235e-89)
t_1
(if (<= z 0.17)
x
(if (or (<= z 6e+58) (not (<= z 8.2e+148))) t_0 t_1))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (z * x);
double t_1 = 6.0 * (z * y);
double tmp;
if (z <= -1.2e+214) {
tmp = t_0;
} else if (z <= -3.8e+108) {
tmp = t_1;
} else if (z <= -5.5e+44) {
tmp = t_0;
} else if (z <= -1.235e-89) {
tmp = t_1;
} else if (z <= 0.17) {
tmp = x;
} else if ((z <= 6e+58) || !(z <= 8.2e+148)) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (-6.0d0) * (z * x)
t_1 = 6.0d0 * (z * y)
if (z <= (-1.2d+214)) then
tmp = t_0
else if (z <= (-3.8d+108)) then
tmp = t_1
else if (z <= (-5.5d+44)) then
tmp = t_0
else if (z <= (-1.235d-89)) then
tmp = t_1
else if (z <= 0.17d0) then
tmp = x
else if ((z <= 6d+58) .or. (.not. (z <= 8.2d+148))) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (z * x);
double t_1 = 6.0 * (z * y);
double tmp;
if (z <= -1.2e+214) {
tmp = t_0;
} else if (z <= -3.8e+108) {
tmp = t_1;
} else if (z <= -5.5e+44) {
tmp = t_0;
} else if (z <= -1.235e-89) {
tmp = t_1;
} else if (z <= 0.17) {
tmp = x;
} else if ((z <= 6e+58) || !(z <= 8.2e+148)) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (z * x) t_1 = 6.0 * (z * y) tmp = 0 if z <= -1.2e+214: tmp = t_0 elif z <= -3.8e+108: tmp = t_1 elif z <= -5.5e+44: tmp = t_0 elif z <= -1.235e-89: tmp = t_1 elif z <= 0.17: tmp = x elif (z <= 6e+58) or not (z <= 8.2e+148): tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(z * x)) t_1 = Float64(6.0 * Float64(z * y)) tmp = 0.0 if (z <= -1.2e+214) tmp = t_0; elseif (z <= -3.8e+108) tmp = t_1; elseif (z <= -5.5e+44) tmp = t_0; elseif (z <= -1.235e-89) tmp = t_1; elseif (z <= 0.17) tmp = x; elseif ((z <= 6e+58) || !(z <= 8.2e+148)) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (z * x); t_1 = 6.0 * (z * y); tmp = 0.0; if (z <= -1.2e+214) tmp = t_0; elseif (z <= -3.8e+108) tmp = t_1; elseif (z <= -5.5e+44) tmp = t_0; elseif (z <= -1.235e-89) tmp = t_1; elseif (z <= 0.17) tmp = x; elseif ((z <= 6e+58) || ~((z <= 8.2e+148))) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(z * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.2e+214], t$95$0, If[LessEqual[z, -3.8e+108], t$95$1, If[LessEqual[z, -5.5e+44], t$95$0, If[LessEqual[z, -1.235e-89], t$95$1, If[LessEqual[z, 0.17], x, If[Or[LessEqual[z, 6e+58], N[Not[LessEqual[z, 8.2e+148]], $MachinePrecision]], t$95$0, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(z \cdot x\right)\\
t_1 := 6 \cdot \left(z \cdot y\right)\\
\mathbf{if}\;z \leq -1.2 \cdot 10^{+214}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{+108}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{+44}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.235 \cdot 10^{-89}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 0.17:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+58} \lor \neg \left(z \leq 8.2 \cdot 10^{+148}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.2e214 or -3.80000000000000008e108 < z < -5.5000000000000001e44 or 0.170000000000000012 < z < 6.0000000000000005e58 or 8.1999999999999996e148 < z Initial program 99.7%
Taylor expanded in x around inf 72.5%
+-commutative72.5%
Simplified72.5%
Taylor expanded in z around inf 69.2%
if -1.2e214 < z < -3.80000000000000008e108 or -5.5000000000000001e44 < z < -1.235e-89 or 6.0000000000000005e58 < z < 8.1999999999999996e148Initial program 99.7%
associate-*r*99.7%
+-commutative99.7%
*-commutative99.7%
associate-*r*99.6%
fma-define99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 65.1%
*-commutative65.1%
Simplified65.1%
if -1.235e-89 < z < 0.170000000000000012Initial program 99.9%
Taylor expanded in z around 0 72.3%
Final simplification69.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* z x))) (t_1 (* 6.0 (* z y))))
(if (<= z -6.5e+213)
t_0
(if (<= z -5.5e+142)
t_1
(if (<= z -4.6e+44)
(* x (* z -6.0))
(if (<= z -1.235e-89)
t_1
(if (<= z 0.17)
x
(if (or (<= z 3.2e+56) (not (<= z 8.4e+148))) t_0 t_1))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (z * x);
double t_1 = 6.0 * (z * y);
double tmp;
if (z <= -6.5e+213) {
tmp = t_0;
} else if (z <= -5.5e+142) {
tmp = t_1;
} else if (z <= -4.6e+44) {
tmp = x * (z * -6.0);
} else if (z <= -1.235e-89) {
tmp = t_1;
} else if (z <= 0.17) {
tmp = x;
} else if ((z <= 3.2e+56) || !(z <= 8.4e+148)) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (-6.0d0) * (z * x)
t_1 = 6.0d0 * (z * y)
if (z <= (-6.5d+213)) then
tmp = t_0
else if (z <= (-5.5d+142)) then
tmp = t_1
else if (z <= (-4.6d+44)) then
tmp = x * (z * (-6.0d0))
else if (z <= (-1.235d-89)) then
tmp = t_1
else if (z <= 0.17d0) then
tmp = x
else if ((z <= 3.2d+56) .or. (.not. (z <= 8.4d+148))) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (z * x);
double t_1 = 6.0 * (z * y);
double tmp;
if (z <= -6.5e+213) {
tmp = t_0;
} else if (z <= -5.5e+142) {
tmp = t_1;
} else if (z <= -4.6e+44) {
tmp = x * (z * -6.0);
} else if (z <= -1.235e-89) {
tmp = t_1;
} else if (z <= 0.17) {
tmp = x;
} else if ((z <= 3.2e+56) || !(z <= 8.4e+148)) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (z * x) t_1 = 6.0 * (z * y) tmp = 0 if z <= -6.5e+213: tmp = t_0 elif z <= -5.5e+142: tmp = t_1 elif z <= -4.6e+44: tmp = x * (z * -6.0) elif z <= -1.235e-89: tmp = t_1 elif z <= 0.17: tmp = x elif (z <= 3.2e+56) or not (z <= 8.4e+148): tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(z * x)) t_1 = Float64(6.0 * Float64(z * y)) tmp = 0.0 if (z <= -6.5e+213) tmp = t_0; elseif (z <= -5.5e+142) tmp = t_1; elseif (z <= -4.6e+44) tmp = Float64(x * Float64(z * -6.0)); elseif (z <= -1.235e-89) tmp = t_1; elseif (z <= 0.17) tmp = x; elseif ((z <= 3.2e+56) || !(z <= 8.4e+148)) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (z * x); t_1 = 6.0 * (z * y); tmp = 0.0; if (z <= -6.5e+213) tmp = t_0; elseif (z <= -5.5e+142) tmp = t_1; elseif (z <= -4.6e+44) tmp = x * (z * -6.0); elseif (z <= -1.235e-89) tmp = t_1; elseif (z <= 0.17) tmp = x; elseif ((z <= 3.2e+56) || ~((z <= 8.4e+148))) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(z * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.5e+213], t$95$0, If[LessEqual[z, -5.5e+142], t$95$1, If[LessEqual[z, -4.6e+44], N[(x * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.235e-89], t$95$1, If[LessEqual[z, 0.17], x, If[Or[LessEqual[z, 3.2e+56], N[Not[LessEqual[z, 8.4e+148]], $MachinePrecision]], t$95$0, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(z \cdot x\right)\\
t_1 := 6 \cdot \left(z \cdot y\right)\\
\mathbf{if}\;z \leq -6.5 \cdot 10^{+213}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{+142}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -4.6 \cdot 10^{+44}:\\
\;\;\;\;x \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq -1.235 \cdot 10^{-89}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 0.17:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+56} \lor \neg \left(z \leq 8.4 \cdot 10^{+148}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.49999999999999982e213 or 0.170000000000000012 < z < 3.20000000000000003e56 or 8.39999999999999996e148 < z Initial program 99.7%
Taylor expanded in x around inf 72.2%
+-commutative72.2%
Simplified72.2%
Taylor expanded in z around inf 68.4%
if -6.49999999999999982e213 < z < -5.50000000000000035e142 or -4.60000000000000009e44 < z < -1.235e-89 or 3.20000000000000003e56 < z < 8.39999999999999996e148Initial program 99.7%
associate-*r*99.7%
+-commutative99.7%
*-commutative99.7%
associate-*r*99.6%
fma-define99.5%
Applied egg-rr99.5%
Taylor expanded in y around inf 65.9%
*-commutative65.9%
Simplified65.9%
if -5.50000000000000035e142 < z < -4.60000000000000009e44Initial program 99.4%
Taylor expanded in x around inf 67.8%
+-commutative67.8%
Simplified67.8%
Taylor expanded in z around inf 67.7%
*-commutative67.7%
associate-*r*67.8%
*-commutative67.8%
Simplified67.8%
if -1.235e-89 < z < 0.170000000000000012Initial program 99.9%
Taylor expanded in z around 0 72.3%
Final simplification69.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* z x))) (t_1 (* 6.0 (* z y))))
(if (<= z -3.4e+214)
t_0
(if (<= z -9.4e+142)
t_1
(if (<= z -1.2e+45)
(* x (* z -6.0))
(if (<= z -1.235e-89)
(* y (* z 6.0))
(if (<= z 0.17)
x
(if (or (<= z 8.5e+57) (not (<= z 2.9e+149))) t_0 t_1))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (z * x);
double t_1 = 6.0 * (z * y);
double tmp;
if (z <= -3.4e+214) {
tmp = t_0;
} else if (z <= -9.4e+142) {
tmp = t_1;
} else if (z <= -1.2e+45) {
tmp = x * (z * -6.0);
} else if (z <= -1.235e-89) {
tmp = y * (z * 6.0);
} else if (z <= 0.17) {
tmp = x;
} else if ((z <= 8.5e+57) || !(z <= 2.9e+149)) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (-6.0d0) * (z * x)
t_1 = 6.0d0 * (z * y)
if (z <= (-3.4d+214)) then
tmp = t_0
else if (z <= (-9.4d+142)) then
tmp = t_1
else if (z <= (-1.2d+45)) then
tmp = x * (z * (-6.0d0))
else if (z <= (-1.235d-89)) then
tmp = y * (z * 6.0d0)
else if (z <= 0.17d0) then
tmp = x
else if ((z <= 8.5d+57) .or. (.not. (z <= 2.9d+149))) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (z * x);
double t_1 = 6.0 * (z * y);
double tmp;
if (z <= -3.4e+214) {
tmp = t_0;
} else if (z <= -9.4e+142) {
tmp = t_1;
} else if (z <= -1.2e+45) {
tmp = x * (z * -6.0);
} else if (z <= -1.235e-89) {
tmp = y * (z * 6.0);
} else if (z <= 0.17) {
tmp = x;
} else if ((z <= 8.5e+57) || !(z <= 2.9e+149)) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (z * x) t_1 = 6.0 * (z * y) tmp = 0 if z <= -3.4e+214: tmp = t_0 elif z <= -9.4e+142: tmp = t_1 elif z <= -1.2e+45: tmp = x * (z * -6.0) elif z <= -1.235e-89: tmp = y * (z * 6.0) elif z <= 0.17: tmp = x elif (z <= 8.5e+57) or not (z <= 2.9e+149): tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(z * x)) t_1 = Float64(6.0 * Float64(z * y)) tmp = 0.0 if (z <= -3.4e+214) tmp = t_0; elseif (z <= -9.4e+142) tmp = t_1; elseif (z <= -1.2e+45) tmp = Float64(x * Float64(z * -6.0)); elseif (z <= -1.235e-89) tmp = Float64(y * Float64(z * 6.0)); elseif (z <= 0.17) tmp = x; elseif ((z <= 8.5e+57) || !(z <= 2.9e+149)) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (z * x); t_1 = 6.0 * (z * y); tmp = 0.0; if (z <= -3.4e+214) tmp = t_0; elseif (z <= -9.4e+142) tmp = t_1; elseif (z <= -1.2e+45) tmp = x * (z * -6.0); elseif (z <= -1.235e-89) tmp = y * (z * 6.0); elseif (z <= 0.17) tmp = x; elseif ((z <= 8.5e+57) || ~((z <= 2.9e+149))) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(z * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.4e+214], t$95$0, If[LessEqual[z, -9.4e+142], t$95$1, If[LessEqual[z, -1.2e+45], N[(x * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.235e-89], N[(y * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.17], x, If[Or[LessEqual[z, 8.5e+57], N[Not[LessEqual[z, 2.9e+149]], $MachinePrecision]], t$95$0, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(z \cdot x\right)\\
t_1 := 6 \cdot \left(z \cdot y\right)\\
\mathbf{if}\;z \leq -3.4 \cdot 10^{+214}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -9.4 \cdot 10^{+142}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.2 \cdot 10^{+45}:\\
\;\;\;\;x \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq -1.235 \cdot 10^{-89}:\\
\;\;\;\;y \cdot \left(z \cdot 6\right)\\
\mathbf{elif}\;z \leq 0.17:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+57} \lor \neg \left(z \leq 2.9 \cdot 10^{+149}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.3999999999999998e214 or 0.170000000000000012 < z < 8.5000000000000001e57 or 2.9000000000000002e149 < z Initial program 99.7%
Taylor expanded in x around inf 72.2%
+-commutative72.2%
Simplified72.2%
Taylor expanded in z around inf 68.4%
if -3.3999999999999998e214 < z < -9.4e142 or 8.5000000000000001e57 < z < 2.9000000000000002e149Initial program 99.6%
associate-*r*99.7%
+-commutative99.7%
*-commutative99.7%
associate-*r*99.7%
fma-define99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 69.1%
*-commutative69.1%
Simplified69.1%
if -9.4e142 < z < -1.19999999999999995e45Initial program 99.4%
Taylor expanded in x around inf 67.8%
+-commutative67.8%
Simplified67.8%
Taylor expanded in z around inf 67.7%
*-commutative67.7%
associate-*r*67.8%
*-commutative67.8%
Simplified67.8%
if -1.19999999999999995e45 < z < -1.235e-89Initial program 99.8%
associate-*r*99.7%
+-commutative99.7%
*-commutative99.7%
associate-*r*99.4%
fma-define99.4%
Applied egg-rr99.4%
Taylor expanded in y around inf 81.8%
*-commutative81.8%
Simplified81.8%
Taylor expanded in z around inf 60.7%
associate-*r*61.1%
*-commutative61.1%
associate-*r*61.0%
Simplified61.0%
if -1.235e-89 < z < 0.170000000000000012Initial program 99.9%
Taylor expanded in z around 0 72.3%
Final simplification69.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* z x))) (t_1 (* 6.0 (* z y))))
(if (<= z -1.75e+216)
t_0
(if (<= z -5.2e+143)
t_1
(if (<= z -5.5e+44)
(* x (* z -6.0))
(if (<= z -1.235e-89)
(* z (* y 6.0))
(if (<= z 0.17)
x
(if (or (<= z 2.15e+55) (not (<= z 7e+149))) t_0 t_1))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (z * x);
double t_1 = 6.0 * (z * y);
double tmp;
if (z <= -1.75e+216) {
tmp = t_0;
} else if (z <= -5.2e+143) {
tmp = t_1;
} else if (z <= -5.5e+44) {
tmp = x * (z * -6.0);
} else if (z <= -1.235e-89) {
tmp = z * (y * 6.0);
} else if (z <= 0.17) {
tmp = x;
} else if ((z <= 2.15e+55) || !(z <= 7e+149)) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (-6.0d0) * (z * x)
t_1 = 6.0d0 * (z * y)
if (z <= (-1.75d+216)) then
tmp = t_0
else if (z <= (-5.2d+143)) then
tmp = t_1
else if (z <= (-5.5d+44)) then
tmp = x * (z * (-6.0d0))
else if (z <= (-1.235d-89)) then
tmp = z * (y * 6.0d0)
else if (z <= 0.17d0) then
tmp = x
else if ((z <= 2.15d+55) .or. (.not. (z <= 7d+149))) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (z * x);
double t_1 = 6.0 * (z * y);
double tmp;
if (z <= -1.75e+216) {
tmp = t_0;
} else if (z <= -5.2e+143) {
tmp = t_1;
} else if (z <= -5.5e+44) {
tmp = x * (z * -6.0);
} else if (z <= -1.235e-89) {
tmp = z * (y * 6.0);
} else if (z <= 0.17) {
tmp = x;
} else if ((z <= 2.15e+55) || !(z <= 7e+149)) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (z * x) t_1 = 6.0 * (z * y) tmp = 0 if z <= -1.75e+216: tmp = t_0 elif z <= -5.2e+143: tmp = t_1 elif z <= -5.5e+44: tmp = x * (z * -6.0) elif z <= -1.235e-89: tmp = z * (y * 6.0) elif z <= 0.17: tmp = x elif (z <= 2.15e+55) or not (z <= 7e+149): tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(z * x)) t_1 = Float64(6.0 * Float64(z * y)) tmp = 0.0 if (z <= -1.75e+216) tmp = t_0; elseif (z <= -5.2e+143) tmp = t_1; elseif (z <= -5.5e+44) tmp = Float64(x * Float64(z * -6.0)); elseif (z <= -1.235e-89) tmp = Float64(z * Float64(y * 6.0)); elseif (z <= 0.17) tmp = x; elseif ((z <= 2.15e+55) || !(z <= 7e+149)) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (z * x); t_1 = 6.0 * (z * y); tmp = 0.0; if (z <= -1.75e+216) tmp = t_0; elseif (z <= -5.2e+143) tmp = t_1; elseif (z <= -5.5e+44) tmp = x * (z * -6.0); elseif (z <= -1.235e-89) tmp = z * (y * 6.0); elseif (z <= 0.17) tmp = x; elseif ((z <= 2.15e+55) || ~((z <= 7e+149))) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(z * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.75e+216], t$95$0, If[LessEqual[z, -5.2e+143], t$95$1, If[LessEqual[z, -5.5e+44], N[(x * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.235e-89], N[(z * N[(y * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.17], x, If[Or[LessEqual[z, 2.15e+55], N[Not[LessEqual[z, 7e+149]], $MachinePrecision]], t$95$0, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(z \cdot x\right)\\
t_1 := 6 \cdot \left(z \cdot y\right)\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{+216}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -5.2 \cdot 10^{+143}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{+44}:\\
\;\;\;\;x \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq -1.235 \cdot 10^{-89}:\\
\;\;\;\;z \cdot \left(y \cdot 6\right)\\
\mathbf{elif}\;z \leq 0.17:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{+55} \lor \neg \left(z \leq 7 \cdot 10^{+149}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.74999999999999996e216 or 0.170000000000000012 < z < 2.1499999999999999e55 or 7.00000000000000023e149 < z Initial program 99.7%
Taylor expanded in x around inf 72.2%
+-commutative72.2%
Simplified72.2%
Taylor expanded in z around inf 68.4%
if -1.74999999999999996e216 < z < -5.1999999999999998e143 or 2.1499999999999999e55 < z < 7.00000000000000023e149Initial program 99.6%
associate-*r*99.7%
+-commutative99.7%
*-commutative99.7%
associate-*r*99.7%
fma-define99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 69.1%
*-commutative69.1%
Simplified69.1%
if -5.1999999999999998e143 < z < -5.5000000000000001e44Initial program 99.4%
Taylor expanded in x around inf 67.8%
+-commutative67.8%
Simplified67.8%
Taylor expanded in z around inf 67.7%
*-commutative67.7%
associate-*r*67.8%
*-commutative67.8%
Simplified67.8%
if -5.5000000000000001e44 < z < -1.235e-89Initial program 99.8%
associate-*r*99.7%
+-commutative99.7%
*-commutative99.7%
associate-*r*99.4%
fma-define99.4%
Applied egg-rr99.4%
Taylor expanded in y around inf 60.7%
associate-*r*61.1%
*-commutative61.1%
Simplified61.1%
if -1.235e-89 < z < 0.170000000000000012Initial program 99.9%
Taylor expanded in z around 0 72.3%
Final simplification69.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* z y))))
(if (<= z -5e+214)
(* z (* x -6.0))
(if (<= z -3.6e+141)
t_0
(if (<= z -1e+45)
(* x (* z -6.0))
(if (<= z -1.235e-89)
(* z (* y 6.0))
(if (<= z 0.17)
x
(if (or (<= z 1.8e+59) (not (<= z 1.1e+150)))
(* -6.0 (* z x))
t_0))))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (z * y);
double tmp;
if (z <= -5e+214) {
tmp = z * (x * -6.0);
} else if (z <= -3.6e+141) {
tmp = t_0;
} else if (z <= -1e+45) {
tmp = x * (z * -6.0);
} else if (z <= -1.235e-89) {
tmp = z * (y * 6.0);
} else if (z <= 0.17) {
tmp = x;
} else if ((z <= 1.8e+59) || !(z <= 1.1e+150)) {
tmp = -6.0 * (z * x);
} 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 * (z * y)
if (z <= (-5d+214)) then
tmp = z * (x * (-6.0d0))
else if (z <= (-3.6d+141)) then
tmp = t_0
else if (z <= (-1d+45)) then
tmp = x * (z * (-6.0d0))
else if (z <= (-1.235d-89)) then
tmp = z * (y * 6.0d0)
else if (z <= 0.17d0) then
tmp = x
else if ((z <= 1.8d+59) .or. (.not. (z <= 1.1d+150))) then
tmp = (-6.0d0) * (z * x)
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 * (z * y);
double tmp;
if (z <= -5e+214) {
tmp = z * (x * -6.0);
} else if (z <= -3.6e+141) {
tmp = t_0;
} else if (z <= -1e+45) {
tmp = x * (z * -6.0);
} else if (z <= -1.235e-89) {
tmp = z * (y * 6.0);
} else if (z <= 0.17) {
tmp = x;
} else if ((z <= 1.8e+59) || !(z <= 1.1e+150)) {
tmp = -6.0 * (z * x);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (z * y) tmp = 0 if z <= -5e+214: tmp = z * (x * -6.0) elif z <= -3.6e+141: tmp = t_0 elif z <= -1e+45: tmp = x * (z * -6.0) elif z <= -1.235e-89: tmp = z * (y * 6.0) elif z <= 0.17: tmp = x elif (z <= 1.8e+59) or not (z <= 1.1e+150): tmp = -6.0 * (z * x) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(z * y)) tmp = 0.0 if (z <= -5e+214) tmp = Float64(z * Float64(x * -6.0)); elseif (z <= -3.6e+141) tmp = t_0; elseif (z <= -1e+45) tmp = Float64(x * Float64(z * -6.0)); elseif (z <= -1.235e-89) tmp = Float64(z * Float64(y * 6.0)); elseif (z <= 0.17) tmp = x; elseif ((z <= 1.8e+59) || !(z <= 1.1e+150)) tmp = Float64(-6.0 * Float64(z * x)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (z * y); tmp = 0.0; if (z <= -5e+214) tmp = z * (x * -6.0); elseif (z <= -3.6e+141) tmp = t_0; elseif (z <= -1e+45) tmp = x * (z * -6.0); elseif (z <= -1.235e-89) tmp = z * (y * 6.0); elseif (z <= 0.17) tmp = x; elseif ((z <= 1.8e+59) || ~((z <= 1.1e+150))) tmp = -6.0 * (z * x); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5e+214], N[(z * N[(x * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.6e+141], t$95$0, If[LessEqual[z, -1e+45], N[(x * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.235e-89], N[(z * N[(y * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.17], x, If[Or[LessEqual[z, 1.8e+59], N[Not[LessEqual[z, 1.1e+150]], $MachinePrecision]], N[(-6.0 * N[(z * x), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(z \cdot y\right)\\
\mathbf{if}\;z \leq -5 \cdot 10^{+214}:\\
\;\;\;\;z \cdot \left(x \cdot -6\right)\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{+141}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1 \cdot 10^{+45}:\\
\;\;\;\;x \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq -1.235 \cdot 10^{-89}:\\
\;\;\;\;z \cdot \left(y \cdot 6\right)\\
\mathbf{elif}\;z \leq 0.17:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{+59} \lor \neg \left(z \leq 1.1 \cdot 10^{+150}\right):\\
\;\;\;\;-6 \cdot \left(z \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -4.99999999999999953e214Initial program 100.0%
Taylor expanded in x around inf 80.2%
+-commutative80.2%
Simplified80.2%
Taylor expanded in z around inf 80.2%
associate-*r*80.3%
*-commutative80.3%
Simplified80.3%
if -4.99999999999999953e214 < z < -3.6000000000000001e141 or 1.7999999999999999e59 < z < 1.1e150Initial program 99.6%
associate-*r*99.7%
+-commutative99.7%
*-commutative99.7%
associate-*r*99.7%
fma-define99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 69.1%
*-commutative69.1%
Simplified69.1%
if -3.6000000000000001e141 < z < -9.9999999999999993e44Initial program 99.4%
Taylor expanded in x around inf 67.8%
+-commutative67.8%
Simplified67.8%
Taylor expanded in z around inf 67.7%
*-commutative67.7%
associate-*r*67.8%
*-commutative67.8%
Simplified67.8%
if -9.9999999999999993e44 < z < -1.235e-89Initial program 99.8%
associate-*r*99.7%
+-commutative99.7%
*-commutative99.7%
associate-*r*99.4%
fma-define99.4%
Applied egg-rr99.4%
Taylor expanded in y around inf 60.7%
associate-*r*61.1%
*-commutative61.1%
Simplified61.1%
if -1.235e-89 < z < 0.170000000000000012Initial program 99.9%
Taylor expanded in z around 0 72.3%
if 0.170000000000000012 < z < 1.7999999999999999e59 or 1.1e150 < z Initial program 99.6%
Taylor expanded in x around inf 68.2%
+-commutative68.2%
Simplified68.2%
Taylor expanded in z around inf 62.4%
Final simplification69.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (* z x) z)))
(if (<= x -1.2e+176)
t_0
(if (<= x -4.1e+111)
(* -6.0 (* z x))
(if (or (<= x -1.05e-14) (not (<= x 3.25e-18))) t_0 (* z (* y 6.0)))))))
double code(double x, double y, double z) {
double t_0 = (z * x) / z;
double tmp;
if (x <= -1.2e+176) {
tmp = t_0;
} else if (x <= -4.1e+111) {
tmp = -6.0 * (z * x);
} else if ((x <= -1.05e-14) || !(x <= 3.25e-18)) {
tmp = t_0;
} else {
tmp = z * (y * 6.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (z * x) / z
if (x <= (-1.2d+176)) then
tmp = t_0
else if (x <= (-4.1d+111)) then
tmp = (-6.0d0) * (z * x)
else if ((x <= (-1.05d-14)) .or. (.not. (x <= 3.25d-18))) then
tmp = t_0
else
tmp = z * (y * 6.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (z * x) / z;
double tmp;
if (x <= -1.2e+176) {
tmp = t_0;
} else if (x <= -4.1e+111) {
tmp = -6.0 * (z * x);
} else if ((x <= -1.05e-14) || !(x <= 3.25e-18)) {
tmp = t_0;
} else {
tmp = z * (y * 6.0);
}
return tmp;
}
def code(x, y, z): t_0 = (z * x) / z tmp = 0 if x <= -1.2e+176: tmp = t_0 elif x <= -4.1e+111: tmp = -6.0 * (z * x) elif (x <= -1.05e-14) or not (x <= 3.25e-18): tmp = t_0 else: tmp = z * (y * 6.0) return tmp
function code(x, y, z) t_0 = Float64(Float64(z * x) / z) tmp = 0.0 if (x <= -1.2e+176) tmp = t_0; elseif (x <= -4.1e+111) tmp = Float64(-6.0 * Float64(z * x)); elseif ((x <= -1.05e-14) || !(x <= 3.25e-18)) tmp = t_0; else tmp = Float64(z * Float64(y * 6.0)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (z * x) / z; tmp = 0.0; if (x <= -1.2e+176) tmp = t_0; elseif (x <= -4.1e+111) tmp = -6.0 * (z * x); elseif ((x <= -1.05e-14) || ~((x <= 3.25e-18))) tmp = t_0; else tmp = z * (y * 6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(z * x), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[x, -1.2e+176], t$95$0, If[LessEqual[x, -4.1e+111], N[(-6.0 * N[(z * x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -1.05e-14], N[Not[LessEqual[x, 3.25e-18]], $MachinePrecision]], t$95$0, N[(z * N[(y * 6.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{z \cdot x}{z}\\
\mathbf{if}\;x \leq -1.2 \cdot 10^{+176}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -4.1 \cdot 10^{+111}:\\
\;\;\;\;-6 \cdot \left(z \cdot x\right)\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{-14} \lor \neg \left(x \leq 3.25 \cdot 10^{-18}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y \cdot 6\right)\\
\end{array}
\end{array}
if x < -1.2000000000000001e176 or -4.09999999999999986e111 < x < -1.0499999999999999e-14 or 3.25000000000000004e-18 < x Initial program 99.8%
Taylor expanded in z around inf 79.8%
Taylor expanded in z around 0 29.7%
associate-*r/64.2%
Applied egg-rr64.2%
if -1.2000000000000001e176 < x < -4.09999999999999986e111Initial program 99.8%
Taylor expanded in x around inf 81.2%
+-commutative81.2%
Simplified81.2%
Taylor expanded in z around inf 50.8%
if -1.0499999999999999e-14 < x < 3.25000000000000004e-18Initial program 99.7%
associate-*r*99.7%
+-commutative99.7%
*-commutative99.7%
associate-*r*99.7%
fma-define99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 68.8%
associate-*r*68.8%
*-commutative68.8%
Simplified68.8%
Final simplification65.3%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.235e-89) (not (<= z 6.4e-6))) (* -6.0 (* z (- x y))) x))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.235e-89) || !(z <= 6.4e-6)) {
tmp = -6.0 * (z * (x - y));
} else {
tmp = x;
}
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 <= (-1.235d-89)) .or. (.not. (z <= 6.4d-6))) then
tmp = (-6.0d0) * (z * (x - y))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.235e-89) || !(z <= 6.4e-6)) {
tmp = -6.0 * (z * (x - y));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.235e-89) or not (z <= 6.4e-6): tmp = -6.0 * (z * (x - y)) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.235e-89) || !(z <= 6.4e-6)) tmp = Float64(-6.0 * Float64(z * Float64(x - y))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.235e-89) || ~((z <= 6.4e-6))) tmp = -6.0 * (z * (x - y)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.235e-89], N[Not[LessEqual[z, 6.4e-6]], $MachinePrecision]], N[(-6.0 * N[(z * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.235 \cdot 10^{-89} \lor \neg \left(z \leq 6.4 \cdot 10^{-6}\right):\\
\;\;\;\;-6 \cdot \left(z \cdot \left(x - y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.235e-89 or 6.3999999999999997e-6 < z Initial program 99.7%
+-commutative99.7%
*-commutative99.7%
fma-define99.7%
remove-double-neg99.7%
distribute-lft-neg-in99.7%
distribute-rgt-neg-in99.7%
sub-neg99.7%
distribute-neg-in99.7%
remove-double-neg99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 92.8%
if -1.235e-89 < z < 6.3999999999999997e-6Initial program 99.9%
Taylor expanded in z around 0 73.2%
Final simplification84.2%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.235e-89) (not (<= z 12000000000000.0))) (* -6.0 (* z (- x y))) (* x (+ (* z -6.0) 1.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.235e-89) || !(z <= 12000000000000.0)) {
tmp = -6.0 * (z * (x - y));
} else {
tmp = x * ((z * -6.0) + 1.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 <= (-1.235d-89)) .or. (.not. (z <= 12000000000000.0d0))) then
tmp = (-6.0d0) * (z * (x - y))
else
tmp = x * ((z * (-6.0d0)) + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.235e-89) || !(z <= 12000000000000.0)) {
tmp = -6.0 * (z * (x - y));
} else {
tmp = x * ((z * -6.0) + 1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.235e-89) or not (z <= 12000000000000.0): tmp = -6.0 * (z * (x - y)) else: tmp = x * ((z * -6.0) + 1.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.235e-89) || !(z <= 12000000000000.0)) tmp = Float64(-6.0 * Float64(z * Float64(x - y))); else tmp = Float64(x * Float64(Float64(z * -6.0) + 1.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.235e-89) || ~((z <= 12000000000000.0))) tmp = -6.0 * (z * (x - y)); else tmp = x * ((z * -6.0) + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.235e-89], N[Not[LessEqual[z, 12000000000000.0]], $MachinePrecision]], N[(-6.0 * N[(z * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(z * -6.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.235 \cdot 10^{-89} \lor \neg \left(z \leq 12000000000000\right):\\
\;\;\;\;-6 \cdot \left(z \cdot \left(x - y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot -6 + 1\right)\\
\end{array}
\end{array}
if z < -1.235e-89 or 1.2e13 < z Initial program 99.7%
+-commutative99.7%
*-commutative99.7%
fma-define99.7%
remove-double-neg99.7%
distribute-lft-neg-in99.7%
distribute-rgt-neg-in99.7%
sub-neg99.7%
distribute-neg-in99.7%
remove-double-neg99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 94.9%
if -1.235e-89 < z < 1.2e13Initial program 99.9%
Taylor expanded in x around inf 75.5%
+-commutative75.5%
Simplified75.5%
Final simplification85.7%
(FPCore (x y z)
:precision binary64
(if (<= z -1.235e-89)
(* (- y x) (* z 6.0))
(if (<= z 12000000000000.0)
(* x (+ (* z -6.0) 1.0))
(* -6.0 (* z (- x y))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.235e-89) {
tmp = (y - x) * (z * 6.0);
} else if (z <= 12000000000000.0) {
tmp = x * ((z * -6.0) + 1.0);
} else {
tmp = -6.0 * (z * (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 <= (-1.235d-89)) then
tmp = (y - x) * (z * 6.0d0)
else if (z <= 12000000000000.0d0) then
tmp = x * ((z * (-6.0d0)) + 1.0d0)
else
tmp = (-6.0d0) * (z * (x - y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.235e-89) {
tmp = (y - x) * (z * 6.0);
} else if (z <= 12000000000000.0) {
tmp = x * ((z * -6.0) + 1.0);
} else {
tmp = -6.0 * (z * (x - y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.235e-89: tmp = (y - x) * (z * 6.0) elif z <= 12000000000000.0: tmp = x * ((z * -6.0) + 1.0) else: tmp = -6.0 * (z * (x - y)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.235e-89) tmp = Float64(Float64(y - x) * Float64(z * 6.0)); elseif (z <= 12000000000000.0) tmp = Float64(x * Float64(Float64(z * -6.0) + 1.0)); else tmp = Float64(-6.0 * Float64(z * Float64(x - y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.235e-89) tmp = (y - x) * (z * 6.0); elseif (z <= 12000000000000.0) tmp = x * ((z * -6.0) + 1.0); else tmp = -6.0 * (z * (x - y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.235e-89], N[(N[(y - x), $MachinePrecision] * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 12000000000000.0], N[(x * N[(N[(z * -6.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(-6.0 * N[(z * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.235 \cdot 10^{-89}:\\
\;\;\;\;\left(y - x\right) \cdot \left(z \cdot 6\right)\\
\mathbf{elif}\;z \leq 12000000000000:\\
\;\;\;\;x \cdot \left(z \cdot -6 + 1\right)\\
\mathbf{else}:\\
\;\;\;\;-6 \cdot \left(z \cdot \left(x - y\right)\right)\\
\end{array}
\end{array}
if z < -1.235e-89Initial program 99.8%
associate-*r*99.8%
+-commutative99.8%
*-commutative99.8%
associate-*r*99.7%
fma-define99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 90.9%
associate-*r*91.0%
*-commutative91.0%
*-commutative91.0%
Simplified91.0%
if -1.235e-89 < z < 1.2e13Initial program 99.9%
Taylor expanded in x around inf 75.5%
+-commutative75.5%
Simplified75.5%
if 1.2e13 < z Initial program 99.6%
+-commutative99.6%
*-commutative99.6%
fma-define99.6%
remove-double-neg99.6%
distribute-lft-neg-in99.6%
distribute-rgt-neg-in99.6%
sub-neg99.6%
distribute-neg-in99.6%
remove-double-neg99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around inf 99.7%
Final simplification85.8%
(FPCore (x y z) :precision binary64 (if (<= z -0.165) (* (- y x) (* z 6.0)) (if (<= z 0.17) (+ x (* y (* z 6.0))) (* -6.0 (* z (- x y))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.165) {
tmp = (y - x) * (z * 6.0);
} else if (z <= 0.17) {
tmp = x + (y * (z * 6.0));
} else {
tmp = -6.0 * (z * (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.165d0)) then
tmp = (y - x) * (z * 6.0d0)
else if (z <= 0.17d0) then
tmp = x + (y * (z * 6.0d0))
else
tmp = (-6.0d0) * (z * (x - y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.165) {
tmp = (y - x) * (z * 6.0);
} else if (z <= 0.17) {
tmp = x + (y * (z * 6.0));
} else {
tmp = -6.0 * (z * (x - y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.165: tmp = (y - x) * (z * 6.0) elif z <= 0.17: tmp = x + (y * (z * 6.0)) else: tmp = -6.0 * (z * (x - y)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.165) tmp = Float64(Float64(y - x) * Float64(z * 6.0)); elseif (z <= 0.17) tmp = Float64(x + Float64(y * Float64(z * 6.0))); else tmp = Float64(-6.0 * Float64(z * Float64(x - y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.165) tmp = (y - x) * (z * 6.0); elseif (z <= 0.17) tmp = x + (y * (z * 6.0)); else tmp = -6.0 * (z * (x - y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.165], N[(N[(y - x), $MachinePrecision] * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.17], N[(x + N[(y * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-6.0 * N[(z * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.165:\\
\;\;\;\;\left(y - x\right) \cdot \left(z \cdot 6\right)\\
\mathbf{elif}\;z \leq 0.17:\\
\;\;\;\;x + y \cdot \left(z \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;-6 \cdot \left(z \cdot \left(x - y\right)\right)\\
\end{array}
\end{array}
if z < -0.165000000000000008Initial program 99.7%
associate-*r*99.8%
+-commutative99.8%
*-commutative99.8%
associate-*r*99.8%
fma-define99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 96.5%
associate-*r*96.6%
*-commutative96.6%
*-commutative96.6%
Simplified96.6%
if -0.165000000000000008 < z < 0.170000000000000012Initial program 99.9%
Taylor expanded in y around inf 98.1%
*-commutative98.1%
associate-*r*98.1%
Simplified98.1%
if 0.170000000000000012 < z Initial program 99.6%
+-commutative99.6%
*-commutative99.6%
fma-define99.6%
remove-double-neg99.6%
distribute-lft-neg-in99.6%
distribute-rgt-neg-in99.6%
sub-neg99.6%
distribute-neg-in99.6%
remove-double-neg99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around inf 96.2%
Final simplification97.3%
(FPCore (x y z) :precision binary64 (if (<= z -0.14) (* (- y x) (* z 6.0)) (if (<= z 0.17) (+ x (* z (* y 6.0))) (* -6.0 (* z (- x y))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.14) {
tmp = (y - x) * (z * 6.0);
} else if (z <= 0.17) {
tmp = x + (z * (y * 6.0));
} else {
tmp = -6.0 * (z * (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.14d0)) then
tmp = (y - x) * (z * 6.0d0)
else if (z <= 0.17d0) then
tmp = x + (z * (y * 6.0d0))
else
tmp = (-6.0d0) * (z * (x - y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.14) {
tmp = (y - x) * (z * 6.0);
} else if (z <= 0.17) {
tmp = x + (z * (y * 6.0));
} else {
tmp = -6.0 * (z * (x - y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.14: tmp = (y - x) * (z * 6.0) elif z <= 0.17: tmp = x + (z * (y * 6.0)) else: tmp = -6.0 * (z * (x - y)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.14) tmp = Float64(Float64(y - x) * Float64(z * 6.0)); elseif (z <= 0.17) tmp = Float64(x + Float64(z * Float64(y * 6.0))); else tmp = Float64(-6.0 * Float64(z * Float64(x - y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.14) tmp = (y - x) * (z * 6.0); elseif (z <= 0.17) tmp = x + (z * (y * 6.0)); else tmp = -6.0 * (z * (x - y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.14], N[(N[(y - x), $MachinePrecision] * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.17], N[(x + N[(z * N[(y * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-6.0 * N[(z * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.14:\\
\;\;\;\;\left(y - x\right) \cdot \left(z \cdot 6\right)\\
\mathbf{elif}\;z \leq 0.17:\\
\;\;\;\;x + z \cdot \left(y \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;-6 \cdot \left(z \cdot \left(x - y\right)\right)\\
\end{array}
\end{array}
if z < -0.14000000000000001Initial program 99.7%
associate-*r*99.8%
+-commutative99.8%
*-commutative99.8%
associate-*r*99.8%
fma-define99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 96.5%
associate-*r*96.6%
*-commutative96.6%
*-commutative96.6%
Simplified96.6%
if -0.14000000000000001 < z < 0.170000000000000012Initial program 99.9%
Taylor expanded in y around inf 98.2%
if 0.170000000000000012 < z Initial program 99.6%
+-commutative99.6%
*-commutative99.6%
fma-define99.6%
remove-double-neg99.6%
distribute-lft-neg-in99.6%
distribute-rgt-neg-in99.6%
sub-neg99.6%
distribute-neg-in99.6%
remove-double-neg99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around inf 96.2%
Final simplification97.3%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.0025) (not (<= z 0.17))) (* -6.0 (* z x)) x))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.0025) || !(z <= 0.17)) {
tmp = -6.0 * (z * x);
} else {
tmp = x;
}
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.0025d0)) .or. (.not. (z <= 0.17d0))) then
tmp = (-6.0d0) * (z * x)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.0025) || !(z <= 0.17)) {
tmp = -6.0 * (z * x);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.0025) or not (z <= 0.17): tmp = -6.0 * (z * x) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.0025) || !(z <= 0.17)) tmp = Float64(-6.0 * Float64(z * x)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.0025) || ~((z <= 0.17))) tmp = -6.0 * (z * x); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.0025], N[Not[LessEqual[z, 0.17]], $MachinePrecision]], N[(-6.0 * N[(z * x), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.0025 \lor \neg \left(z \leq 0.17\right):\\
\;\;\;\;-6 \cdot \left(z \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -0.00250000000000000005 or 0.170000000000000012 < z Initial program 99.7%
Taylor expanded in x around inf 58.7%
+-commutative58.7%
Simplified58.7%
Taylor expanded in z around inf 55.3%
if -0.00250000000000000005 < z < 0.170000000000000012Initial program 99.9%
Taylor expanded in z around 0 68.0%
Final simplification61.7%
(FPCore (x y z) :precision binary64 (+ x (* z (* (- y x) 6.0))))
double code(double x, double y, double z) {
return x + (z * ((y - x) * 6.0));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (z * ((y - x) * 6.0d0))
end function
public static double code(double x, double y, double z) {
return x + (z * ((y - x) * 6.0));
}
def code(x, y, z): return x + (z * ((y - x) * 6.0))
function code(x, y, z) return Float64(x + Float64(z * Float64(Float64(y - x) * 6.0))) end
function tmp = code(x, y, z) tmp = x + (z * ((y - x) * 6.0)); end
code[x_, y_, z_] := N[(x + N[(z * N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + z \cdot \left(\left(y - x\right) \cdot 6\right)
\end{array}
Initial program 99.8%
Final simplification99.8%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.8%
Taylor expanded in z around 0 36.1%
Final simplification36.1%
(FPCore (x y z) :precision binary64 (- x (* (* 6.0 z) (- x y))))
double code(double x, double y, double z) {
return x - ((6.0 * z) * (x - y));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x - ((6.0d0 * z) * (x - y))
end function
public static double code(double x, double y, double z) {
return x - ((6.0 * z) * (x - y));
}
def code(x, y, z): return x - ((6.0 * z) * (x - y))
function code(x, y, z) return Float64(x - Float64(Float64(6.0 * z) * Float64(x - y))) end
function tmp = code(x, y, z) tmp = x - ((6.0 * z) * (x - y)); end
code[x_, y_, z_] := N[(x - N[(N[(6.0 * z), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \left(6 \cdot z\right) \cdot \left(x - y\right)
\end{array}
herbie shell --seed 2024059
(FPCore (x y z)
:name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, E"
:precision binary64
:alt
(- x (* (* 6.0 z) (- x y)))
(+ x (* (* (- y x) 6.0) z)))