
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (if (<= z -4.5e+82) (+ (* z (+ y (* a b))) x) (+ (+ x (* z y)) (fma (* z b) a (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.5e+82) {
tmp = (z * (y + (a * b))) + x;
} else {
tmp = (x + (z * y)) + fma((z * b), a, (a * t));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.5e+82) tmp = Float64(Float64(z * Float64(y + Float64(a * b))) + x); else tmp = Float64(Float64(x + Float64(z * y)) + fma(Float64(z * b), a, Float64(a * t))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.5e+82], N[(N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision] + N[(N[(z * b), $MachinePrecision] * a + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+82}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right) + x\\
\mathbf{else}:\\
\;\;\;\;\left(x + z \cdot y\right) + \mathsf{fma}\left(z \cdot b, a, a \cdot t\right)\\
\end{array}
\end{array}
if z < -4.4999999999999997e82Initial program 75.7%
associate-+l+75.7%
associate-*l*75.9%
Simplified75.9%
Taylor expanded in t around 0 71.0%
+-commutative71.0%
+-commutative71.0%
associate-*r*76.9%
distribute-rgt-in95.1%
Simplified95.1%
if -4.4999999999999997e82 < z Initial program 97.2%
associate-+l+97.2%
associate-*l*98.1%
Simplified98.1%
+-commutative98.1%
*-commutative98.1%
fma-def98.6%
*-commutative98.6%
Applied egg-rr98.6%
Final simplification98.1%
(FPCore (x y z t a b) :precision binary64 (if (<= z -4.5e+82) (+ (* z (+ y (* a b))) x) (+ (fma y z x) (* a (+ (* z b) t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.5e+82) {
tmp = (z * (y + (a * b))) + x;
} else {
tmp = fma(y, z, x) + (a * ((z * b) + t));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.5e+82) tmp = Float64(Float64(z * Float64(y + Float64(a * b))) + x); else tmp = Float64(fma(y, z, x) + Float64(a * Float64(Float64(z * b) + t))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.5e+82], N[(N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(N[(y * z + x), $MachinePrecision] + N[(a * N[(N[(z * b), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+82}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right) + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, z, x\right) + a \cdot \left(z \cdot b + t\right)\\
\end{array}
\end{array}
if z < -4.4999999999999997e82Initial program 75.7%
associate-+l+75.7%
associate-*l*75.9%
Simplified75.9%
Taylor expanded in t around 0 71.0%
+-commutative71.0%
+-commutative71.0%
associate-*r*76.9%
distribute-rgt-in95.1%
Simplified95.1%
if -4.4999999999999997e82 < z Initial program 97.2%
associate-+l+97.2%
+-commutative97.2%
fma-def97.2%
associate-*l*98.1%
*-commutative98.1%
*-commutative98.1%
distribute-rgt-out98.6%
*-commutative98.6%
Simplified98.6%
Final simplification98.1%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (+ x (* z y)) (* a t)) (* b (* z a))))) (if (<= t_1 INFINITY) t_1 (* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (z * y)) + (a * t)) + (b * (z * a));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (z * y)) + (a * t)) + (b * (z * a));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x + (z * y)) + (a * t)) + (b * (z * a)) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = z * (y + (a * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x + Float64(z * y)) + Float64(a * t)) + Float64(b * Float64(z * a))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(z * Float64(y + Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((x + (z * y)) + (a * t)) + (b * (z * a)); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = z * (y + (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x + z \cdot y\right) + a \cdot t\right) + b \cdot \left(z \cdot a\right)\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0Initial program 98.7%
if +inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 0.0%
associate-+l+0.0%
associate-*l*27.3%
Simplified27.3%
Taylor expanded in z around inf 81.8%
Final simplification98.0%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= a -0.088)
(and (not (<= a 1.6e-90))
(or (<= a 2400000000000.0) (not (<= a 2e+118)))))
(* a (+ (* z b) t))
(+ x (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -0.088) || (!(a <= 1.6e-90) && ((a <= 2400000000000.0) || !(a <= 2e+118)))) {
tmp = a * ((z * b) + t);
} else {
tmp = x + (z * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-0.088d0)) .or. (.not. (a <= 1.6d-90)) .and. (a <= 2400000000000.0d0) .or. (.not. (a <= 2d+118))) then
tmp = a * ((z * b) + t)
else
tmp = x + (z * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -0.088) || (!(a <= 1.6e-90) && ((a <= 2400000000000.0) || !(a <= 2e+118)))) {
tmp = a * ((z * b) + t);
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -0.088) or (not (a <= 1.6e-90) and ((a <= 2400000000000.0) or not (a <= 2e+118))): tmp = a * ((z * b) + t) else: tmp = x + (z * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -0.088) || (!(a <= 1.6e-90) && ((a <= 2400000000000.0) || !(a <= 2e+118)))) tmp = Float64(a * Float64(Float64(z * b) + t)); else tmp = Float64(x + Float64(z * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -0.088) || (~((a <= 1.6e-90)) && ((a <= 2400000000000.0) || ~((a <= 2e+118))))) tmp = a * ((z * b) + t); else tmp = x + (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -0.088], And[N[Not[LessEqual[a, 1.6e-90]], $MachinePrecision], Or[LessEqual[a, 2400000000000.0], N[Not[LessEqual[a, 2e+118]], $MachinePrecision]]]], N[(a * N[(N[(z * b), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -0.088 \lor \neg \left(a \leq 1.6 \cdot 10^{-90}\right) \land \left(a \leq 2400000000000 \lor \neg \left(a \leq 2 \cdot 10^{+118}\right)\right):\\
\;\;\;\;a \cdot \left(z \cdot b + t\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -0.087999999999999995 or 1.60000000000000004e-90 < a < 2.4e12 or 1.99999999999999993e118 < a Initial program 90.6%
associate-+l+90.6%
associate-*l*93.6%
Simplified93.6%
Taylor expanded in a around inf 74.2%
if -0.087999999999999995 < a < 1.60000000000000004e-90 or 2.4e12 < a < 1.99999999999999993e118Initial program 98.2%
associate-+l+98.2%
associate-*l*96.9%
Simplified96.9%
Taylor expanded in a around 0 80.7%
Final simplification77.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (* a b))))
(if (<= z -7e-85)
t_1
(if (<= z 2.8e-14)
x
(if (or (<= z 6e+248) (not (<= z 6.1e+289))) (* z y) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (a * b);
double tmp;
if (z <= -7e-85) {
tmp = t_1;
} else if (z <= 2.8e-14) {
tmp = x;
} else if ((z <= 6e+248) || !(z <= 6.1e+289)) {
tmp = z * y;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = z * (a * b)
if (z <= (-7d-85)) then
tmp = t_1
else if (z <= 2.8d-14) then
tmp = x
else if ((z <= 6d+248) .or. (.not. (z <= 6.1d+289))) then
tmp = z * y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (a * b);
double tmp;
if (z <= -7e-85) {
tmp = t_1;
} else if (z <= 2.8e-14) {
tmp = x;
} else if ((z <= 6e+248) || !(z <= 6.1e+289)) {
tmp = z * y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (a * b) tmp = 0 if z <= -7e-85: tmp = t_1 elif z <= 2.8e-14: tmp = x elif (z <= 6e+248) or not (z <= 6.1e+289): tmp = z * y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(a * b)) tmp = 0.0 if (z <= -7e-85) tmp = t_1; elseif (z <= 2.8e-14) tmp = x; elseif ((z <= 6e+248) || !(z <= 6.1e+289)) tmp = Float64(z * y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (a * b); tmp = 0.0; if (z <= -7e-85) tmp = t_1; elseif (z <= 2.8e-14) tmp = x; elseif ((z <= 6e+248) || ~((z <= 6.1e+289))) tmp = z * y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7e-85], t$95$1, If[LessEqual[z, 2.8e-14], x, If[Or[LessEqual[z, 6e+248], N[Not[LessEqual[z, 6.1e+289]], $MachinePrecision]], N[(z * y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -7 \cdot 10^{-85}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-14}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+248} \lor \neg \left(z \leq 6.1 \cdot 10^{+289}\right):\\
\;\;\;\;z \cdot y\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -6.99999999999999956e-85 or 6e248 < z < 6.10000000000000029e289Initial program 88.0%
associate-+l+88.0%
associate-*l*88.6%
Simplified88.6%
Taylor expanded in z around inf 75.8%
Taylor expanded in y around 0 47.6%
if -6.99999999999999956e-85 < z < 2.8000000000000001e-14Initial program 99.2%
associate-+l+99.2%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in x around inf 47.5%
if 2.8000000000000001e-14 < z < 6e248 or 6.10000000000000029e289 < z Initial program 93.2%
associate-+l+93.2%
associate-*l*94.5%
Simplified94.5%
Taylor expanded in y around inf 52.0%
*-commutative52.0%
Simplified52.0%
Final simplification48.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* z y))) (t_2 (+ x (* a t))))
(if (<= a -19.0)
t_2
(if (<= a 1.7e-89)
t_1
(if (<= a 11200000000000.0)
t_2
(if (<= a 3.8e+187) t_1 (* a (* z b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (z * y);
double t_2 = x + (a * t);
double tmp;
if (a <= -19.0) {
tmp = t_2;
} else if (a <= 1.7e-89) {
tmp = t_1;
} else if (a <= 11200000000000.0) {
tmp = t_2;
} else if (a <= 3.8e+187) {
tmp = t_1;
} else {
tmp = a * (z * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + (z * y)
t_2 = x + (a * t)
if (a <= (-19.0d0)) then
tmp = t_2
else if (a <= 1.7d-89) then
tmp = t_1
else if (a <= 11200000000000.0d0) then
tmp = t_2
else if (a <= 3.8d+187) then
tmp = t_1
else
tmp = a * (z * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (z * y);
double t_2 = x + (a * t);
double tmp;
if (a <= -19.0) {
tmp = t_2;
} else if (a <= 1.7e-89) {
tmp = t_1;
} else if (a <= 11200000000000.0) {
tmp = t_2;
} else if (a <= 3.8e+187) {
tmp = t_1;
} else {
tmp = a * (z * b);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (z * y) t_2 = x + (a * t) tmp = 0 if a <= -19.0: tmp = t_2 elif a <= 1.7e-89: tmp = t_1 elif a <= 11200000000000.0: tmp = t_2 elif a <= 3.8e+187: tmp = t_1 else: tmp = a * (z * b) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(z * y)) t_2 = Float64(x + Float64(a * t)) tmp = 0.0 if (a <= -19.0) tmp = t_2; elseif (a <= 1.7e-89) tmp = t_1; elseif (a <= 11200000000000.0) tmp = t_2; elseif (a <= 3.8e+187) tmp = t_1; else tmp = Float64(a * Float64(z * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (z * y); t_2 = x + (a * t); tmp = 0.0; if (a <= -19.0) tmp = t_2; elseif (a <= 1.7e-89) tmp = t_1; elseif (a <= 11200000000000.0) tmp = t_2; elseif (a <= 3.8e+187) tmp = t_1; else tmp = a * (z * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -19.0], t$95$2, If[LessEqual[a, 1.7e-89], t$95$1, If[LessEqual[a, 11200000000000.0], t$95$2, If[LessEqual[a, 3.8e+187], t$95$1, N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot y\\
t_2 := x + a \cdot t\\
\mathbf{if}\;a \leq -19:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 1.7 \cdot 10^{-89}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 11200000000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 3.8 \cdot 10^{+187}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\end{array}
\end{array}
if a < -19 or 1.7e-89 < a < 1.12e13Initial program 89.3%
associate-+l+89.3%
associate-*l*91.4%
Simplified91.4%
Taylor expanded in z around 0 57.7%
+-commutative57.7%
Simplified57.7%
if -19 < a < 1.7e-89 or 1.12e13 < a < 3.8e187Initial program 98.4%
associate-+l+98.4%
associate-*l*97.2%
Simplified97.2%
Taylor expanded in a around 0 77.1%
if 3.8e187 < a Initial program 90.3%
associate-+l+90.3%
associate-*l*99.9%
Simplified99.9%
+-commutative99.9%
*-commutative99.9%
fma-def100.0%
*-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in b around inf 62.7%
Final simplification68.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -3.3e+81)
(* z y)
(if (<= z -2.15e-57)
(* a t)
(if (or (<= z -5.8e-75) (not (<= z 0.000175))) (* z y) x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.3e+81) {
tmp = z * y;
} else if (z <= -2.15e-57) {
tmp = a * t;
} else if ((z <= -5.8e-75) || !(z <= 0.000175)) {
tmp = z * y;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-3.3d+81)) then
tmp = z * y
else if (z <= (-2.15d-57)) then
tmp = a * t
else if ((z <= (-5.8d-75)) .or. (.not. (z <= 0.000175d0))) then
tmp = z * y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.3e+81) {
tmp = z * y;
} else if (z <= -2.15e-57) {
tmp = a * t;
} else if ((z <= -5.8e-75) || !(z <= 0.000175)) {
tmp = z * y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -3.3e+81: tmp = z * y elif z <= -2.15e-57: tmp = a * t elif (z <= -5.8e-75) or not (z <= 0.000175): tmp = z * y else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3.3e+81) tmp = Float64(z * y); elseif (z <= -2.15e-57) tmp = Float64(a * t); elseif ((z <= -5.8e-75) || !(z <= 0.000175)) tmp = Float64(z * y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -3.3e+81) tmp = z * y; elseif (z <= -2.15e-57) tmp = a * t; elseif ((z <= -5.8e-75) || ~((z <= 0.000175))) tmp = z * y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3.3e+81], N[(z * y), $MachinePrecision], If[LessEqual[z, -2.15e-57], N[(a * t), $MachinePrecision], If[Or[LessEqual[z, -5.8e-75], N[Not[LessEqual[z, 0.000175]], $MachinePrecision]], N[(z * y), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+81}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;z \leq -2.15 \cdot 10^{-57}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-75} \lor \neg \left(z \leq 0.000175\right):\\
\;\;\;\;z \cdot y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.3e81 or -2.15000000000000011e-57 < z < -5.8000000000000003e-75 or 1.74999999999999998e-4 < z Initial program 87.8%
associate-+l+87.8%
associate-*l*88.6%
Simplified88.6%
Taylor expanded in y around inf 49.7%
*-commutative49.7%
Simplified49.7%
if -3.3e81 < z < -2.15000000000000011e-57Initial program 98.6%
associate-+l+98.6%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in t around inf 41.4%
if -5.8000000000000003e-75 < z < 1.74999999999999998e-4Initial program 99.2%
associate-+l+99.2%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in x around inf 46.7%
Final simplification47.4%
(FPCore (x y z t a b) :precision binary64 (if (<= z -4.4e+82) (+ (* z (+ y (* a b))) x) (+ (+ x (* z y)) (+ (* a t) (* a (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.4e+82) {
tmp = (z * (y + (a * b))) + x;
} else {
tmp = (x + (z * y)) + ((a * t) + (a * (z * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-4.4d+82)) then
tmp = (z * (y + (a * b))) + x
else
tmp = (x + (z * y)) + ((a * t) + (a * (z * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.4e+82) {
tmp = (z * (y + (a * b))) + x;
} else {
tmp = (x + (z * y)) + ((a * t) + (a * (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -4.4e+82: tmp = (z * (y + (a * b))) + x else: tmp = (x + (z * y)) + ((a * t) + (a * (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.4e+82) tmp = Float64(Float64(z * Float64(y + Float64(a * b))) + x); else tmp = Float64(Float64(x + Float64(z * y)) + Float64(Float64(a * t) + Float64(a * Float64(z * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -4.4e+82) tmp = (z * (y + (a * b))) + x; else tmp = (x + (z * y)) + ((a * t) + (a * (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.4e+82], N[(N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision] + N[(N[(a * t), $MachinePrecision] + N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+82}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right) + x\\
\mathbf{else}:\\
\;\;\;\;\left(x + z \cdot y\right) + \left(a \cdot t + a \cdot \left(z \cdot b\right)\right)\\
\end{array}
\end{array}
if z < -4.4000000000000002e82Initial program 75.7%
associate-+l+75.7%
associate-*l*75.9%
Simplified75.9%
Taylor expanded in t around 0 71.0%
+-commutative71.0%
+-commutative71.0%
associate-*r*76.9%
distribute-rgt-in95.1%
Simplified95.1%
if -4.4000000000000002e82 < z Initial program 97.2%
associate-+l+97.2%
associate-*l*98.1%
Simplified98.1%
Final simplification97.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -4.5e+82) (not (<= z 1.05e+115))) (* z (+ y (* a b))) (+ x (+ (* a t) (* z y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -4.5e+82) || !(z <= 1.05e+115)) {
tmp = z * (y + (a * b));
} else {
tmp = x + ((a * t) + (z * y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-4.5d+82)) .or. (.not. (z <= 1.05d+115))) then
tmp = z * (y + (a * b))
else
tmp = x + ((a * t) + (z * y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -4.5e+82) || !(z <= 1.05e+115)) {
tmp = z * (y + (a * b));
} else {
tmp = x + ((a * t) + (z * y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -4.5e+82) or not (z <= 1.05e+115): tmp = z * (y + (a * b)) else: tmp = x + ((a * t) + (z * y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -4.5e+82) || !(z <= 1.05e+115)) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(x + Float64(Float64(a * t) + Float64(z * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -4.5e+82) || ~((z <= 1.05e+115))) tmp = z * (y + (a * b)); else tmp = x + ((a * t) + (z * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -4.5e+82], N[Not[LessEqual[z, 1.05e+115]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(a * t), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+82} \lor \neg \left(z \leq 1.05 \cdot 10^{+115}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(a \cdot t + z \cdot y\right)\\
\end{array}
\end{array}
if z < -4.4999999999999997e82 or 1.05000000000000002e115 < z Initial program 83.1%
associate-+l+83.1%
associate-*l*84.5%
Simplified84.5%
Taylor expanded in z around inf 90.3%
if -4.4999999999999997e82 < z < 1.05000000000000002e115Initial program 98.7%
associate-+l+98.7%
associate-*l*99.3%
Simplified99.3%
Taylor expanded in b around 0 84.5%
Final simplification86.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -76000.0) (not (<= b 8.5e+84))) (+ (* z (+ y (* a b))) x) (+ x (+ (* a t) (* z y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -76000.0) || !(b <= 8.5e+84)) {
tmp = (z * (y + (a * b))) + x;
} else {
tmp = x + ((a * t) + (z * y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-76000.0d0)) .or. (.not. (b <= 8.5d+84))) then
tmp = (z * (y + (a * b))) + x
else
tmp = x + ((a * t) + (z * y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -76000.0) || !(b <= 8.5e+84)) {
tmp = (z * (y + (a * b))) + x;
} else {
tmp = x + ((a * t) + (z * y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -76000.0) or not (b <= 8.5e+84): tmp = (z * (y + (a * b))) + x else: tmp = x + ((a * t) + (z * y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -76000.0) || !(b <= 8.5e+84)) tmp = Float64(Float64(z * Float64(y + Float64(a * b))) + x); else tmp = Float64(x + Float64(Float64(a * t) + Float64(z * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -76000.0) || ~((b <= 8.5e+84))) tmp = (z * (y + (a * b))) + x; else tmp = x + ((a * t) + (z * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -76000.0], N[Not[LessEqual[b, 8.5e+84]], $MachinePrecision]], N[(N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(x + N[(N[(a * t), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -76000 \lor \neg \left(b \leq 8.5 \cdot 10^{+84}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right) + x\\
\mathbf{else}:\\
\;\;\;\;x + \left(a \cdot t + z \cdot y\right)\\
\end{array}
\end{array}
if b < -76000 or 8.5000000000000008e84 < b Initial program 93.6%
associate-+l+93.6%
associate-*l*91.0%
Simplified91.0%
Taylor expanded in t around 0 77.7%
+-commutative77.7%
+-commutative77.7%
associate-*r*78.7%
distribute-rgt-in82.7%
Simplified82.7%
if -76000 < b < 8.5000000000000008e84Initial program 95.0%
associate-+l+95.0%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in b around 0 94.3%
Final simplification89.8%
(FPCore (x y z t a b) :precision binary64 (if (<= b -6500000000.0) (+ x (+ (* a t) (* a (* z b)))) (if (<= b 3.2e+82) (+ x (+ (* a t) (* z y))) (+ (* z (+ y (* a b))) x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -6500000000.0) {
tmp = x + ((a * t) + (a * (z * b)));
} else if (b <= 3.2e+82) {
tmp = x + ((a * t) + (z * y));
} else {
tmp = (z * (y + (a * b))) + x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-6500000000.0d0)) then
tmp = x + ((a * t) + (a * (z * b)))
else if (b <= 3.2d+82) then
tmp = x + ((a * t) + (z * y))
else
tmp = (z * (y + (a * b))) + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -6500000000.0) {
tmp = x + ((a * t) + (a * (z * b)));
} else if (b <= 3.2e+82) {
tmp = x + ((a * t) + (z * y));
} else {
tmp = (z * (y + (a * b))) + x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -6500000000.0: tmp = x + ((a * t) + (a * (z * b))) elif b <= 3.2e+82: tmp = x + ((a * t) + (z * y)) else: tmp = (z * (y + (a * b))) + x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -6500000000.0) tmp = Float64(x + Float64(Float64(a * t) + Float64(a * Float64(z * b)))); elseif (b <= 3.2e+82) tmp = Float64(x + Float64(Float64(a * t) + Float64(z * y))); else tmp = Float64(Float64(z * Float64(y + Float64(a * b))) + x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -6500000000.0) tmp = x + ((a * t) + (a * (z * b))); elseif (b <= 3.2e+82) tmp = x + ((a * t) + (z * y)); else tmp = (z * (y + (a * b))) + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -6500000000.0], N[(x + N[(N[(a * t), $MachinePrecision] + N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.2e+82], N[(x + N[(N[(a * t), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6500000000:\\
\;\;\;\;x + \left(a \cdot t + a \cdot \left(z \cdot b\right)\right)\\
\mathbf{elif}\;b \leq 3.2 \cdot 10^{+82}:\\
\;\;\;\;x + \left(a \cdot t + z \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right) + x\\
\end{array}
\end{array}
if b < -6.5e9Initial program 94.1%
associate-+l+94.1%
associate-*l*93.1%
Simplified93.1%
Taylor expanded in y around 0 82.3%
if -6.5e9 < b < 3.19999999999999975e82Initial program 95.0%
associate-+l+95.0%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in b around 0 94.3%
if 3.19999999999999975e82 < b Initial program 92.8%
associate-+l+92.8%
associate-*l*88.0%
Simplified88.0%
Taylor expanded in t around 0 75.8%
+-commutative75.8%
+-commutative75.8%
associate-*r*80.2%
distribute-rgt-in84.9%
Simplified84.9%
Final simplification90.0%
(FPCore (x y z t a b) :precision binary64 (if (<= a -1.58e+63) (* a t) (if (<= a 3.8e+187) (+ x (* z y)) (* a (* z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.58e+63) {
tmp = a * t;
} else if (a <= 3.8e+187) {
tmp = x + (z * y);
} else {
tmp = a * (z * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-1.58d+63)) then
tmp = a * t
else if (a <= 3.8d+187) then
tmp = x + (z * y)
else
tmp = a * (z * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.58e+63) {
tmp = a * t;
} else if (a <= 3.8e+187) {
tmp = x + (z * y);
} else {
tmp = a * (z * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.58e+63: tmp = a * t elif a <= 3.8e+187: tmp = x + (z * y) else: tmp = a * (z * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.58e+63) tmp = Float64(a * t); elseif (a <= 3.8e+187) tmp = Float64(x + Float64(z * y)); else tmp = Float64(a * Float64(z * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -1.58e+63) tmp = a * t; elseif (a <= 3.8e+187) tmp = x + (z * y); else tmp = a * (z * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.58e+63], N[(a * t), $MachinePrecision], If[LessEqual[a, 3.8e+187], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.58 \cdot 10^{+63}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq 3.8 \cdot 10^{+187}:\\
\;\;\;\;x + z \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\end{array}
\end{array}
if a < -1.5799999999999999e63Initial program 83.7%
associate-+l+83.7%
associate-*l*87.6%
Simplified87.6%
Taylor expanded in t around inf 53.4%
if -1.5799999999999999e63 < a < 3.8e187Initial program 97.7%
associate-+l+97.7%
associate-*l*96.8%
Simplified96.8%
Taylor expanded in a around 0 67.5%
if 3.8e187 < a Initial program 90.3%
associate-+l+90.3%
associate-*l*99.9%
Simplified99.9%
+-commutative99.9%
*-commutative99.9%
fma-def100.0%
*-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in b around inf 62.7%
Final simplification64.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.3e-13) (not (<= a 3.7e-96))) (* a t) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.3e-13) || !(a <= 3.7e-96)) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-1.3d-13)) .or. (.not. (a <= 3.7d-96))) then
tmp = a * t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.3e-13) || !(a <= 3.7e-96)) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.3e-13) or not (a <= 3.7e-96): tmp = a * t else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.3e-13) || !(a <= 3.7e-96)) tmp = Float64(a * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.3e-13) || ~((a <= 3.7e-96))) tmp = a * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.3e-13], N[Not[LessEqual[a, 3.7e-96]], $MachinePrecision]], N[(a * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.3 \cdot 10^{-13} \lor \neg \left(a \leq 3.7 \cdot 10^{-96}\right):\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.3e-13 or 3.69999999999999986e-96 < a Initial program 91.5%
associate-+l+91.5%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in t around inf 39.4%
if -1.3e-13 < a < 3.69999999999999986e-96Initial program 98.7%
associate-+l+98.7%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in x around inf 46.6%
Final simplification42.3%
(FPCore (x y z t a b) :precision binary64 (if (<= z -2.2e-89) (* a (* z b)) (if (<= z 6.5e-10) x (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.2e-89) {
tmp = a * (z * b);
} else if (z <= 6.5e-10) {
tmp = x;
} else {
tmp = z * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-2.2d-89)) then
tmp = a * (z * b)
else if (z <= 6.5d-10) then
tmp = x
else
tmp = z * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.2e-89) {
tmp = a * (z * b);
} else if (z <= 6.5e-10) {
tmp = x;
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2.2e-89: tmp = a * (z * b) elif z <= 6.5e-10: tmp = x else: tmp = z * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.2e-89) tmp = Float64(a * Float64(z * b)); elseif (z <= 6.5e-10) tmp = x; else tmp = Float64(z * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -2.2e-89) tmp = a * (z * b); elseif (z <= 6.5e-10) tmp = x; else tmp = z * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.2e-89], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5e-10], x, N[(z * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{-89}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-10}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if z < -2.20000000000000012e-89Initial program 87.6%
associate-+l+87.6%
associate-*l*88.2%
Simplified88.2%
+-commutative88.2%
*-commutative88.2%
fma-def88.2%
*-commutative88.2%
Applied egg-rr88.2%
Taylor expanded in b around inf 39.9%
if -2.20000000000000012e-89 < z < 6.5000000000000003e-10Initial program 99.2%
associate-+l+99.2%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in x around inf 47.5%
if 6.5000000000000003e-10 < z Initial program 92.7%
associate-+l+92.7%
associate-*l*93.9%
Simplified93.9%
Taylor expanded in y around inf 50.4%
*-commutative50.4%
Simplified50.4%
Final simplification46.2%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 94.4%
associate-+l+94.4%
associate-*l*95.3%
Simplified95.3%
Taylor expanded in x around inf 28.5%
Final simplification28.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* z (+ (* b a) y)) (+ x (* t a)))))
(if (< z -11820553527347888000.0)
t_1
(if (< z 4.7589743188364287e-122)
(+ (* (+ (* b z) t) a) (+ (* z y) x))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * ((b * a) + y)) + (x + (t * a));
double tmp;
if (z < -11820553527347888000.0) {
tmp = t_1;
} else if (z < 4.7589743188364287e-122) {
tmp = (((b * z) + t) * a) + ((z * y) + x);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (z * ((b * a) + y)) + (x + (t * a))
if (z < (-11820553527347888000.0d0)) then
tmp = t_1
else if (z < 4.7589743188364287d-122) then
tmp = (((b * z) + t) * a) + ((z * y) + x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * ((b * a) + y)) + (x + (t * a));
double tmp;
if (z < -11820553527347888000.0) {
tmp = t_1;
} else if (z < 4.7589743188364287e-122) {
tmp = (((b * z) + t) * a) + ((z * y) + x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z * ((b * a) + y)) + (x + (t * a)) tmp = 0 if z < -11820553527347888000.0: tmp = t_1 elif z < 4.7589743188364287e-122: tmp = (((b * z) + t) * a) + ((z * y) + x) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z * Float64(Float64(b * a) + y)) + Float64(x + Float64(t * a))) tmp = 0.0 if (z < -11820553527347888000.0) tmp = t_1; elseif (z < 4.7589743188364287e-122) tmp = Float64(Float64(Float64(Float64(b * z) + t) * a) + Float64(Float64(z * y) + x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z * ((b * a) + y)) + (x + (t * a)); tmp = 0.0; if (z < -11820553527347888000.0) tmp = t_1; elseif (z < 4.7589743188364287e-122) tmp = (((b * z) + t) * a) + ((z * y) + x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * N[(N[(b * a), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -11820553527347888000.0], t$95$1, If[Less[z, 4.7589743188364287e-122], N[(N[(N[(N[(b * z), $MachinePrecision] + t), $MachinePrecision] * a), $MachinePrecision] + N[(N[(z * y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(b \cdot a + y\right) + \left(x + t \cdot a\right)\\
\mathbf{if}\;z < -11820553527347888000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z < 4.7589743188364287 \cdot 10^{-122}:\\
\;\;\;\;\left(b \cdot z + t\right) \cdot a + \left(z \cdot y + x\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
herbie shell --seed 2024020
(FPCore (x y z t a b)
:name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
:precision binary64
:herbie-target
(if (< z -11820553527347888000.0) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 4.7589743188364287e-122) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a)))))
(+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))