
(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 11 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 (+ 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(y - x) * Float64(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[(y - x), $MachinePrecision] * N[(6.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - x\right) \cdot \left(6 \cdot z\right)
\end{array}
Initial program 99.5%
associate-*l*99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (* 6.0 z))) (t_1 (* -6.0 (* x z))))
(if (<= z -2.45e+247)
t_0
(if (<= z -9.5e+228)
(* x (* z -6.0))
(if (<= z -3.1e+212)
t_0
(if (<= z -1.85e+98)
t_1
(if (<= z -6.6e-22)
t_0
(if (<= z 4.6e-16)
x
(if (or (<= z 2.3e+166) (not (<= z 6.5e+207))) t_0 t_1)))))))))
double code(double x, double y, double z) {
double t_0 = y * (6.0 * z);
double t_1 = -6.0 * (x * z);
double tmp;
if (z <= -2.45e+247) {
tmp = t_0;
} else if (z <= -9.5e+228) {
tmp = x * (z * -6.0);
} else if (z <= -3.1e+212) {
tmp = t_0;
} else if (z <= -1.85e+98) {
tmp = t_1;
} else if (z <= -6.6e-22) {
tmp = t_0;
} else if (z <= 4.6e-16) {
tmp = x;
} else if ((z <= 2.3e+166) || !(z <= 6.5e+207)) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = y * (6.0d0 * z)
t_1 = (-6.0d0) * (x * z)
if (z <= (-2.45d+247)) then
tmp = t_0
else if (z <= (-9.5d+228)) then
tmp = x * (z * (-6.0d0))
else if (z <= (-3.1d+212)) then
tmp = t_0
else if (z <= (-1.85d+98)) then
tmp = t_1
else if (z <= (-6.6d-22)) then
tmp = t_0
else if (z <= 4.6d-16) then
tmp = x
else if ((z <= 2.3d+166) .or. (.not. (z <= 6.5d+207))) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (6.0 * z);
double t_1 = -6.0 * (x * z);
double tmp;
if (z <= -2.45e+247) {
tmp = t_0;
} else if (z <= -9.5e+228) {
tmp = x * (z * -6.0);
} else if (z <= -3.1e+212) {
tmp = t_0;
} else if (z <= -1.85e+98) {
tmp = t_1;
} else if (z <= -6.6e-22) {
tmp = t_0;
} else if (z <= 4.6e-16) {
tmp = x;
} else if ((z <= 2.3e+166) || !(z <= 6.5e+207)) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = y * (6.0 * z) t_1 = -6.0 * (x * z) tmp = 0 if z <= -2.45e+247: tmp = t_0 elif z <= -9.5e+228: tmp = x * (z * -6.0) elif z <= -3.1e+212: tmp = t_0 elif z <= -1.85e+98: tmp = t_1 elif z <= -6.6e-22: tmp = t_0 elif z <= 4.6e-16: tmp = x elif (z <= 2.3e+166) or not (z <= 6.5e+207): tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(y * Float64(6.0 * z)) t_1 = Float64(-6.0 * Float64(x * z)) tmp = 0.0 if (z <= -2.45e+247) tmp = t_0; elseif (z <= -9.5e+228) tmp = Float64(x * Float64(z * -6.0)); elseif (z <= -3.1e+212) tmp = t_0; elseif (z <= -1.85e+98) tmp = t_1; elseif (z <= -6.6e-22) tmp = t_0; elseif (z <= 4.6e-16) tmp = x; elseif ((z <= 2.3e+166) || !(z <= 6.5e+207)) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (6.0 * z); t_1 = -6.0 * (x * z); tmp = 0.0; if (z <= -2.45e+247) tmp = t_0; elseif (z <= -9.5e+228) tmp = x * (z * -6.0); elseif (z <= -3.1e+212) tmp = t_0; elseif (z <= -1.85e+98) tmp = t_1; elseif (z <= -6.6e-22) tmp = t_0; elseif (z <= 4.6e-16) tmp = x; elseif ((z <= 2.3e+166) || ~((z <= 6.5e+207))) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(6.0 * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.45e+247], t$95$0, If[LessEqual[z, -9.5e+228], N[(x * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.1e+212], t$95$0, If[LessEqual[z, -1.85e+98], t$95$1, If[LessEqual[z, -6.6e-22], t$95$0, If[LessEqual[z, 4.6e-16], x, If[Or[LessEqual[z, 2.3e+166], N[Not[LessEqual[z, 6.5e+207]], $MachinePrecision]], t$95$0, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(6 \cdot z\right)\\
t_1 := -6 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -2.45 \cdot 10^{+247}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{+228}:\\
\;\;\;\;x \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq -3.1 \cdot 10^{+212}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1.85 \cdot 10^{+98}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -6.6 \cdot 10^{-22}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{-16}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+166} \lor \neg \left(z \leq 6.5 \cdot 10^{+207}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.4499999999999999e247 or -9.50000000000000046e228 < z < -3.09999999999999998e212 or -1.8499999999999999e98 < z < -6.6000000000000002e-22 or 4.5999999999999998e-16 < z < 2.30000000000000008e166 or 6.5000000000000001e207 < z Initial program 99.8%
+-commutative99.8%
*-commutative99.8%
fma-def99.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%
Taylor expanded in z around inf 98.2%
add-sqr-sqrt48.7%
pow248.7%
Applied egg-rr48.7%
Taylor expanded in z around 0 98.2%
associate-*r*98.1%
*-commutative98.1%
Simplified98.1%
Taylor expanded in x around 0 73.8%
*-commutative73.8%
associate-*l*73.7%
Simplified73.7%
if -2.4499999999999999e247 < z < -9.50000000000000046e228Initial program 99.8%
+-commutative99.8%
*-commutative99.8%
fma-def99.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%
Taylor expanded in z around inf 99.6%
add-sqr-sqrt62.3%
pow262.3%
Applied egg-rr62.3%
Taylor expanded in x around inf 76.2%
*-commutative76.2%
associate-*r*76.4%
Simplified76.4%
if -3.09999999999999998e212 < z < -1.8499999999999999e98 or 2.30000000000000008e166 < z < 6.5000000000000001e207Initial program 99.9%
+-commutative99.9%
*-commutative99.9%
fma-def99.9%
remove-double-neg99.9%
distribute-lft-neg-in99.9%
distribute-rgt-neg-in99.9%
sub-neg99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 99.8%
Taylor expanded in x around inf 74.0%
if -6.6000000000000002e-22 < z < 4.5999999999999998e-16Initial program 99.1%
Taylor expanded in z around 0 74.4%
Final simplification74.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (* 6.0 z))))
(if (<= z -2.35e+247)
t_0
(if (<= z -4e+228)
(* x (* z -6.0))
(if (<= z -6.6e+212)
t_0
(if (<= z -3.5e+103)
(* z (* x -6.0))
(if (<= z -5.2e-20)
t_0
(if (<= z 2.6e-14)
x
(if (or (<= z 2.15e+166) (not (<= z 4e+206)))
t_0
(* -6.0 (* x z)))))))))))
double code(double x, double y, double z) {
double t_0 = y * (6.0 * z);
double tmp;
if (z <= -2.35e+247) {
tmp = t_0;
} else if (z <= -4e+228) {
tmp = x * (z * -6.0);
} else if (z <= -6.6e+212) {
tmp = t_0;
} else if (z <= -3.5e+103) {
tmp = z * (x * -6.0);
} else if (z <= -5.2e-20) {
tmp = t_0;
} else if (z <= 2.6e-14) {
tmp = x;
} else if ((z <= 2.15e+166) || !(z <= 4e+206)) {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = y * (6.0d0 * z)
if (z <= (-2.35d+247)) then
tmp = t_0
else if (z <= (-4d+228)) then
tmp = x * (z * (-6.0d0))
else if (z <= (-6.6d+212)) then
tmp = t_0
else if (z <= (-3.5d+103)) then
tmp = z * (x * (-6.0d0))
else if (z <= (-5.2d-20)) then
tmp = t_0
else if (z <= 2.6d-14) then
tmp = x
else if ((z <= 2.15d+166) .or. (.not. (z <= 4d+206))) then
tmp = t_0
else
tmp = (-6.0d0) * (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (6.0 * z);
double tmp;
if (z <= -2.35e+247) {
tmp = t_0;
} else if (z <= -4e+228) {
tmp = x * (z * -6.0);
} else if (z <= -6.6e+212) {
tmp = t_0;
} else if (z <= -3.5e+103) {
tmp = z * (x * -6.0);
} else if (z <= -5.2e-20) {
tmp = t_0;
} else if (z <= 2.6e-14) {
tmp = x;
} else if ((z <= 2.15e+166) || !(z <= 4e+206)) {
tmp = t_0;
} else {
tmp = -6.0 * (x * z);
}
return tmp;
}
def code(x, y, z): t_0 = y * (6.0 * z) tmp = 0 if z <= -2.35e+247: tmp = t_0 elif z <= -4e+228: tmp = x * (z * -6.0) elif z <= -6.6e+212: tmp = t_0 elif z <= -3.5e+103: tmp = z * (x * -6.0) elif z <= -5.2e-20: tmp = t_0 elif z <= 2.6e-14: tmp = x elif (z <= 2.15e+166) or not (z <= 4e+206): tmp = t_0 else: tmp = -6.0 * (x * z) return tmp
function code(x, y, z) t_0 = Float64(y * Float64(6.0 * z)) tmp = 0.0 if (z <= -2.35e+247) tmp = t_0; elseif (z <= -4e+228) tmp = Float64(x * Float64(z * -6.0)); elseif (z <= -6.6e+212) tmp = t_0; elseif (z <= -3.5e+103) tmp = Float64(z * Float64(x * -6.0)); elseif (z <= -5.2e-20) tmp = t_0; elseif (z <= 2.6e-14) tmp = x; elseif ((z <= 2.15e+166) || !(z <= 4e+206)) tmp = t_0; else tmp = Float64(-6.0 * Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (6.0 * z); tmp = 0.0; if (z <= -2.35e+247) tmp = t_0; elseif (z <= -4e+228) tmp = x * (z * -6.0); elseif (z <= -6.6e+212) tmp = t_0; elseif (z <= -3.5e+103) tmp = z * (x * -6.0); elseif (z <= -5.2e-20) tmp = t_0; elseif (z <= 2.6e-14) tmp = x; elseif ((z <= 2.15e+166) || ~((z <= 4e+206))) tmp = t_0; else tmp = -6.0 * (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(6.0 * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.35e+247], t$95$0, If[LessEqual[z, -4e+228], N[(x * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -6.6e+212], t$95$0, If[LessEqual[z, -3.5e+103], N[(z * N[(x * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.2e-20], t$95$0, If[LessEqual[z, 2.6e-14], x, If[Or[LessEqual[z, 2.15e+166], N[Not[LessEqual[z, 4e+206]], $MachinePrecision]], t$95$0, N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(6 \cdot z\right)\\
\mathbf{if}\;z \leq -2.35 \cdot 10^{+247}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -4 \cdot 10^{+228}:\\
\;\;\;\;x \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq -6.6 \cdot 10^{+212}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{+103}:\\
\;\;\;\;z \cdot \left(x \cdot -6\right)\\
\mathbf{elif}\;z \leq -5.2 \cdot 10^{-20}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-14}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{+166} \lor \neg \left(z \leq 4 \cdot 10^{+206}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;-6 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if z < -2.3500000000000001e247 or -3.9999999999999997e228 < z < -6.6e212 or -3.5e103 < z < -5.1999999999999999e-20 or 2.59999999999999997e-14 < z < 2.15e166 or 4.0000000000000002e206 < z Initial program 99.8%
+-commutative99.8%
*-commutative99.8%
fma-def99.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%
Taylor expanded in z around inf 98.2%
add-sqr-sqrt48.7%
pow248.7%
Applied egg-rr48.7%
Taylor expanded in z around 0 98.2%
associate-*r*98.1%
*-commutative98.1%
Simplified98.1%
Taylor expanded in x around 0 73.8%
*-commutative73.8%
associate-*l*73.7%
Simplified73.7%
if -2.3500000000000001e247 < z < -3.9999999999999997e228Initial program 99.8%
+-commutative99.8%
*-commutative99.8%
fma-def99.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%
Taylor expanded in z around inf 99.6%
add-sqr-sqrt62.3%
pow262.3%
Applied egg-rr62.3%
Taylor expanded in x around inf 76.2%
*-commutative76.2%
associate-*r*76.4%
Simplified76.4%
if -6.6e212 < z < -3.5e103Initial program 99.9%
+-commutative99.9%
*-commutative99.9%
fma-def99.9%
remove-double-neg99.9%
distribute-lft-neg-in99.9%
distribute-rgt-neg-in99.9%
sub-neg99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 99.7%
add-sqr-sqrt37.4%
pow237.4%
Applied egg-rr37.4%
Taylor expanded in x around inf 72.2%
*-commutative72.2%
*-commutative72.2%
associate-*l*72.4%
Simplified72.4%
if -5.1999999999999999e-20 < z < 2.59999999999999997e-14Initial program 99.1%
Taylor expanded in z around 0 74.4%
if 2.15e166 < z < 4.0000000000000002e206Initial program 100.0%
+-commutative100.0%
*-commutative100.0%
fma-def100.0%
remove-double-neg100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-in100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 99.8%
Taylor expanded in x around inf 78.7%
Final simplification74.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (* 6.0 z))))
(if (<= z -3.2e+247)
t_0
(if (<= z -4.2e+228)
(* x (* z -6.0))
(if (<= z -1.05e+212)
t_0
(if (<= z -1.7e+99)
(* z (* x -6.0))
(if (<= z -3.3e-20)
(* z (* y 6.0))
(if (<= z 1.56e-15)
x
(if (or (<= z 1.8e+166) (not (<= z 2.52e+207)))
t_0
(* -6.0 (* x z)))))))))))
double code(double x, double y, double z) {
double t_0 = y * (6.0 * z);
double tmp;
if (z <= -3.2e+247) {
tmp = t_0;
} else if (z <= -4.2e+228) {
tmp = x * (z * -6.0);
} else if (z <= -1.05e+212) {
tmp = t_0;
} else if (z <= -1.7e+99) {
tmp = z * (x * -6.0);
} else if (z <= -3.3e-20) {
tmp = z * (y * 6.0);
} else if (z <= 1.56e-15) {
tmp = x;
} else if ((z <= 1.8e+166) || !(z <= 2.52e+207)) {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = y * (6.0d0 * z)
if (z <= (-3.2d+247)) then
tmp = t_0
else if (z <= (-4.2d+228)) then
tmp = x * (z * (-6.0d0))
else if (z <= (-1.05d+212)) then
tmp = t_0
else if (z <= (-1.7d+99)) then
tmp = z * (x * (-6.0d0))
else if (z <= (-3.3d-20)) then
tmp = z * (y * 6.0d0)
else if (z <= 1.56d-15) then
tmp = x
else if ((z <= 1.8d+166) .or. (.not. (z <= 2.52d+207))) then
tmp = t_0
else
tmp = (-6.0d0) * (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (6.0 * z);
double tmp;
if (z <= -3.2e+247) {
tmp = t_0;
} else if (z <= -4.2e+228) {
tmp = x * (z * -6.0);
} else if (z <= -1.05e+212) {
tmp = t_0;
} else if (z <= -1.7e+99) {
tmp = z * (x * -6.0);
} else if (z <= -3.3e-20) {
tmp = z * (y * 6.0);
} else if (z <= 1.56e-15) {
tmp = x;
} else if ((z <= 1.8e+166) || !(z <= 2.52e+207)) {
tmp = t_0;
} else {
tmp = -6.0 * (x * z);
}
return tmp;
}
def code(x, y, z): t_0 = y * (6.0 * z) tmp = 0 if z <= -3.2e+247: tmp = t_0 elif z <= -4.2e+228: tmp = x * (z * -6.0) elif z <= -1.05e+212: tmp = t_0 elif z <= -1.7e+99: tmp = z * (x * -6.0) elif z <= -3.3e-20: tmp = z * (y * 6.0) elif z <= 1.56e-15: tmp = x elif (z <= 1.8e+166) or not (z <= 2.52e+207): tmp = t_0 else: tmp = -6.0 * (x * z) return tmp
function code(x, y, z) t_0 = Float64(y * Float64(6.0 * z)) tmp = 0.0 if (z <= -3.2e+247) tmp = t_0; elseif (z <= -4.2e+228) tmp = Float64(x * Float64(z * -6.0)); elseif (z <= -1.05e+212) tmp = t_0; elseif (z <= -1.7e+99) tmp = Float64(z * Float64(x * -6.0)); elseif (z <= -3.3e-20) tmp = Float64(z * Float64(y * 6.0)); elseif (z <= 1.56e-15) tmp = x; elseif ((z <= 1.8e+166) || !(z <= 2.52e+207)) tmp = t_0; else tmp = Float64(-6.0 * Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (6.0 * z); tmp = 0.0; if (z <= -3.2e+247) tmp = t_0; elseif (z <= -4.2e+228) tmp = x * (z * -6.0); elseif (z <= -1.05e+212) tmp = t_0; elseif (z <= -1.7e+99) tmp = z * (x * -6.0); elseif (z <= -3.3e-20) tmp = z * (y * 6.0); elseif (z <= 1.56e-15) tmp = x; elseif ((z <= 1.8e+166) || ~((z <= 2.52e+207))) tmp = t_0; else tmp = -6.0 * (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(6.0 * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.2e+247], t$95$0, If[LessEqual[z, -4.2e+228], N[(x * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.05e+212], t$95$0, If[LessEqual[z, -1.7e+99], N[(z * N[(x * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.3e-20], N[(z * N[(y * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.56e-15], x, If[Or[LessEqual[z, 1.8e+166], N[Not[LessEqual[z, 2.52e+207]], $MachinePrecision]], t$95$0, N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(6 \cdot z\right)\\
\mathbf{if}\;z \leq -3.2 \cdot 10^{+247}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{+228}:\\
\;\;\;\;x \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{+212}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1.7 \cdot 10^{+99}:\\
\;\;\;\;z \cdot \left(x \cdot -6\right)\\
\mathbf{elif}\;z \leq -3.3 \cdot 10^{-20}:\\
\;\;\;\;z \cdot \left(y \cdot 6\right)\\
\mathbf{elif}\;z \leq 1.56 \cdot 10^{-15}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{+166} \lor \neg \left(z \leq 2.52 \cdot 10^{+207}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;-6 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if z < -3.20000000000000022e247 or -4.19999999999999988e228 < z < -1.05e212 or 1.55999999999999991e-15 < z < 1.7999999999999999e166 or 2.51999999999999998e207 < z Initial program 99.7%
+-commutative99.7%
*-commutative99.7%
fma-def99.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 98.3%
add-sqr-sqrt46.9%
pow246.9%
Applied egg-rr46.9%
Taylor expanded in z around 0 98.3%
associate-*r*98.3%
*-commutative98.3%
Simplified98.3%
Taylor expanded in x around 0 77.9%
*-commutative77.9%
associate-*l*77.9%
Simplified77.9%
if -3.20000000000000022e247 < z < -4.19999999999999988e228Initial program 99.8%
+-commutative99.8%
*-commutative99.8%
fma-def99.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%
Taylor expanded in z around inf 99.6%
add-sqr-sqrt62.3%
pow262.3%
Applied egg-rr62.3%
Taylor expanded in x around inf 76.2%
*-commutative76.2%
associate-*r*76.4%
Simplified76.4%
if -1.05e212 < z < -1.69999999999999992e99Initial program 99.9%
+-commutative99.9%
*-commutative99.9%
fma-def99.9%
remove-double-neg99.9%
distribute-lft-neg-in99.9%
distribute-rgt-neg-in99.9%
sub-neg99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 99.7%
add-sqr-sqrt37.4%
pow237.4%
Applied egg-rr37.4%
Taylor expanded in x around inf 72.2%
*-commutative72.2%
*-commutative72.2%
associate-*l*72.4%
Simplified72.4%
if -1.69999999999999992e99 < z < -3.3e-20Initial program 99.8%
+-commutative99.8%
*-commutative99.8%
fma-def99.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%
Taylor expanded in z around inf 97.7%
add-sqr-sqrt53.9%
pow253.9%
Applied egg-rr53.9%
Taylor expanded in z around 0 97.7%
associate-*r*97.6%
*-commutative97.6%
Simplified97.6%
Taylor expanded in x around 0 61.5%
*-commutative61.5%
*-commutative61.5%
associate-*l*61.5%
Simplified61.5%
if -3.3e-20 < z < 1.55999999999999991e-15Initial program 99.1%
Taylor expanded in z around 0 74.4%
if 1.7999999999999999e166 < z < 2.51999999999999998e207Initial program 100.0%
+-commutative100.0%
*-commutative100.0%
fma-def100.0%
remove-double-neg100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-in100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 99.8%
Taylor expanded in x around inf 78.7%
Final simplification74.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (* 6.0 z))))
(if (<= z -2.4e+247)
t_0
(if (<= z -8e+228)
(* x (* z -6.0))
(if (<= z -3e+210)
t_0
(if (<= z -9.2e+97)
(* z (* x -6.0))
(if (<= z -7.5e-20)
(* z (* y 6.0))
(if (<= z 3e-20)
x
(if (or (<= z 2.1e+166) (not (<= z 7.6e+207)))
(* 6.0 (* y z))
(* -6.0 (* x z)))))))))))
double code(double x, double y, double z) {
double t_0 = y * (6.0 * z);
double tmp;
if (z <= -2.4e+247) {
tmp = t_0;
} else if (z <= -8e+228) {
tmp = x * (z * -6.0);
} else if (z <= -3e+210) {
tmp = t_0;
} else if (z <= -9.2e+97) {
tmp = z * (x * -6.0);
} else if (z <= -7.5e-20) {
tmp = z * (y * 6.0);
} else if (z <= 3e-20) {
tmp = x;
} else if ((z <= 2.1e+166) || !(z <= 7.6e+207)) {
tmp = 6.0 * (y * z);
} 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) :: t_0
real(8) :: tmp
t_0 = y * (6.0d0 * z)
if (z <= (-2.4d+247)) then
tmp = t_0
else if (z <= (-8d+228)) then
tmp = x * (z * (-6.0d0))
else if (z <= (-3d+210)) then
tmp = t_0
else if (z <= (-9.2d+97)) then
tmp = z * (x * (-6.0d0))
else if (z <= (-7.5d-20)) then
tmp = z * (y * 6.0d0)
else if (z <= 3d-20) then
tmp = x
else if ((z <= 2.1d+166) .or. (.not. (z <= 7.6d+207))) then
tmp = 6.0d0 * (y * z)
else
tmp = (-6.0d0) * (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (6.0 * z);
double tmp;
if (z <= -2.4e+247) {
tmp = t_0;
} else if (z <= -8e+228) {
tmp = x * (z * -6.0);
} else if (z <= -3e+210) {
tmp = t_0;
} else if (z <= -9.2e+97) {
tmp = z * (x * -6.0);
} else if (z <= -7.5e-20) {
tmp = z * (y * 6.0);
} else if (z <= 3e-20) {
tmp = x;
} else if ((z <= 2.1e+166) || !(z <= 7.6e+207)) {
tmp = 6.0 * (y * z);
} else {
tmp = -6.0 * (x * z);
}
return tmp;
}
def code(x, y, z): t_0 = y * (6.0 * z) tmp = 0 if z <= -2.4e+247: tmp = t_0 elif z <= -8e+228: tmp = x * (z * -6.0) elif z <= -3e+210: tmp = t_0 elif z <= -9.2e+97: tmp = z * (x * -6.0) elif z <= -7.5e-20: tmp = z * (y * 6.0) elif z <= 3e-20: tmp = x elif (z <= 2.1e+166) or not (z <= 7.6e+207): tmp = 6.0 * (y * z) else: tmp = -6.0 * (x * z) return tmp
function code(x, y, z) t_0 = Float64(y * Float64(6.0 * z)) tmp = 0.0 if (z <= -2.4e+247) tmp = t_0; elseif (z <= -8e+228) tmp = Float64(x * Float64(z * -6.0)); elseif (z <= -3e+210) tmp = t_0; elseif (z <= -9.2e+97) tmp = Float64(z * Float64(x * -6.0)); elseif (z <= -7.5e-20) tmp = Float64(z * Float64(y * 6.0)); elseif (z <= 3e-20) tmp = x; elseif ((z <= 2.1e+166) || !(z <= 7.6e+207)) tmp = Float64(6.0 * Float64(y * z)); else tmp = Float64(-6.0 * Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (6.0 * z); tmp = 0.0; if (z <= -2.4e+247) tmp = t_0; elseif (z <= -8e+228) tmp = x * (z * -6.0); elseif (z <= -3e+210) tmp = t_0; elseif (z <= -9.2e+97) tmp = z * (x * -6.0); elseif (z <= -7.5e-20) tmp = z * (y * 6.0); elseif (z <= 3e-20) tmp = x; elseif ((z <= 2.1e+166) || ~((z <= 7.6e+207))) tmp = 6.0 * (y * z); else tmp = -6.0 * (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(6.0 * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.4e+247], t$95$0, If[LessEqual[z, -8e+228], N[(x * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3e+210], t$95$0, If[LessEqual[z, -9.2e+97], N[(z * N[(x * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7.5e-20], N[(z * N[(y * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e-20], x, If[Or[LessEqual[z, 2.1e+166], N[Not[LessEqual[z, 7.6e+207]], $MachinePrecision]], N[(6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(6 \cdot z\right)\\
\mathbf{if}\;z \leq -2.4 \cdot 10^{+247}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -8 \cdot 10^{+228}:\\
\;\;\;\;x \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq -3 \cdot 10^{+210}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -9.2 \cdot 10^{+97}:\\
\;\;\;\;z \cdot \left(x \cdot -6\right)\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-20}:\\
\;\;\;\;z \cdot \left(y \cdot 6\right)\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-20}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+166} \lor \neg \left(z \leq 7.6 \cdot 10^{+207}\right):\\
\;\;\;\;6 \cdot \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;-6 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if z < -2.4e247 or -7.9999999999999994e228 < z < -3.00000000000000022e210Initial program 99.8%
+-commutative99.8%
*-commutative99.8%
fma-def99.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%
Taylor expanded in z around inf 99.7%
add-sqr-sqrt49.9%
pow249.9%
Applied egg-rr49.9%
Taylor expanded in z around 0 99.7%
associate-*r*99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 92.6%
*-commutative92.6%
associate-*l*92.8%
Simplified92.8%
if -2.4e247 < z < -7.9999999999999994e228Initial program 99.8%
+-commutative99.8%
*-commutative99.8%
fma-def99.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%
Taylor expanded in z around inf 99.6%
add-sqr-sqrt62.3%
pow262.3%
Applied egg-rr62.3%
Taylor expanded in x around inf 76.2%
*-commutative76.2%
associate-*r*76.4%
Simplified76.4%
if -3.00000000000000022e210 < z < -9.20000000000000022e97Initial program 99.9%
+-commutative99.9%
*-commutative99.9%
fma-def99.9%
remove-double-neg99.9%
distribute-lft-neg-in99.9%
distribute-rgt-neg-in99.9%
sub-neg99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 99.7%
add-sqr-sqrt37.4%
pow237.4%
Applied egg-rr37.4%
Taylor expanded in x around inf 72.2%
*-commutative72.2%
*-commutative72.2%
associate-*l*72.4%
Simplified72.4%
if -9.20000000000000022e97 < z < -7.49999999999999981e-20Initial program 99.8%
+-commutative99.8%
*-commutative99.8%
fma-def99.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%
Taylor expanded in z around inf 97.7%
add-sqr-sqrt53.9%
pow253.9%
Applied egg-rr53.9%
Taylor expanded in z around 0 97.7%
associate-*r*97.6%
*-commutative97.6%
Simplified97.6%
Taylor expanded in x around 0 61.5%
*-commutative61.5%
*-commutative61.5%
associate-*l*61.5%
Simplified61.5%
if -7.49999999999999981e-20 < z < 3.00000000000000029e-20Initial program 99.1%
Taylor expanded in z around 0 74.4%
if 3.00000000000000029e-20 < z < 2.1000000000000001e166 or 7.59999999999999973e207 < z Initial program 99.7%
+-commutative99.7%
*-commutative99.7%
fma-def99.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 98.0%
add-sqr-sqrt46.1%
pow246.1%
Applied egg-rr46.1%
Taylor expanded in z around 0 98.0%
associate-*r*97.9%
*-commutative97.9%
Simplified97.9%
Taylor expanded in x around 0 74.1%
*-commutative74.1%
*-commutative74.1%
Simplified74.1%
if 2.1000000000000001e166 < z < 7.59999999999999973e207Initial program 100.0%
+-commutative100.0%
*-commutative100.0%
fma-def100.0%
remove-double-neg100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-in100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 99.8%
Taylor expanded in x around inf 78.7%
Final simplification74.2%
(FPCore (x y z) :precision binary64 (if (or (<= z -3.3e-20) (not (<= z 9.2e-18))) (* -6.0 (* z (- x y))) x))
double code(double x, double y, double z) {
double tmp;
if ((z <= -3.3e-20) || !(z <= 9.2e-18)) {
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 <= (-3.3d-20)) .or. (.not. (z <= 9.2d-18))) 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 <= -3.3e-20) || !(z <= 9.2e-18)) {
tmp = -6.0 * (z * (x - y));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -3.3e-20) or not (z <= 9.2e-18): tmp = -6.0 * (z * (x - y)) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -3.3e-20) || !(z <= 9.2e-18)) 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 <= -3.3e-20) || ~((z <= 9.2e-18))) tmp = -6.0 * (z * (x - y)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -3.3e-20], N[Not[LessEqual[z, 9.2e-18]], $MachinePrecision]], N[(-6.0 * N[(z * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{-20} \lor \neg \left(z \leq 9.2 \cdot 10^{-18}\right):\\
\;\;\;\;-6 \cdot \left(z \cdot \left(x - y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.3e-20 or 9.2000000000000004e-18 < z Initial program 99.8%
+-commutative99.8%
*-commutative99.8%
fma-def99.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%
Taylor expanded in z around inf 98.7%
if -3.3e-20 < z < 9.2000000000000004e-18Initial program 99.1%
Taylor expanded in z around 0 74.4%
Final simplification86.9%
(FPCore (x y z) :precision binary64 (if (<= z -1.15e-20) (* (* z -6.0) (- x y)) (if (<= z 4.3e-17) x (* -6.0 (* z (- x y))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.15e-20) {
tmp = (z * -6.0) * (x - y);
} else if (z <= 4.3e-17) {
tmp = x;
} 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.15d-20)) then
tmp = (z * (-6.0d0)) * (x - y)
else if (z <= 4.3d-17) then
tmp = x
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.15e-20) {
tmp = (z * -6.0) * (x - y);
} else if (z <= 4.3e-17) {
tmp = x;
} else {
tmp = -6.0 * (z * (x - y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.15e-20: tmp = (z * -6.0) * (x - y) elif z <= 4.3e-17: tmp = x else: tmp = -6.0 * (z * (x - y)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.15e-20) tmp = Float64(Float64(z * -6.0) * Float64(x - y)); elseif (z <= 4.3e-17) tmp = x; 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.15e-20) tmp = (z * -6.0) * (x - y); elseif (z <= 4.3e-17) tmp = x; else tmp = -6.0 * (z * (x - y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.15e-20], N[(N[(z * -6.0), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.3e-17], x, N[(-6.0 * N[(z * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{-20}:\\
\;\;\;\;\left(z \cdot -6\right) \cdot \left(x - y\right)\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{-17}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;-6 \cdot \left(z \cdot \left(x - y\right)\right)\\
\end{array}
\end{array}
if z < -1.15e-20Initial program 99.8%
+-commutative99.8%
*-commutative99.8%
fma-def99.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%
Taylor expanded in z around inf 99.0%
add-sqr-sqrt48.3%
pow248.3%
Applied egg-rr48.3%
Taylor expanded in z around 0 99.0%
associate-*r*99.1%
*-commutative99.1%
Simplified99.1%
if -1.15e-20 < z < 4.30000000000000023e-17Initial program 99.1%
Taylor expanded in z around 0 74.4%
if 4.30000000000000023e-17 < z Initial program 99.8%
+-commutative99.8%
*-commutative99.8%
fma-def99.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%
Taylor expanded in z around inf 98.2%
Final simplification86.9%
(FPCore (x y z) :precision binary64 (if (<= z -0.116) (* (* z -6.0) (- x y)) (if (<= z 0.17) (+ x (* 6.0 (* y z))) (* -6.0 (* z (- x y))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.116) {
tmp = (z * -6.0) * (x - y);
} else if (z <= 0.17) {
tmp = x + (6.0 * (y * z));
} 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.116d0)) then
tmp = (z * (-6.0d0)) * (x - y)
else if (z <= 0.17d0) then
tmp = x + (6.0d0 * (y * z))
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.116) {
tmp = (z * -6.0) * (x - y);
} else if (z <= 0.17) {
tmp = x + (6.0 * (y * z));
} else {
tmp = -6.0 * (z * (x - y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.116: tmp = (z * -6.0) * (x - y) elif z <= 0.17: tmp = x + (6.0 * (y * z)) else: tmp = -6.0 * (z * (x - y)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.116) tmp = Float64(Float64(z * -6.0) * Float64(x - y)); elseif (z <= 0.17) tmp = Float64(x + Float64(6.0 * Float64(y * z))); 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.116) tmp = (z * -6.0) * (x - y); elseif (z <= 0.17) tmp = x + (6.0 * (y * z)); else tmp = -6.0 * (z * (x - y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.116], N[(N[(z * -6.0), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.17], N[(x + N[(6.0 * N[(y * z), $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.116:\\
\;\;\;\;\left(z \cdot -6\right) \cdot \left(x - y\right)\\
\mathbf{elif}\;z \leq 0.17:\\
\;\;\;\;x + 6 \cdot \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;-6 \cdot \left(z \cdot \left(x - y\right)\right)\\
\end{array}
\end{array}
if z < -0.116000000000000006Initial program 99.8%
+-commutative99.8%
*-commutative99.8%
fma-def99.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%
Taylor expanded in z around inf 99.0%
add-sqr-sqrt48.3%
pow248.3%
Applied egg-rr48.3%
Taylor expanded in z around 0 99.0%
associate-*r*99.1%
*-commutative99.1%
Simplified99.1%
if -0.116000000000000006 < z < 0.170000000000000012Initial program 99.2%
Taylor expanded in y around inf 99.7%
if 0.170000000000000012 < z Initial program 99.8%
+-commutative99.8%
*-commutative99.8%
fma-def99.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%
Taylor expanded in z around inf 99.8%
Final simplification99.5%
(FPCore (x y z) :precision binary64 (if (or (<= z -2.25e-9) (not (<= z 62000.0))) (* -6.0 (* x z)) x))
double code(double x, double y, double z) {
double tmp;
if ((z <= -2.25e-9) || !(z <= 62000.0)) {
tmp = -6.0 * (x * z);
} 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 <= (-2.25d-9)) .or. (.not. (z <= 62000.0d0))) then
tmp = (-6.0d0) * (x * z)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -2.25e-9) || !(z <= 62000.0)) {
tmp = -6.0 * (x * z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -2.25e-9) or not (z <= 62000.0): tmp = -6.0 * (x * z) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -2.25e-9) || !(z <= 62000.0)) tmp = Float64(-6.0 * Float64(x * z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -2.25e-9) || ~((z <= 62000.0))) tmp = -6.0 * (x * z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -2.25e-9], N[Not[LessEqual[z, 62000.0]], $MachinePrecision]], N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.25 \cdot 10^{-9} \lor \neg \left(z \leq 62000\right):\\
\;\;\;\;-6 \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.24999999999999988e-9 or 62000 < z Initial program 99.8%
+-commutative99.8%
*-commutative99.8%
fma-def99.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%
Taylor expanded in z around inf 99.4%
Taylor expanded in x around inf 45.5%
if -2.24999999999999988e-9 < z < 62000Initial program 99.1%
Taylor expanded in z around 0 71.7%
Final simplification58.8%
(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.5%
Final simplification99.5%
(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.5%
Taylor expanded in z around 0 37.9%
Final simplification37.9%
(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 2023335
(FPCore (x y z)
:name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, E"
:precision binary64
:herbie-target
(- x (* (* 6.0 z) (- x y)))
(+ x (* (* (- y x) 6.0) z)))