
(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 (or (<= z -5e+67) (not (<= z 4e+46))) (* z (+ y (+ (/ x z) (* a (+ b (/ t z)))))) (+ (fma y z x) (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -5e+67) || !(z <= 4e+46)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} else {
tmp = fma(y, z, x) + (a * (t + (z * b)));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -5e+67) || !(z <= 4e+46)) tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * Float64(b + Float64(t / z)))))); else tmp = Float64(fma(y, z, x) + Float64(a * Float64(t + Float64(z * b)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -5e+67], N[Not[LessEqual[z, 4e+46]], $MachinePrecision]], N[(z * N[(y + N[(N[(x / z), $MachinePrecision] + N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * z + x), $MachinePrecision] + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+67} \lor \neg \left(z \leq 4 \cdot 10^{+46}\right):\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if z < -4.99999999999999976e67 or 4e46 < z Initial program 80.6%
associate-+l+80.6%
associate-*l*77.9%
Simplified77.9%
Taylor expanded in z around inf 98.2%
+-commutative98.2%
associate-+l+98.2%
+-commutative98.2%
associate-/l*100.0%
distribute-lft-out100.0%
Simplified100.0%
if -4.99999999999999976e67 < z < 4e46Initial program 97.9%
associate-+l+97.9%
+-commutative97.9%
fma-define97.9%
associate-*l*98.6%
*-commutative98.6%
*-commutative98.6%
distribute-rgt-out100.0%
remove-double-neg100.0%
*-commutative100.0%
distribute-lft-neg-out100.0%
sub-neg100.0%
sub-neg100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
remove-double-neg100.0%
*-commutative100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (* z a))))
(if (<= b -1.05e+75)
t_1
(if (<= b -3.8e-144)
x
(if (<= b -4.5e-249)
(* z y)
(if (<= b -1.28e-307)
x
(if (<= b 1.1e-86) (* z y) (if (<= b 2.2e+121) (* a t) t_1))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (z * a);
double tmp;
if (b <= -1.05e+75) {
tmp = t_1;
} else if (b <= -3.8e-144) {
tmp = x;
} else if (b <= -4.5e-249) {
tmp = z * y;
} else if (b <= -1.28e-307) {
tmp = x;
} else if (b <= 1.1e-86) {
tmp = z * y;
} else if (b <= 2.2e+121) {
tmp = a * t;
} 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 = b * (z * a)
if (b <= (-1.05d+75)) then
tmp = t_1
else if (b <= (-3.8d-144)) then
tmp = x
else if (b <= (-4.5d-249)) then
tmp = z * y
else if (b <= (-1.28d-307)) then
tmp = x
else if (b <= 1.1d-86) then
tmp = z * y
else if (b <= 2.2d+121) then
tmp = a * t
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 = b * (z * a);
double tmp;
if (b <= -1.05e+75) {
tmp = t_1;
} else if (b <= -3.8e-144) {
tmp = x;
} else if (b <= -4.5e-249) {
tmp = z * y;
} else if (b <= -1.28e-307) {
tmp = x;
} else if (b <= 1.1e-86) {
tmp = z * y;
} else if (b <= 2.2e+121) {
tmp = a * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (z * a) tmp = 0 if b <= -1.05e+75: tmp = t_1 elif b <= -3.8e-144: tmp = x elif b <= -4.5e-249: tmp = z * y elif b <= -1.28e-307: tmp = x elif b <= 1.1e-86: tmp = z * y elif b <= 2.2e+121: tmp = a * t else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(z * a)) tmp = 0.0 if (b <= -1.05e+75) tmp = t_1; elseif (b <= -3.8e-144) tmp = x; elseif (b <= -4.5e-249) tmp = Float64(z * y); elseif (b <= -1.28e-307) tmp = x; elseif (b <= 1.1e-86) tmp = Float64(z * y); elseif (b <= 2.2e+121) tmp = Float64(a * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (z * a); tmp = 0.0; if (b <= -1.05e+75) tmp = t_1; elseif (b <= -3.8e-144) tmp = x; elseif (b <= -4.5e-249) tmp = z * y; elseif (b <= -1.28e-307) tmp = x; elseif (b <= 1.1e-86) tmp = z * y; elseif (b <= 2.2e+121) tmp = a * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.05e+75], t$95$1, If[LessEqual[b, -3.8e-144], x, If[LessEqual[b, -4.5e-249], N[(z * y), $MachinePrecision], If[LessEqual[b, -1.28e-307], x, If[LessEqual[b, 1.1e-86], N[(z * y), $MachinePrecision], If[LessEqual[b, 2.2e+121], N[(a * t), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(z \cdot a\right)\\
\mathbf{if}\;b \leq -1.05 \cdot 10^{+75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -3.8 \cdot 10^{-144}:\\
\;\;\;\;x\\
\mathbf{elif}\;b \leq -4.5 \cdot 10^{-249}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;b \leq -1.28 \cdot 10^{-307}:\\
\;\;\;\;x\\
\mathbf{elif}\;b \leq 1.1 \cdot 10^{-86}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;b \leq 2.2 \cdot 10^{+121}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.04999999999999999e75 or 2.20000000000000001e121 < b Initial program 90.7%
associate-+l+90.7%
associate-*l*77.5%
Simplified77.5%
Taylor expanded in a around inf 64.6%
Taylor expanded in t around 0 50.3%
*-commutative50.3%
associate-*r*54.5%
Simplified54.5%
if -1.04999999999999999e75 < b < -3.79999999999999993e-144 or -4.49999999999999981e-249 < b < -1.28e-307Initial program 90.2%
associate-+l+90.2%
associate-*l*96.7%
Simplified96.7%
Taylor expanded in x around inf 46.6%
if -3.79999999999999993e-144 < b < -4.49999999999999981e-249 or -1.28e-307 < b < 1.1000000000000001e-86Initial program 91.0%
associate-+l+91.0%
associate-*l*98.4%
Simplified98.4%
Taylor expanded in y around inf 57.1%
*-commutative57.1%
Simplified57.1%
if 1.1000000000000001e-86 < b < 2.20000000000000001e121Initial program 89.1%
associate-+l+89.1%
associate-*l*91.0%
Simplified91.0%
Taylor expanded in t around inf 40.3%
Final simplification50.8%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (+ x (* z y)) (* a t)) (* b (* z a))))) (if (<= t_1 1e+303) t_1 (* z (+ y (+ (/ x z) (* a (+ b (/ t z)))))))))
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 <= 1e+303) {
tmp = t_1;
} else {
tmp = z * (y + ((x / z) + (a * (b + (t / 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) :: tmp
t_1 = ((x + (z * y)) + (a * t)) + (b * (z * a))
if (t_1 <= 1d+303) then
tmp = t_1
else
tmp = z * (y + ((x / z) + (a * (b + (t / 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 + (z * y)) + (a * t)) + (b * (z * a));
double tmp;
if (t_1 <= 1e+303) {
tmp = t_1;
} else {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
}
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 <= 1e+303: tmp = t_1 else: tmp = z * (y + ((x / z) + (a * (b + (t / z))))) 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 <= 1e+303) tmp = t_1; else tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * Float64(b + Float64(t / z)))))); 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 <= 1e+303) tmp = t_1; else tmp = z * (y + ((x / z) + (a * (b + (t / z))))); 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, 1e+303], t$95$1, N[(z * N[(y + N[(N[(x / z), $MachinePrecision] + N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 10^{+303}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < 1e303Initial program 98.5%
if 1e303 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 62.0%
associate-+l+62.0%
associate-*l*70.2%
Simplified70.2%
Taylor expanded in z around inf 86.0%
+-commutative86.0%
associate-+l+86.0%
+-commutative86.0%
associate-/l*89.4%
distribute-lft-out94.7%
Simplified94.7%
Final simplification97.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -4.2e+64)
x
(if (<= x -2e-225)
(* z y)
(if (<= x -2e-298)
(* a t)
(if (<= x 1.6e-188)
(* z y)
(if (<= x 2.45e-141) (* a t) (if (<= x 2.35e+154) (* z y) x)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -4.2e+64) {
tmp = x;
} else if (x <= -2e-225) {
tmp = z * y;
} else if (x <= -2e-298) {
tmp = a * t;
} else if (x <= 1.6e-188) {
tmp = z * y;
} else if (x <= 2.45e-141) {
tmp = a * t;
} else if (x <= 2.35e+154) {
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 (x <= (-4.2d+64)) then
tmp = x
else if (x <= (-2d-225)) then
tmp = z * y
else if (x <= (-2d-298)) then
tmp = a * t
else if (x <= 1.6d-188) then
tmp = z * y
else if (x <= 2.45d-141) then
tmp = a * t
else if (x <= 2.35d+154) 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 (x <= -4.2e+64) {
tmp = x;
} else if (x <= -2e-225) {
tmp = z * y;
} else if (x <= -2e-298) {
tmp = a * t;
} else if (x <= 1.6e-188) {
tmp = z * y;
} else if (x <= 2.45e-141) {
tmp = a * t;
} else if (x <= 2.35e+154) {
tmp = z * y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -4.2e+64: tmp = x elif x <= -2e-225: tmp = z * y elif x <= -2e-298: tmp = a * t elif x <= 1.6e-188: tmp = z * y elif x <= 2.45e-141: tmp = a * t elif x <= 2.35e+154: tmp = z * y else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -4.2e+64) tmp = x; elseif (x <= -2e-225) tmp = Float64(z * y); elseif (x <= -2e-298) tmp = Float64(a * t); elseif (x <= 1.6e-188) tmp = Float64(z * y); elseif (x <= 2.45e-141) tmp = Float64(a * t); elseif (x <= 2.35e+154) 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 (x <= -4.2e+64) tmp = x; elseif (x <= -2e-225) tmp = z * y; elseif (x <= -2e-298) tmp = a * t; elseif (x <= 1.6e-188) tmp = z * y; elseif (x <= 2.45e-141) tmp = a * t; elseif (x <= 2.35e+154) tmp = z * y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -4.2e+64], x, If[LessEqual[x, -2e-225], N[(z * y), $MachinePrecision], If[LessEqual[x, -2e-298], N[(a * t), $MachinePrecision], If[LessEqual[x, 1.6e-188], N[(z * y), $MachinePrecision], If[LessEqual[x, 2.45e-141], N[(a * t), $MachinePrecision], If[LessEqual[x, 2.35e+154], N[(z * y), $MachinePrecision], x]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.2 \cdot 10^{+64}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-225}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-298}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{-188}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;x \leq 2.45 \cdot 10^{-141}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;x \leq 2.35 \cdot 10^{+154}:\\
\;\;\;\;z \cdot y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -4.2000000000000001e64 or 2.34999999999999992e154 < x Initial program 96.4%
associate-+l+96.4%
associate-*l*91.8%
Simplified91.8%
Taylor expanded in x around inf 60.3%
if -4.2000000000000001e64 < x < -1.9999999999999999e-225 or -1.99999999999999982e-298 < x < 1.60000000000000011e-188 or 2.45000000000000003e-141 < x < 2.34999999999999992e154Initial program 89.2%
associate-+l+89.2%
associate-*l*89.3%
Simplified89.3%
Taylor expanded in y around inf 44.7%
*-commutative44.7%
Simplified44.7%
if -1.9999999999999999e-225 < x < -1.99999999999999982e-298 or 1.60000000000000011e-188 < x < 2.45000000000000003e-141Initial program 77.6%
associate-+l+77.6%
associate-*l*84.5%
Simplified84.5%
Taylor expanded in t around inf 65.3%
Final simplification51.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -2.9e+139)
x
(if (<= x -1.22e+103)
(* a (* z b))
(if (<= x -2.2e+55)
(* a t)
(if (<= x -1e-225)
(* z y)
(if (<= x -2.05e-296) (* a t) (if (<= x 2.05e+155) (* z y) x)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.9e+139) {
tmp = x;
} else if (x <= -1.22e+103) {
tmp = a * (z * b);
} else if (x <= -2.2e+55) {
tmp = a * t;
} else if (x <= -1e-225) {
tmp = z * y;
} else if (x <= -2.05e-296) {
tmp = a * t;
} else if (x <= 2.05e+155) {
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 (x <= (-2.9d+139)) then
tmp = x
else if (x <= (-1.22d+103)) then
tmp = a * (z * b)
else if (x <= (-2.2d+55)) then
tmp = a * t
else if (x <= (-1d-225)) then
tmp = z * y
else if (x <= (-2.05d-296)) then
tmp = a * t
else if (x <= 2.05d+155) 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 (x <= -2.9e+139) {
tmp = x;
} else if (x <= -1.22e+103) {
tmp = a * (z * b);
} else if (x <= -2.2e+55) {
tmp = a * t;
} else if (x <= -1e-225) {
tmp = z * y;
} else if (x <= -2.05e-296) {
tmp = a * t;
} else if (x <= 2.05e+155) {
tmp = z * y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -2.9e+139: tmp = x elif x <= -1.22e+103: tmp = a * (z * b) elif x <= -2.2e+55: tmp = a * t elif x <= -1e-225: tmp = z * y elif x <= -2.05e-296: tmp = a * t elif x <= 2.05e+155: tmp = z * y else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2.9e+139) tmp = x; elseif (x <= -1.22e+103) tmp = Float64(a * Float64(z * b)); elseif (x <= -2.2e+55) tmp = Float64(a * t); elseif (x <= -1e-225) tmp = Float64(z * y); elseif (x <= -2.05e-296) tmp = Float64(a * t); elseif (x <= 2.05e+155) 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 (x <= -2.9e+139) tmp = x; elseif (x <= -1.22e+103) tmp = a * (z * b); elseif (x <= -2.2e+55) tmp = a * t; elseif (x <= -1e-225) tmp = z * y; elseif (x <= -2.05e-296) tmp = a * t; elseif (x <= 2.05e+155) tmp = z * y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.9e+139], x, If[LessEqual[x, -1.22e+103], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.2e+55], N[(a * t), $MachinePrecision], If[LessEqual[x, -1e-225], N[(z * y), $MachinePrecision], If[LessEqual[x, -2.05e-296], N[(a * t), $MachinePrecision], If[LessEqual[x, 2.05e+155], N[(z * y), $MachinePrecision], x]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.9 \cdot 10^{+139}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -1.22 \cdot 10^{+103}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;x \leq -2.2 \cdot 10^{+55}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;x \leq -1 \cdot 10^{-225}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;x \leq -2.05 \cdot 10^{-296}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;x \leq 2.05 \cdot 10^{+155}:\\
\;\;\;\;z \cdot y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.8999999999999999e139 or 2.0499999999999999e155 < x Initial program 96.8%
associate-+l+96.8%
associate-*l*93.7%
Simplified93.7%
Taylor expanded in x around inf 70.8%
if -2.8999999999999999e139 < x < -1.22e103Initial program 87.5%
associate-+l+87.5%
associate-*l*75.0%
Simplified75.0%
Taylor expanded in a around inf 87.5%
Taylor expanded in t around 0 75.1%
*-commutative75.1%
Simplified75.1%
if -1.22e103 < x < -2.2000000000000001e55 or -9.9999999999999996e-226 < x < -2.04999999999999997e-296Initial program 90.0%
associate-+l+90.0%
associate-*l*89.7%
Simplified89.7%
Taylor expanded in t around inf 56.4%
if -2.2000000000000001e55 < x < -9.9999999999999996e-226 or -2.04999999999999997e-296 < x < 2.0499999999999999e155Initial program 88.1%
associate-+l+88.1%
associate-*l*88.7%
Simplified88.7%
Taylor expanded in y around inf 41.8%
*-commutative41.8%
Simplified41.8%
Final simplification51.5%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= a -1.8e+148)
(and (not (<= a -1.3e+81)) (or (<= a -2e-33) (not (<= a 6.2e-63)))))
(* a (+ t (* z b)))
(+ x (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.8e+148) || (!(a <= -1.3e+81) && ((a <= -2e-33) || !(a <= 6.2e-63)))) {
tmp = a * (t + (z * b));
} 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 <= (-1.8d+148)) .or. (.not. (a <= (-1.3d+81))) .and. (a <= (-2d-33)) .or. (.not. (a <= 6.2d-63))) then
tmp = a * (t + (z * b))
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 <= -1.8e+148) || (!(a <= -1.3e+81) && ((a <= -2e-33) || !(a <= 6.2e-63)))) {
tmp = a * (t + (z * b));
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.8e+148) or (not (a <= -1.3e+81) and ((a <= -2e-33) or not (a <= 6.2e-63))): tmp = a * (t + (z * b)) else: tmp = x + (z * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.8e+148) || (!(a <= -1.3e+81) && ((a <= -2e-33) || !(a <= 6.2e-63)))) tmp = Float64(a * Float64(t + Float64(z * b))); 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 <= -1.8e+148) || (~((a <= -1.3e+81)) && ((a <= -2e-33) || ~((a <= 6.2e-63))))) tmp = a * (t + (z * b)); else tmp = x + (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.8e+148], And[N[Not[LessEqual[a, -1.3e+81]], $MachinePrecision], Or[LessEqual[a, -2e-33], N[Not[LessEqual[a, 6.2e-63]], $MachinePrecision]]]], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.8 \cdot 10^{+148} \lor \neg \left(a \leq -1.3 \cdot 10^{+81}\right) \land \left(a \leq -2 \cdot 10^{-33} \lor \neg \left(a \leq 6.2 \cdot 10^{-63}\right)\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -1.80000000000000003e148 or -1.29999999999999996e81 < a < -2.0000000000000001e-33 or 6.19999999999999968e-63 < a Initial program 82.2%
associate-+l+82.2%
associate-*l*89.3%
Simplified89.3%
Taylor expanded in a around inf 77.1%
if -1.80000000000000003e148 < a < -1.29999999999999996e81 or -2.0000000000000001e-33 < a < 6.19999999999999968e-63Initial program 99.2%
associate-+l+99.2%
associate-*l*89.9%
Simplified89.9%
Taylor expanded in a around 0 82.4%
Final simplification79.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -5.5e+164)
(* a t)
(if (or (<= a 1e+21) (and (not (<= a 3.5e+122)) (<= a 8.5e+163)))
(+ x (* z y))
(* a (* z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -5.5e+164) {
tmp = a * t;
} else if ((a <= 1e+21) || (!(a <= 3.5e+122) && (a <= 8.5e+163))) {
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 <= (-5.5d+164)) then
tmp = a * t
else if ((a <= 1d+21) .or. (.not. (a <= 3.5d+122)) .and. (a <= 8.5d+163)) 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 <= -5.5e+164) {
tmp = a * t;
} else if ((a <= 1e+21) || (!(a <= 3.5e+122) && (a <= 8.5e+163))) {
tmp = x + (z * y);
} else {
tmp = a * (z * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -5.5e+164: tmp = a * t elif (a <= 1e+21) or (not (a <= 3.5e+122) and (a <= 8.5e+163)): tmp = x + (z * y) else: tmp = a * (z * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -5.5e+164) tmp = Float64(a * t); elseif ((a <= 1e+21) || (!(a <= 3.5e+122) && (a <= 8.5e+163))) 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 <= -5.5e+164) tmp = a * t; elseif ((a <= 1e+21) || (~((a <= 3.5e+122)) && (a <= 8.5e+163))) tmp = x + (z * y); else tmp = a * (z * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -5.5e+164], N[(a * t), $MachinePrecision], If[Or[LessEqual[a, 1e+21], And[N[Not[LessEqual[a, 3.5e+122]], $MachinePrecision], LessEqual[a, 8.5e+163]]], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.5 \cdot 10^{+164}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq 10^{+21} \lor \neg \left(a \leq 3.5 \cdot 10^{+122}\right) \land a \leq 8.5 \cdot 10^{+163}:\\
\;\;\;\;x + z \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\end{array}
\end{array}
if a < -5.4999999999999998e164Initial program 71.3%
associate-+l+71.3%
associate-*l*80.6%
Simplified80.6%
Taylor expanded in t around inf 67.0%
if -5.4999999999999998e164 < a < 1e21 or 3.50000000000000014e122 < a < 8.5000000000000003e163Initial program 97.7%
associate-+l+97.7%
associate-*l*91.9%
Simplified91.9%
Taylor expanded in a around 0 70.2%
if 1e21 < a < 3.50000000000000014e122 or 8.5000000000000003e163 < a Initial program 74.2%
associate-+l+74.2%
associate-*l*86.6%
Simplified86.6%
Taylor expanded in a around inf 89.3%
Taylor expanded in t around 0 63.4%
*-commutative63.4%
Simplified63.4%
Final simplification68.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.25e-60) (not (<= z 1.8e-82))) (* z (+ y (+ (/ x z) (* a (+ b (/ t z)))))) (+ x (+ (* a t) (* z y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.25e-60) || !(z <= 1.8e-82)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} 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 <= (-2.25d-60)) .or. (.not. (z <= 1.8d-82))) then
tmp = z * (y + ((x / z) + (a * (b + (t / z)))))
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 <= -2.25e-60) || !(z <= 1.8e-82)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} else {
tmp = x + ((a * t) + (z * y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.25e-60) or not (z <= 1.8e-82): tmp = z * (y + ((x / z) + (a * (b + (t / z))))) else: tmp = x + ((a * t) + (z * y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.25e-60) || !(z <= 1.8e-82)) tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * Float64(b + Float64(t / z)))))); 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 <= -2.25e-60) || ~((z <= 1.8e-82))) tmp = z * (y + ((x / z) + (a * (b + (t / z))))); else tmp = x + ((a * t) + (z * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.25e-60], N[Not[LessEqual[z, 1.8e-82]], $MachinePrecision]], N[(z * N[(y + N[(N[(x / z), $MachinePrecision] + N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 -2.25 \cdot 10^{-60} \lor \neg \left(z \leq 1.8 \cdot 10^{-82}\right):\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(a \cdot t + z \cdot y\right)\\
\end{array}
\end{array}
if z < -2.25e-60 or 1.79999999999999999e-82 < z Initial program 85.9%
associate-+l+85.9%
associate-*l*84.7%
Simplified84.7%
Taylor expanded in z around inf 95.9%
+-commutative95.9%
associate-+l+95.9%
+-commutative95.9%
associate-/l*97.1%
distribute-lft-out97.7%
Simplified97.7%
if -2.25e-60 < z < 1.79999999999999999e-82Initial program 98.8%
associate-+l+98.8%
associate-*l*98.8%
Simplified98.8%
Taylor expanded in b around 0 90.3%
Final simplification95.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.65e+65) (not (<= z 8e+46))) (* z (+ y (+ (/ x z) (* a (+ b (/ t z)))))) (+ (+ x (* z y)) (+ (* a (* z b)) (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.65e+65) || !(z <= 8e+46)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} else {
tmp = (x + (z * y)) + ((a * (z * b)) + (a * t));
}
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 <= (-1.65d+65)) .or. (.not. (z <= 8d+46))) then
tmp = z * (y + ((x / z) + (a * (b + (t / z)))))
else
tmp = (x + (z * y)) + ((a * (z * b)) + (a * t))
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 <= -1.65e+65) || !(z <= 8e+46)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} else {
tmp = (x + (z * y)) + ((a * (z * b)) + (a * t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.65e+65) or not (z <= 8e+46): tmp = z * (y + ((x / z) + (a * (b + (t / z))))) else: tmp = (x + (z * y)) + ((a * (z * b)) + (a * t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.65e+65) || !(z <= 8e+46)) tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * Float64(b + Float64(t / z)))))); else tmp = Float64(Float64(x + Float64(z * y)) + Float64(Float64(a * Float64(z * b)) + Float64(a * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.65e+65) || ~((z <= 8e+46))) tmp = z * (y + ((x / z) + (a * (b + (t / z))))); else tmp = (x + (z * y)) + ((a * (z * b)) + (a * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.65e+65], N[Not[LessEqual[z, 8e+46]], $MachinePrecision]], N[(z * N[(y + N[(N[(x / z), $MachinePrecision] + N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision] + N[(N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{+65} \lor \neg \left(z \leq 8 \cdot 10^{+46}\right):\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + z \cdot y\right) + \left(a \cdot \left(z \cdot b\right) + a \cdot t\right)\\
\end{array}
\end{array}
if z < -1.65000000000000012e65 or 7.9999999999999999e46 < z Initial program 80.6%
associate-+l+80.6%
associate-*l*77.9%
Simplified77.9%
Taylor expanded in z around inf 98.2%
+-commutative98.2%
associate-+l+98.2%
+-commutative98.2%
associate-/l*100.0%
distribute-lft-out100.0%
Simplified100.0%
if -1.65000000000000012e65 < z < 7.9999999999999999e46Initial program 97.9%
associate-+l+97.9%
associate-*l*98.6%
Simplified98.6%
Final simplification99.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* a t))))
(if (<= a -8.5e+57)
t_1
(if (<= a 1.5e+117)
(+ x (* z y))
(if (<= a 4.8e+204) t_1 (* a (* z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (a * t);
double tmp;
if (a <= -8.5e+57) {
tmp = t_1;
} else if (a <= 1.5e+117) {
tmp = x + (z * y);
} else if (a <= 4.8e+204) {
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) :: tmp
t_1 = x + (a * t)
if (a <= (-8.5d+57)) then
tmp = t_1
else if (a <= 1.5d+117) then
tmp = x + (z * y)
else if (a <= 4.8d+204) 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 + (a * t);
double tmp;
if (a <= -8.5e+57) {
tmp = t_1;
} else if (a <= 1.5e+117) {
tmp = x + (z * y);
} else if (a <= 4.8e+204) {
tmp = t_1;
} else {
tmp = a * (z * b);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (a * t) tmp = 0 if a <= -8.5e+57: tmp = t_1 elif a <= 1.5e+117: tmp = x + (z * y) elif a <= 4.8e+204: tmp = t_1 else: tmp = a * (z * b) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(a * t)) tmp = 0.0 if (a <= -8.5e+57) tmp = t_1; elseif (a <= 1.5e+117) tmp = Float64(x + Float64(z * y)); elseif (a <= 4.8e+204) 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 + (a * t); tmp = 0.0; if (a <= -8.5e+57) tmp = t_1; elseif (a <= 1.5e+117) tmp = x + (z * y); elseif (a <= 4.8e+204) 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[(a * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -8.5e+57], t$95$1, If[LessEqual[a, 1.5e+117], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.8e+204], t$95$1, N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + a \cdot t\\
\mathbf{if}\;a \leq -8.5 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.5 \cdot 10^{+117}:\\
\;\;\;\;x + z \cdot y\\
\mathbf{elif}\;a \leq 4.8 \cdot 10^{+204}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\end{array}
\end{array}
if a < -8.5000000000000001e57 or 1.5e117 < a < 4.7999999999999999e204Initial program 83.8%
associate-+l+83.8%
associate-*l*89.9%
Simplified89.9%
Taylor expanded in z around 0 67.4%
+-commutative67.4%
Simplified67.4%
if -8.5000000000000001e57 < a < 1.5e117Initial program 97.4%
associate-+l+97.4%
associate-*l*90.6%
Simplified90.6%
Taylor expanded in a around 0 70.4%
if 4.7999999999999999e204 < a Initial program 65.0%
associate-+l+65.0%
associate-*l*81.7%
Simplified81.7%
Taylor expanded in a around inf 95.8%
Taylor expanded in t around 0 73.8%
*-commutative73.8%
Simplified73.8%
Final simplification69.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -4e+148) (not (<= a 1.4e+159))) (* a (+ t (* z b))) (+ x (+ (* a t) (* z y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -4e+148) || !(a <= 1.4e+159)) {
tmp = a * (t + (z * 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 ((a <= (-4d+148)) .or. (.not. (a <= 1.4d+159))) then
tmp = a * (t + (z * 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 ((a <= -4e+148) || !(a <= 1.4e+159)) {
tmp = a * (t + (z * b));
} else {
tmp = x + ((a * t) + (z * y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -4e+148) or not (a <= 1.4e+159): tmp = a * (t + (z * b)) else: tmp = x + ((a * t) + (z * y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -4e+148) || !(a <= 1.4e+159)) tmp = Float64(a * Float64(t + Float64(z * 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 ((a <= -4e+148) || ~((a <= 1.4e+159))) tmp = a * (t + (z * b)); else tmp = x + ((a * t) + (z * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -4e+148], N[Not[LessEqual[a, 1.4e+159]], $MachinePrecision]], N[(a * N[(t + N[(z * 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}\;a \leq -4 \cdot 10^{+148} \lor \neg \left(a \leq 1.4 \cdot 10^{+159}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(a \cdot t + z \cdot y\right)\\
\end{array}
\end{array}
if a < -4.0000000000000002e148 or 1.4000000000000001e159 < a Initial program 70.7%
associate-+l+70.7%
associate-*l*82.5%
Simplified82.5%
Taylor expanded in a around inf 91.3%
if -4.0000000000000002e148 < a < 1.4000000000000001e159Initial program 96.8%
associate-+l+96.8%
associate-*l*91.9%
Simplified91.9%
Taylor expanded in b around 0 82.3%
Final simplification84.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -8.2e+60) (not (<= t 3.7e+98))) (+ x (+ (* a t) (* z y))) (+ x (* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -8.2e+60) || !(t <= 3.7e+98)) {
tmp = x + ((a * t) + (z * y));
} 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 <= (-8.2d+60)) .or. (.not. (t <= 3.7d+98))) then
tmp = x + ((a * t) + (z * y))
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 <= -8.2e+60) || !(t <= 3.7e+98)) {
tmp = x + ((a * t) + (z * y));
} else {
tmp = x + (z * (y + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -8.2e+60) or not (t <= 3.7e+98): tmp = x + ((a * t) + (z * y)) else: tmp = x + (z * (y + (a * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -8.2e+60) || !(t <= 3.7e+98)) tmp = Float64(x + Float64(Float64(a * t) + Float64(z * y))); 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 <= -8.2e+60) || ~((t <= 3.7e+98))) tmp = x + ((a * t) + (z * y)); else tmp = x + (z * (y + (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -8.2e+60], N[Not[LessEqual[t, 3.7e+98]], $MachinePrecision]], N[(x + N[(N[(a * t), $MachinePrecision] + N[(z * y), $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 -8.2 \cdot 10^{+60} \lor \neg \left(t \leq 3.7 \cdot 10^{+98}\right):\\
\;\;\;\;x + \left(a \cdot t + z \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if t < -8.2e60 or 3.6999999999999999e98 < t Initial program 89.3%
associate-+l+89.3%
associate-*l*85.3%
Simplified85.3%
Taylor expanded in b around 0 91.7%
if -8.2e60 < t < 3.6999999999999999e98Initial program 91.0%
associate-+l+91.0%
associate-*l*92.1%
Simplified92.1%
Taylor expanded in t around 0 86.9%
+-commutative86.9%
+-commutative86.9%
associate-*r*86.9%
distribute-rgt-in90.6%
Simplified90.6%
Final simplification91.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1e-54) (not (<= z 8.7e-66))) (* z (+ y (* a b))) (+ x (* a t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1e-54) || !(z <= 8.7e-66)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * t);
}
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 <= (-1d-54)) .or. (.not. (z <= 8.7d-66))) then
tmp = z * (y + (a * b))
else
tmp = x + (a * t)
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 <= -1e-54) || !(z <= 8.7e-66)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1e-54) or not (z <= 8.7e-66): tmp = z * (y + (a * b)) else: tmp = x + (a * t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1e-54) || !(z <= 8.7e-66)) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(x + Float64(a * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1e-54) || ~((z <= 8.7e-66))) tmp = z * (y + (a * b)); else tmp = x + (a * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1e-54], N[Not[LessEqual[z, 8.7e-66]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-54} \lor \neg \left(z \leq 8.7 \cdot 10^{-66}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot t\\
\end{array}
\end{array}
if z < -1e-54 or 8.6999999999999998e-66 < z Initial program 85.3%
associate-+l+85.3%
associate-*l*84.0%
Simplified84.0%
Taylor expanded in z around inf 73.8%
if -1e-54 < z < 8.6999999999999998e-66Initial program 98.9%
associate-+l+98.9%
associate-*l*98.9%
Simplified98.9%
Taylor expanded in z around 0 80.3%
+-commutative80.3%
Simplified80.3%
Final simplification76.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -2.55e+82) (not (<= t 3.7e+98))) (* a t) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.55e+82) || !(t <= 3.7e+98)) {
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 ((t <= (-2.55d+82)) .or. (.not. (t <= 3.7d+98))) 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 ((t <= -2.55e+82) || !(t <= 3.7e+98)) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -2.55e+82) or not (t <= 3.7e+98): tmp = a * t else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -2.55e+82) || !(t <= 3.7e+98)) 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 ((t <= -2.55e+82) || ~((t <= 3.7e+98))) tmp = a * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -2.55e+82], N[Not[LessEqual[t, 3.7e+98]], $MachinePrecision]], N[(a * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.55 \cdot 10^{+82} \lor \neg \left(t \leq 3.7 \cdot 10^{+98}\right):\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -2.5500000000000001e82 or 3.6999999999999999e98 < t Initial program 88.6%
associate-+l+88.6%
associate-*l*84.3%
Simplified84.3%
Taylor expanded in t around inf 57.1%
if -2.5500000000000001e82 < t < 3.6999999999999999e98Initial program 91.3%
associate-+l+91.3%
associate-*l*92.4%
Simplified92.4%
Taylor expanded in x around inf 35.9%
Final simplification43.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 90.4%
associate-+l+90.4%
associate-*l*89.6%
Simplified89.6%
Taylor expanded in x around inf 27.5%
Final simplification27.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 2024095
(FPCore (x y z t a b)
:name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
:precision binary64
:alt
(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)))