
(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 14 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 (let* ((t_1 (+ (+ (+ x (* y z)) (* t a)) (* (* z a) b)))) (if (<= t_1 INFINITY) t_1 (fma a (+ t (* z b)) (fma y z x)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(a, (t + (z * b)), fma(y, z, x));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(z * a) * b)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = fma(a, Float64(t + Float64(z * b)), fma(y, z, x)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(y * z + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, t + z \cdot b, \mathsf{fma}\left(y, z, x\right)\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.8%
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%
+-commutative0.0%
*-commutative0.0%
associate-*l*33.3%
*-commutative33.3%
distribute-lft-out66.7%
fma-def77.8%
*-commutative77.8%
+-commutative77.8%
fma-def77.8%
Simplified77.8%
Final simplification98.0%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (+ x (* y z)) (* t a)) (* (* z a) b)))) (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 + (y * z)) + (t * a)) + ((z * a) * b);
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 + (y * z)) + (t * a)) + ((z * a) * b);
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 + (y * z)) + (t * a)) + ((z * a) * b) 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(y * z)) + Float64(t * a)) + Float64(Float64(z * a) * b)) 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 + (y * z)) + (t * a)) + ((z * a) * b); 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[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(z * a), $MachinePrecision] * b), $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 + y \cdot z\right) + t \cdot a\right) + \left(z \cdot a\right) \cdot b\\
\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.8%
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%
*-commutative0.0%
associate-*l*33.3%
Simplified33.3%
Taylor expanded in z around inf 66.8%
Final simplification97.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.25e+185) (not (<= a 2.4e+172))) (* a (+ t (* z b))) (+ (+ x (* y z)) (+ (* z (* a b)) (* t a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.25e+185) || !(a <= 2.4e+172)) {
tmp = a * (t + (z * b));
} else {
tmp = (x + (y * z)) + ((z * (a * b)) + (t * a));
}
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.25d+185)) .or. (.not. (a <= 2.4d+172))) then
tmp = a * (t + (z * b))
else
tmp = (x + (y * z)) + ((z * (a * b)) + (t * a))
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.25e+185) || !(a <= 2.4e+172)) {
tmp = a * (t + (z * b));
} else {
tmp = (x + (y * z)) + ((z * (a * b)) + (t * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.25e+185) or not (a <= 2.4e+172): tmp = a * (t + (z * b)) else: tmp = (x + (y * z)) + ((z * (a * b)) + (t * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.25e+185) || !(a <= 2.4e+172)) tmp = Float64(a * Float64(t + Float64(z * b))); else tmp = Float64(Float64(x + Float64(y * z)) + Float64(Float64(z * Float64(a * b)) + Float64(t * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.25e+185) || ~((a <= 2.4e+172))) tmp = a * (t + (z * b)); else tmp = (x + (y * z)) + ((z * (a * b)) + (t * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.25e+185], N[Not[LessEqual[a, 2.4e+172]], $MachinePrecision]], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.25 \cdot 10^{+185} \lor \neg \left(a \leq 2.4 \cdot 10^{+172}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y \cdot z\right) + \left(z \cdot \left(a \cdot b\right) + t \cdot a\right)\\
\end{array}
\end{array}
if a < -1.24999999999999997e185 or 2.4000000000000001e172 < a Initial program 86.0%
associate-+l+86.0%
*-commutative86.0%
associate-*l*76.6%
Simplified76.6%
Taylor expanded in a around inf 96.0%
if -1.24999999999999997e185 < a < 2.4000000000000001e172Initial program 97.5%
associate-+l+97.5%
*-commutative97.5%
associate-*l*97.1%
Simplified97.1%
Final simplification96.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* y z) (* t a))))
(if (or (<= x -4.4e+76) (not (<= x 8e+49)))
(+ x t_1)
(+ (* (* z a) b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * z) + (t * a);
double tmp;
if ((x <= -4.4e+76) || !(x <= 8e+49)) {
tmp = x + t_1;
} else {
tmp = ((z * a) * b) + 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 = (y * z) + (t * a)
if ((x <= (-4.4d+76)) .or. (.not. (x <= 8d+49))) then
tmp = x + t_1
else
tmp = ((z * a) * b) + 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 = (y * z) + (t * a);
double tmp;
if ((x <= -4.4e+76) || !(x <= 8e+49)) {
tmp = x + t_1;
} else {
tmp = ((z * a) * b) + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y * z) + (t * a) tmp = 0 if (x <= -4.4e+76) or not (x <= 8e+49): tmp = x + t_1 else: tmp = ((z * a) * b) + t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * z) + Float64(t * a)) tmp = 0.0 if ((x <= -4.4e+76) || !(x <= 8e+49)) tmp = Float64(x + t_1); else tmp = Float64(Float64(Float64(z * a) * b) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (y * z) + (t * a); tmp = 0.0; if ((x <= -4.4e+76) || ~((x <= 8e+49))) tmp = x + t_1; else tmp = ((z * a) * b) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * z), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[x, -4.4e+76], N[Not[LessEqual[x, 8e+49]], $MachinePrecision]], N[(x + t$95$1), $MachinePrecision], N[(N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot z + t \cdot a\\
\mathbf{if}\;x \leq -4.4 \cdot 10^{+76} \lor \neg \left(x \leq 8 \cdot 10^{+49}\right):\\
\;\;\;\;x + t_1\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot a\right) \cdot b + t_1\\
\end{array}
\end{array}
if x < -4.4000000000000001e76 or 7.99999999999999957e49 < x Initial program 96.9%
associate-+l+96.9%
*-commutative96.9%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in b around 0 93.9%
if -4.4000000000000001e76 < x < 7.99999999999999957e49Initial program 94.3%
Taylor expanded in x around 0 89.1%
Final simplification90.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= a -1.5e+217)
t_1
(if (<= a -2.2e+99)
(* t a)
(if (<= a -5e-45)
t_1
(if (<= a -1.15e-213)
x
(if (<= a 1.15e-82) (* y z) (if (<= a 4.3e+77) x (* t a)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (a <= -1.5e+217) {
tmp = t_1;
} else if (a <= -2.2e+99) {
tmp = t * a;
} else if (a <= -5e-45) {
tmp = t_1;
} else if (a <= -1.15e-213) {
tmp = x;
} else if (a <= 1.15e-82) {
tmp = y * z;
} else if (a <= 4.3e+77) {
tmp = x;
} else {
tmp = t * a;
}
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 = a * (z * b)
if (a <= (-1.5d+217)) then
tmp = t_1
else if (a <= (-2.2d+99)) then
tmp = t * a
else if (a <= (-5d-45)) then
tmp = t_1
else if (a <= (-1.15d-213)) then
tmp = x
else if (a <= 1.15d-82) then
tmp = y * z
else if (a <= 4.3d+77) then
tmp = x
else
tmp = t * a
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 = a * (z * b);
double tmp;
if (a <= -1.5e+217) {
tmp = t_1;
} else if (a <= -2.2e+99) {
tmp = t * a;
} else if (a <= -5e-45) {
tmp = t_1;
} else if (a <= -1.15e-213) {
tmp = x;
} else if (a <= 1.15e-82) {
tmp = y * z;
} else if (a <= 4.3e+77) {
tmp = x;
} else {
tmp = t * a;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (z * b) tmp = 0 if a <= -1.5e+217: tmp = t_1 elif a <= -2.2e+99: tmp = t * a elif a <= -5e-45: tmp = t_1 elif a <= -1.15e-213: tmp = x elif a <= 1.15e-82: tmp = y * z elif a <= 4.3e+77: tmp = x else: tmp = t * a return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(z * b)) tmp = 0.0 if (a <= -1.5e+217) tmp = t_1; elseif (a <= -2.2e+99) tmp = Float64(t * a); elseif (a <= -5e-45) tmp = t_1; elseif (a <= -1.15e-213) tmp = x; elseif (a <= 1.15e-82) tmp = Float64(y * z); elseif (a <= 4.3e+77) tmp = x; else tmp = Float64(t * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (z * b); tmp = 0.0; if (a <= -1.5e+217) tmp = t_1; elseif (a <= -2.2e+99) tmp = t * a; elseif (a <= -5e-45) tmp = t_1; elseif (a <= -1.15e-213) tmp = x; elseif (a <= 1.15e-82) tmp = y * z; elseif (a <= 4.3e+77) tmp = x; else tmp = t * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.5e+217], t$95$1, If[LessEqual[a, -2.2e+99], N[(t * a), $MachinePrecision], If[LessEqual[a, -5e-45], t$95$1, If[LessEqual[a, -1.15e-213], x, If[LessEqual[a, 1.15e-82], N[(y * z), $MachinePrecision], If[LessEqual[a, 4.3e+77], x, N[(t * a), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;a \leq -1.5 \cdot 10^{+217}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -2.2 \cdot 10^{+99}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;a \leq -5 \cdot 10^{-45}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -1.15 \cdot 10^{-213}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.15 \cdot 10^{-82}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq 4.3 \cdot 10^{+77}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t \cdot a\\
\end{array}
\end{array}
if a < -1.49999999999999988e217 or -2.19999999999999978e99 < a < -4.99999999999999976e-45Initial program 89.7%
associate-+l+89.7%
*-commutative89.7%
associate-*l*85.9%
Simplified85.9%
Taylor expanded in a around inf 71.5%
Taylor expanded in t around 0 55.3%
if -1.49999999999999988e217 < a < -2.19999999999999978e99 or 4.29999999999999991e77 < a Initial program 92.2%
associate-+l+92.2%
*-commutative92.2%
associate-*l*86.2%
Simplified86.2%
Taylor expanded in t around inf 53.4%
if -4.99999999999999976e-45 < a < -1.15000000000000001e-213 or 1.14999999999999998e-82 < a < 4.29999999999999991e77Initial program 100.0%
associate-+l+100.0%
*-commutative100.0%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in x around inf 51.9%
if -1.15000000000000001e-213 < a < 1.14999999999999998e-82Initial program 98.4%
associate-+l+98.4%
*-commutative98.4%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in y around inf 51.9%
*-commutative51.9%
Simplified51.9%
Final simplification53.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* t a))) (t_2 (* a (* z b))))
(if (<= a -9.5e+216)
t_2
(if (<= a -2.3e+97)
t_1
(if (<= a -1.5e-33)
t_2
(if (or (<= a -9.7e-54) (not (<= a 3.05e+153)))
t_1
(+ x (* y z))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (t * a);
double t_2 = a * (z * b);
double tmp;
if (a <= -9.5e+216) {
tmp = t_2;
} else if (a <= -2.3e+97) {
tmp = t_1;
} else if (a <= -1.5e-33) {
tmp = t_2;
} else if ((a <= -9.7e-54) || !(a <= 3.05e+153)) {
tmp = t_1;
} else {
tmp = x + (y * z);
}
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 + (t * a)
t_2 = a * (z * b)
if (a <= (-9.5d+216)) then
tmp = t_2
else if (a <= (-2.3d+97)) then
tmp = t_1
else if (a <= (-1.5d-33)) then
tmp = t_2
else if ((a <= (-9.7d-54)) .or. (.not. (a <= 3.05d+153))) then
tmp = t_1
else
tmp = x + (y * z)
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 + (t * a);
double t_2 = a * (z * b);
double tmp;
if (a <= -9.5e+216) {
tmp = t_2;
} else if (a <= -2.3e+97) {
tmp = t_1;
} else if (a <= -1.5e-33) {
tmp = t_2;
} else if ((a <= -9.7e-54) || !(a <= 3.05e+153)) {
tmp = t_1;
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (t * a) t_2 = a * (z * b) tmp = 0 if a <= -9.5e+216: tmp = t_2 elif a <= -2.3e+97: tmp = t_1 elif a <= -1.5e-33: tmp = t_2 elif (a <= -9.7e-54) or not (a <= 3.05e+153): tmp = t_1 else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(t * a)) t_2 = Float64(a * Float64(z * b)) tmp = 0.0 if (a <= -9.5e+216) tmp = t_2; elseif (a <= -2.3e+97) tmp = t_1; elseif (a <= -1.5e-33) tmp = t_2; elseif ((a <= -9.7e-54) || !(a <= 3.05e+153)) tmp = t_1; else tmp = Float64(x + Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (t * a); t_2 = a * (z * b); tmp = 0.0; if (a <= -9.5e+216) tmp = t_2; elseif (a <= -2.3e+97) tmp = t_1; elseif (a <= -1.5e-33) tmp = t_2; elseif ((a <= -9.7e-54) || ~((a <= 3.05e+153))) tmp = t_1; else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -9.5e+216], t$95$2, If[LessEqual[a, -2.3e+97], t$95$1, If[LessEqual[a, -1.5e-33], t$95$2, If[Or[LessEqual[a, -9.7e-54], N[Not[LessEqual[a, 3.05e+153]], $MachinePrecision]], t$95$1, N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + t \cdot a\\
t_2 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;a \leq -9.5 \cdot 10^{+216}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq -2.3 \cdot 10^{+97}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -1.5 \cdot 10^{-33}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq -9.7 \cdot 10^{-54} \lor \neg \left(a \leq 3.05 \cdot 10^{+153}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -9.50000000000000005e216 or -2.30000000000000006e97 < a < -1.5000000000000001e-33Initial program 87.9%
associate-+l+87.9%
*-commutative87.9%
associate-*l*83.4%
Simplified83.4%
Taylor expanded in a around inf 74.2%
Taylor expanded in t around 0 61.9%
if -9.50000000000000005e216 < a < -2.30000000000000006e97 or -1.5000000000000001e-33 < a < -9.70000000000000047e-54 or 3.0499999999999999e153 < a Initial program 93.9%
associate-+l+93.9%
*-commutative93.9%
associate-*l*88.2%
Simplified88.2%
Taylor expanded in z around 0 68.7%
+-commutative68.7%
Simplified68.7%
if -9.70000000000000047e-54 < a < 3.0499999999999999e153Initial program 98.0%
associate-+l+98.0%
*-commutative98.0%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in a around 0 73.4%
Final simplification70.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ t (* z b)))))
(if (<= a -5.2e-45)
t_1
(if (<= a 1e-40)
(+ x (* y z))
(if (<= a 1.02e+70)
(+ x (* z (* a b)))
(if (<= a 1.45e+142) (+ (* y z) (* t a)) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (t + (z * b));
double tmp;
if (a <= -5.2e-45) {
tmp = t_1;
} else if (a <= 1e-40) {
tmp = x + (y * z);
} else if (a <= 1.02e+70) {
tmp = x + (z * (a * b));
} else if (a <= 1.45e+142) {
tmp = (y * z) + (t * a);
} 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 = a * (t + (z * b))
if (a <= (-5.2d-45)) then
tmp = t_1
else if (a <= 1d-40) then
tmp = x + (y * z)
else if (a <= 1.02d+70) then
tmp = x + (z * (a * b))
else if (a <= 1.45d+142) then
tmp = (y * z) + (t * a)
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 = a * (t + (z * b));
double tmp;
if (a <= -5.2e-45) {
tmp = t_1;
} else if (a <= 1e-40) {
tmp = x + (y * z);
} else if (a <= 1.02e+70) {
tmp = x + (z * (a * b));
} else if (a <= 1.45e+142) {
tmp = (y * z) + (t * a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (t + (z * b)) tmp = 0 if a <= -5.2e-45: tmp = t_1 elif a <= 1e-40: tmp = x + (y * z) elif a <= 1.02e+70: tmp = x + (z * (a * b)) elif a <= 1.45e+142: tmp = (y * z) + (t * a) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(t + Float64(z * b))) tmp = 0.0 if (a <= -5.2e-45) tmp = t_1; elseif (a <= 1e-40) tmp = Float64(x + Float64(y * z)); elseif (a <= 1.02e+70) tmp = Float64(x + Float64(z * Float64(a * b))); elseif (a <= 1.45e+142) tmp = Float64(Float64(y * z) + Float64(t * a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (t + (z * b)); tmp = 0.0; if (a <= -5.2e-45) tmp = t_1; elseif (a <= 1e-40) tmp = x + (y * z); elseif (a <= 1.02e+70) tmp = x + (z * (a * b)); elseif (a <= 1.45e+142) tmp = (y * z) + (t * a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -5.2e-45], t$95$1, If[LessEqual[a, 1e-40], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.02e+70], N[(x + N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.45e+142], N[(N[(y * z), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -5.2 \cdot 10^{-45}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 10^{-40}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{elif}\;a \leq 1.02 \cdot 10^{+70}:\\
\;\;\;\;x + z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;a \leq 1.45 \cdot 10^{+142}:\\
\;\;\;\;y \cdot z + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -5.19999999999999973e-45 or 1.45000000000000007e142 < a Initial program 90.6%
associate-+l+90.6%
*-commutative90.6%
associate-*l*86.4%
Simplified86.4%
Taylor expanded in a around inf 80.6%
if -5.19999999999999973e-45 < a < 9.9999999999999993e-41Initial program 99.1%
associate-+l+99.1%
*-commutative99.1%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in a around 0 80.1%
if 9.9999999999999993e-41 < a < 1.02e70Initial program 99.9%
associate-+l+99.9%
*-commutative99.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in t around 0 91.2%
+-commutative91.2%
associate-*r*91.0%
distribute-rgt-in91.0%
+-commutative91.0%
Simplified91.0%
Taylor expanded in y around 0 78.2%
if 1.02e70 < a < 1.45000000000000007e142Initial program 95.1%
associate-+l+95.1%
*-commutative95.1%
associate-*l*86.0%
Simplified86.0%
Taylor expanded in b around 0 90.8%
Taylor expanded in x around 0 72.2%
Final simplification79.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.25e-15) (not (<= a 2.15e+142))) (* a (+ t (* z b))) (+ x (+ (* y z) (* t a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.25e-15) || !(a <= 2.15e+142)) {
tmp = a * (t + (z * b));
} else {
tmp = x + ((y * z) + (t * a));
}
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.25d-15)) .or. (.not. (a <= 2.15d+142))) then
tmp = a * (t + (z * b))
else
tmp = x + ((y * z) + (t * a))
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.25e-15) || !(a <= 2.15e+142)) {
tmp = a * (t + (z * b));
} else {
tmp = x + ((y * z) + (t * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.25e-15) or not (a <= 2.15e+142): tmp = a * (t + (z * b)) else: tmp = x + ((y * z) + (t * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.25e-15) || !(a <= 2.15e+142)) tmp = Float64(a * Float64(t + Float64(z * b))); else tmp = Float64(x + Float64(Float64(y * z) + Float64(t * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.25e-15) || ~((a <= 2.15e+142))) tmp = a * (t + (z * b)); else tmp = x + ((y * z) + (t * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.25e-15], N[Not[LessEqual[a, 2.15e+142]], $MachinePrecision]], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.25 \cdot 10^{-15} \lor \neg \left(a \leq 2.15 \cdot 10^{+142}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y \cdot z + t \cdot a\right)\\
\end{array}
\end{array}
if a < -1.25e-15 or 2.15000000000000006e142 < a Initial program 89.5%
associate-+l+89.5%
*-commutative89.5%
associate-*l*84.8%
Simplified84.8%
Taylor expanded in a around inf 82.6%
if -1.25e-15 < a < 2.15000000000000006e142Initial program 98.7%
associate-+l+98.7%
*-commutative98.7%
associate-*l*98.1%
Simplified98.1%
Taylor expanded in b around 0 83.4%
Final simplification83.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -2.5e+124) (not (<= t 2.1e+37))) (+ x (+ (* y z) (* t a))) (+ x (* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.5e+124) || !(t <= 2.1e+37)) {
tmp = x + ((y * z) + (t * a));
} else {
tmp = x + (z * (y + (a * 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 ((t <= (-2.5d+124)) .or. (.not. (t <= 2.1d+37))) then
tmp = x + ((y * z) + (t * a))
else
tmp = x + (z * (y + (a * 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 ((t <= -2.5e+124) || !(t <= 2.1e+37)) {
tmp = x + ((y * z) + (t * a));
} else {
tmp = x + (z * (y + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -2.5e+124) or not (t <= 2.1e+37): tmp = x + ((y * z) + (t * a)) else: tmp = x + (z * (y + (a * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -2.5e+124) || !(t <= 2.1e+37)) tmp = Float64(x + Float64(Float64(y * z) + Float64(t * a))); else tmp = Float64(x + Float64(z * Float64(y + Float64(a * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -2.5e+124) || ~((t <= 2.1e+37))) tmp = x + ((y * z) + (t * a)); else tmp = x + (z * (y + (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -2.5e+124], N[Not[LessEqual[t, 2.1e+37]], $MachinePrecision]], N[(x + N[(N[(y * z), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{+124} \lor \neg \left(t \leq 2.1 \cdot 10^{+37}\right):\\
\;\;\;\;x + \left(y \cdot z + t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if t < -2.4999999999999998e124 or 2.1000000000000001e37 < t Initial program 95.6%
associate-+l+95.6%
*-commutative95.6%
associate-*l*93.6%
Simplified93.6%
Taylor expanded in b around 0 91.3%
if -2.4999999999999998e124 < t < 2.1000000000000001e37Initial program 95.2%
associate-+l+95.2%
*-commutative95.2%
associate-*l*92.9%
Simplified92.9%
Taylor expanded in t around 0 84.9%
+-commutative84.9%
associate-*r*86.0%
distribute-rgt-in87.8%
+-commutative87.8%
Simplified87.8%
Final simplification89.1%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -5.1e-45)
(* t a)
(if (<= a -1.7e-213)
x
(if (<= a 6e-83) (* y z) (if (<= a 8e+79) x (* t a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -5.1e-45) {
tmp = t * a;
} else if (a <= -1.7e-213) {
tmp = x;
} else if (a <= 6e-83) {
tmp = y * z;
} else if (a <= 8e+79) {
tmp = x;
} else {
tmp = t * a;
}
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 <= (-5.1d-45)) then
tmp = t * a
else if (a <= (-1.7d-213)) then
tmp = x
else if (a <= 6d-83) then
tmp = y * z
else if (a <= 8d+79) then
tmp = x
else
tmp = t * a
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 <= -5.1e-45) {
tmp = t * a;
} else if (a <= -1.7e-213) {
tmp = x;
} else if (a <= 6e-83) {
tmp = y * z;
} else if (a <= 8e+79) {
tmp = x;
} else {
tmp = t * a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -5.1e-45: tmp = t * a elif a <= -1.7e-213: tmp = x elif a <= 6e-83: tmp = y * z elif a <= 8e+79: tmp = x else: tmp = t * a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -5.1e-45) tmp = Float64(t * a); elseif (a <= -1.7e-213) tmp = x; elseif (a <= 6e-83) tmp = Float64(y * z); elseif (a <= 8e+79) tmp = x; else tmp = Float64(t * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -5.1e-45) tmp = t * a; elseif (a <= -1.7e-213) tmp = x; elseif (a <= 6e-83) tmp = y * z; elseif (a <= 8e+79) tmp = x; else tmp = t * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -5.1e-45], N[(t * a), $MachinePrecision], If[LessEqual[a, -1.7e-213], x, If[LessEqual[a, 6e-83], N[(y * z), $MachinePrecision], If[LessEqual[a, 8e+79], x, N[(t * a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.1 \cdot 10^{-45}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;a \leq -1.7 \cdot 10^{-213}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-83}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq 8 \cdot 10^{+79}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t \cdot a\\
\end{array}
\end{array}
if a < -5.0999999999999997e-45 or 7.99999999999999974e79 < a Initial program 91.2%
associate-+l+91.2%
*-commutative91.2%
associate-*l*86.1%
Simplified86.1%
Taylor expanded in t around inf 41.7%
if -5.0999999999999997e-45 < a < -1.7000000000000001e-213 or 6.00000000000000021e-83 < a < 7.99999999999999974e79Initial program 100.0%
associate-+l+100.0%
*-commutative100.0%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in x around inf 51.9%
if -1.7000000000000001e-213 < a < 6.00000000000000021e-83Initial program 98.4%
associate-+l+98.4%
*-commutative98.4%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in y around inf 51.9%
*-commutative51.9%
Simplified51.9%
Final simplification46.9%
(FPCore (x y z t a b) :precision binary64 (if (<= a -1.65e+217) (* a (* z b)) (if (or (<= a -1.3e+99) (not (<= a 6.5e+169))) (* t a) (+ x (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.65e+217) {
tmp = a * (z * b);
} else if ((a <= -1.3e+99) || !(a <= 6.5e+169)) {
tmp = t * a;
} else {
tmp = x + (y * z);
}
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.65d+217)) then
tmp = a * (z * b)
else if ((a <= (-1.3d+99)) .or. (.not. (a <= 6.5d+169))) then
tmp = t * a
else
tmp = x + (y * z)
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.65e+217) {
tmp = a * (z * b);
} else if ((a <= -1.3e+99) || !(a <= 6.5e+169)) {
tmp = t * a;
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.65e+217: tmp = a * (z * b) elif (a <= -1.3e+99) or not (a <= 6.5e+169): tmp = t * a else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.65e+217) tmp = Float64(a * Float64(z * b)); elseif ((a <= -1.3e+99) || !(a <= 6.5e+169)) tmp = Float64(t * a); else tmp = Float64(x + Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -1.65e+217) tmp = a * (z * b); elseif ((a <= -1.3e+99) || ~((a <= 6.5e+169))) tmp = t * a; else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.65e+217], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, -1.3e+99], N[Not[LessEqual[a, 6.5e+169]], $MachinePrecision]], N[(t * a), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.65 \cdot 10^{+217}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;a \leq -1.3 \cdot 10^{+99} \lor \neg \left(a \leq 6.5 \cdot 10^{+169}\right):\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -1.65e217Initial program 77.7%
associate-+l+77.7%
*-commutative77.7%
associate-*l*63.4%
Simplified63.4%
Taylor expanded in a around inf 92.6%
Taylor expanded in t around 0 77.9%
if -1.65e217 < a < -1.3e99 or 6.4999999999999995e169 < a Initial program 92.0%
associate-+l+92.0%
*-commutative92.0%
associate-*l*84.7%
Simplified84.7%
Taylor expanded in t around inf 65.4%
if -1.3e99 < a < 6.4999999999999995e169Initial program 97.3%
associate-+l+97.3%
*-commutative97.3%
associate-*l*97.4%
Simplified97.4%
Taylor expanded in a around 0 66.6%
Final simplification66.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -5.2e-45) (not (<= a 4.6e+94))) (* a (+ t (* z b))) (+ x (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -5.2e-45) || !(a <= 4.6e+94)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (y * z);
}
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 <= (-5.2d-45)) .or. (.not. (a <= 4.6d+94))) then
tmp = a * (t + (z * b))
else
tmp = x + (y * z)
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 <= -5.2e-45) || !(a <= 4.6e+94)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -5.2e-45) or not (a <= 4.6e+94): tmp = a * (t + (z * b)) else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -5.2e-45) || !(a <= 4.6e+94)) tmp = Float64(a * Float64(t + Float64(z * b))); else tmp = Float64(x + Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -5.2e-45) || ~((a <= 4.6e+94))) tmp = a * (t + (z * b)); else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -5.2e-45], N[Not[LessEqual[a, 4.6e+94]], $MachinePrecision]], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.2 \cdot 10^{-45} \lor \neg \left(a \leq 4.6 \cdot 10^{+94}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -5.19999999999999973e-45 or 4.5999999999999999e94 < a Initial program 90.5%
associate-+l+90.5%
*-commutative90.5%
associate-*l*85.8%
Simplified85.8%
Taylor expanded in a around inf 78.7%
if -5.19999999999999973e-45 < a < 4.5999999999999999e94Initial program 99.3%
associate-+l+99.3%
*-commutative99.3%
associate-*l*99.2%
Simplified99.2%
Taylor expanded in a around 0 75.8%
Final simplification77.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -4.1e-45) (not (<= a 1.6e+81))) (* t a) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -4.1e-45) || !(a <= 1.6e+81)) {
tmp = t * a;
} 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 <= (-4.1d-45)) .or. (.not. (a <= 1.6d+81))) then
tmp = t * a
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 <= -4.1e-45) || !(a <= 1.6e+81)) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -4.1e-45) or not (a <= 1.6e+81): tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -4.1e-45) || !(a <= 1.6e+81)) tmp = Float64(t * a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -4.1e-45) || ~((a <= 1.6e+81))) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -4.1e-45], N[Not[LessEqual[a, 1.6e+81]], $MachinePrecision]], N[(t * a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.1 \cdot 10^{-45} \lor \neg \left(a \leq 1.6 \cdot 10^{+81}\right):\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -4.0999999999999999e-45 or 1.6e81 < a Initial program 91.2%
associate-+l+91.2%
*-commutative91.2%
associate-*l*86.1%
Simplified86.1%
Taylor expanded in t around inf 41.7%
if -4.0999999999999999e-45 < a < 1.6e81Initial program 99.2%
associate-+l+99.2%
*-commutative99.2%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in x around inf 42.3%
Final simplification42.0%
(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 95.3%
associate-+l+95.3%
*-commutative95.3%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in x around inf 27.0%
Final simplification27.0%
(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 2023318
(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)))