
(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 13 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 1.36e+37) (+ (fma y z x) (* a (+ t (* z b)))) (* z (+ y (+ (/ x z) (* a (+ b (/ t z))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1.36e+37) {
tmp = fma(y, z, x) + (a * (t + (z * b)));
} else {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 1.36e+37) tmp = Float64(fma(y, z, x) + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * Float64(b + Float64(t / z)))))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 1.36e+37], N[(N[(y * z + x), $MachinePrecision] + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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}
\mathbf{if}\;z \leq 1.36 \cdot 10^{+37}:\\
\;\;\;\;\mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + z \cdot b\right)\\
\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 z < 1.3599999999999999e37Initial program 94.6%
associate-+l+94.7%
+-commutative94.7%
fma-define94.7%
associate-*l*98.0%
*-commutative98.0%
*-commutative98.0%
distribute-rgt-out99.0%
remove-double-neg99.0%
*-commutative99.0%
distribute-lft-neg-out99.0%
sub-neg99.0%
sub-neg99.0%
distribute-lft-neg-in99.0%
remove-double-neg99.0%
Simplified99.0%
if 1.3599999999999999e37 < z Initial program 74.8%
associate-+l+74.8%
associate-*l*78.3%
Simplified78.3%
Taylor expanded in z around inf 96.2%
+-commutative96.2%
associate-+l+96.2%
+-commutative96.2%
associate-/l*98.0%
distribute-lft-out99.8%
Simplified99.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* z y))))
(if (<= (+ (+ t_1 (* a t)) (* b (* z a))) 2e+307)
(+ t_1 (+ (* a (* z b)) (* a t)))
(* 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);
double tmp;
if (((t_1 + (a * t)) + (b * (z * a))) <= 2e+307) {
tmp = t_1 + ((a * (z * b)) + (a * t));
} 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)
if (((t_1 + (a * t)) + (b * (z * a))) <= 2d+307) then
tmp = t_1 + ((a * (z * b)) + (a * t))
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);
double tmp;
if (((t_1 + (a * t)) + (b * (z * a))) <= 2e+307) {
tmp = t_1 + ((a * (z * b)) + (a * t));
} 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) tmp = 0 if ((t_1 + (a * t)) + (b * (z * a))) <= 2e+307: tmp = t_1 + ((a * (z * b)) + (a * t)) else: tmp = z * (y + ((x / z) + (a * (b + (t / z))))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(z * y)) tmp = 0.0 if (Float64(Float64(t_1 + Float64(a * t)) + Float64(b * Float64(z * a))) <= 2e+307) tmp = Float64(t_1 + Float64(Float64(a * Float64(z * b)) + Float64(a * t))); 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); tmp = 0.0; if (((t_1 + (a * t)) + (b * (z * a))) <= 2e+307) tmp = t_1 + ((a * (z * b)) + (a * t)); 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[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(t$95$1 + N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+307], N[(t$95$1 + N[(N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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 := x + z \cdot y\\
\mathbf{if}\;\left(t\_1 + a \cdot t\right) + b \cdot \left(z \cdot a\right) \leq 2 \cdot 10^{+307}:\\
\;\;\;\;t\_1 + \left(a \cdot \left(z \cdot b\right) + a \cdot t\right)\\
\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)) < 1.99999999999999997e307Initial program 96.8%
associate-+l+96.8%
associate-*l*98.6%
Simplified98.6%
if 1.99999999999999997e307 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 63.4%
associate-+l+63.4%
associate-*l*73.4%
Simplified73.4%
Taylor expanded in z around inf 87.8%
+-commutative87.8%
associate-+l+87.8%
+-commutative87.8%
associate-/l*91.8%
distribute-lft-out98.0%
Simplified98.0%
Final simplification98.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* z y))) (t_2 (* z (+ y (* a b)))))
(if (<= z -1.02e+127)
t_2
(if (<= z -2.55e+51)
t_1
(if (<= z -1.16e-68)
(* a (+ t (* z b)))
(if (<= z 2.1e-43) (+ x (* a t)) (if (<= z 1.2e+31) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (z * y);
double t_2 = z * (y + (a * b));
double tmp;
if (z <= -1.02e+127) {
tmp = t_2;
} else if (z <= -2.55e+51) {
tmp = t_1;
} else if (z <= -1.16e-68) {
tmp = a * (t + (z * b));
} else if (z <= 2.1e-43) {
tmp = x + (a * t);
} else if (z <= 1.2e+31) {
tmp = t_1;
} else {
tmp = t_2;
}
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 = z * (y + (a * b))
if (z <= (-1.02d+127)) then
tmp = t_2
else if (z <= (-2.55d+51)) then
tmp = t_1
else if (z <= (-1.16d-68)) then
tmp = a * (t + (z * b))
else if (z <= 2.1d-43) then
tmp = x + (a * t)
else if (z <= 1.2d+31) then
tmp = t_1
else
tmp = t_2
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 = z * (y + (a * b));
double tmp;
if (z <= -1.02e+127) {
tmp = t_2;
} else if (z <= -2.55e+51) {
tmp = t_1;
} else if (z <= -1.16e-68) {
tmp = a * (t + (z * b));
} else if (z <= 2.1e-43) {
tmp = x + (a * t);
} else if (z <= 1.2e+31) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (z * y) t_2 = z * (y + (a * b)) tmp = 0 if z <= -1.02e+127: tmp = t_2 elif z <= -2.55e+51: tmp = t_1 elif z <= -1.16e-68: tmp = a * (t + (z * b)) elif z <= 2.1e-43: tmp = x + (a * t) elif z <= 1.2e+31: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(z * y)) t_2 = Float64(z * Float64(y + Float64(a * b))) tmp = 0.0 if (z <= -1.02e+127) tmp = t_2; elseif (z <= -2.55e+51) tmp = t_1; elseif (z <= -1.16e-68) tmp = Float64(a * Float64(t + Float64(z * b))); elseif (z <= 2.1e-43) tmp = Float64(x + Float64(a * t)); elseif (z <= 1.2e+31) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (z * y); t_2 = z * (y + (a * b)); tmp = 0.0; if (z <= -1.02e+127) tmp = t_2; elseif (z <= -2.55e+51) tmp = t_1; elseif (z <= -1.16e-68) tmp = a * (t + (z * b)); elseif (z <= 2.1e-43) tmp = x + (a * t); elseif (z <= 1.2e+31) tmp = t_1; else tmp = t_2; 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[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.02e+127], t$95$2, If[LessEqual[z, -2.55e+51], t$95$1, If[LessEqual[z, -1.16e-68], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.1e-43], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.2e+31], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot y\\
t_2 := z \cdot \left(y + a \cdot b\right)\\
\mathbf{if}\;z \leq -1.02 \cdot 10^{+127}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -2.55 \cdot 10^{+51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.16 \cdot 10^{-68}:\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-43}:\\
\;\;\;\;x + a \cdot t\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+31}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1.02e127 or 1.19999999999999991e31 < z Initial program 76.9%
associate-+l+76.9%
associate-*l*83.4%
Simplified83.4%
Taylor expanded in z around inf 81.4%
if -1.02e127 < z < -2.55000000000000005e51 or 2.1000000000000001e-43 < z < 1.19999999999999991e31Initial program 93.9%
associate-+l+93.9%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in a around 0 81.2%
if -2.55000000000000005e51 < z < -1.1599999999999999e-68Initial program 94.4%
associate-+l+94.4%
associate-*l*94.3%
Simplified94.3%
Taylor expanded in a around inf 64.3%
if -1.1599999999999999e-68 < z < 2.1000000000000001e-43Initial program 99.2%
associate-+l+99.2%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in z around 0 80.1%
+-commutative80.1%
Simplified80.1%
Final simplification79.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= x -1.7e+17)
x
(if (<= x 7.6e-280)
(* a t)
(if (<= x 3e-100)
t_1
(if (<= x 0.00136) (* a t) (if (<= x 2.65e+20) t_1 x)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (x <= -1.7e+17) {
tmp = x;
} else if (x <= 7.6e-280) {
tmp = a * t;
} else if (x <= 3e-100) {
tmp = t_1;
} else if (x <= 0.00136) {
tmp = a * t;
} else if (x <= 2.65e+20) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = a * (z * b)
if (x <= (-1.7d+17)) then
tmp = x
else if (x <= 7.6d-280) then
tmp = a * t
else if (x <= 3d-100) then
tmp = t_1
else if (x <= 0.00136d0) then
tmp = a * t
else if (x <= 2.65d+20) then
tmp = t_1
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 t_1 = a * (z * b);
double tmp;
if (x <= -1.7e+17) {
tmp = x;
} else if (x <= 7.6e-280) {
tmp = a * t;
} else if (x <= 3e-100) {
tmp = t_1;
} else if (x <= 0.00136) {
tmp = a * t;
} else if (x <= 2.65e+20) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (z * b) tmp = 0 if x <= -1.7e+17: tmp = x elif x <= 7.6e-280: tmp = a * t elif x <= 3e-100: tmp = t_1 elif x <= 0.00136: tmp = a * t elif x <= 2.65e+20: tmp = t_1 else: tmp = x return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(z * b)) tmp = 0.0 if (x <= -1.7e+17) tmp = x; elseif (x <= 7.6e-280) tmp = Float64(a * t); elseif (x <= 3e-100) tmp = t_1; elseif (x <= 0.00136) tmp = Float64(a * t); elseif (x <= 2.65e+20) tmp = t_1; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (z * b); tmp = 0.0; if (x <= -1.7e+17) tmp = x; elseif (x <= 7.6e-280) tmp = a * t; elseif (x <= 3e-100) tmp = t_1; elseif (x <= 0.00136) tmp = a * t; elseif (x <= 2.65e+20) tmp = t_1; else tmp = x; 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[x, -1.7e+17], x, If[LessEqual[x, 7.6e-280], N[(a * t), $MachinePrecision], If[LessEqual[x, 3e-100], t$95$1, If[LessEqual[x, 0.00136], N[(a * t), $MachinePrecision], If[LessEqual[x, 2.65e+20], t$95$1, x]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;x \leq -1.7 \cdot 10^{+17}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 7.6 \cdot 10^{-280}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;x \leq 3 \cdot 10^{-100}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 0.00136:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;x \leq 2.65 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.7e17 or 2.65e20 < x Initial program 92.1%
associate-+l+92.1%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in x around inf 53.7%
if -1.7e17 < x < 7.6000000000000003e-280 or 3.0000000000000001e-100 < x < 0.00136Initial program 90.8%
associate-+l+90.8%
associate-*l*95.8%
Simplified95.8%
Taylor expanded in t around inf 45.0%
if 7.6000000000000003e-280 < x < 3.0000000000000001e-100 or 0.00136 < x < 2.65e20Initial program 85.6%
associate-+l+85.6%
associate-*l*87.5%
Simplified87.5%
Taylor expanded in a around inf 85.6%
Taylor expanded in b around inf 46.8%
Final simplification49.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ t (* z b)))))
(if (<= a -1.4e+31)
t_1
(if (<= a 2.3e-102)
(+ x (* z y))
(if (or (<= a 2.6e+96) (not (<= a 1.45e+134))) t_1 (+ x (* a t)))))))
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 <= -1.4e+31) {
tmp = t_1;
} else if (a <= 2.3e-102) {
tmp = x + (z * y);
} else if ((a <= 2.6e+96) || !(a <= 1.45e+134)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = a * (t + (z * b))
if (a <= (-1.4d+31)) then
tmp = t_1
else if (a <= 2.3d-102) then
tmp = x + (z * y)
else if ((a <= 2.6d+96) .or. (.not. (a <= 1.45d+134))) then
tmp = t_1
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 t_1 = a * (t + (z * b));
double tmp;
if (a <= -1.4e+31) {
tmp = t_1;
} else if (a <= 2.3e-102) {
tmp = x + (z * y);
} else if ((a <= 2.6e+96) || !(a <= 1.45e+134)) {
tmp = t_1;
} else {
tmp = x + (a * t);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (t + (z * b)) tmp = 0 if a <= -1.4e+31: tmp = t_1 elif a <= 2.3e-102: tmp = x + (z * y) elif (a <= 2.6e+96) or not (a <= 1.45e+134): tmp = t_1 else: tmp = x + (a * t) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(t + Float64(z * b))) tmp = 0.0 if (a <= -1.4e+31) tmp = t_1; elseif (a <= 2.3e-102) tmp = Float64(x + Float64(z * y)); elseif ((a <= 2.6e+96) || !(a <= 1.45e+134)) tmp = t_1; else tmp = Float64(x + Float64(a * t)); 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 <= -1.4e+31) tmp = t_1; elseif (a <= 2.3e-102) tmp = x + (z * y); elseif ((a <= 2.6e+96) || ~((a <= 1.45e+134))) tmp = t_1; else tmp = x + (a * t); 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, -1.4e+31], t$95$1, If[LessEqual[a, 2.3e-102], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, 2.6e+96], N[Not[LessEqual[a, 1.45e+134]], $MachinePrecision]], t$95$1, N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -1.4 \cdot 10^{+31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{-102}:\\
\;\;\;\;x + z \cdot y\\
\mathbf{elif}\;a \leq 2.6 \cdot 10^{+96} \lor \neg \left(a \leq 1.45 \cdot 10^{+134}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot t\\
\end{array}
\end{array}
if a < -1.40000000000000008e31 or 2.29999999999999987e-102 < a < 2.6e96 or 1.45000000000000006e134 < a Initial program 84.1%
associate-+l+84.1%
associate-*l*92.2%
Simplified92.2%
Taylor expanded in a around inf 77.3%
if -1.40000000000000008e31 < a < 2.29999999999999987e-102Initial program 97.4%
associate-+l+97.4%
associate-*l*94.8%
Simplified94.8%
Taylor expanded in a around 0 76.5%
if 2.6e96 < a < 1.45000000000000006e134Initial program 92.2%
associate-+l+92.2%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in z around 0 85.5%
+-commutative85.5%
Simplified85.5%
Final simplification77.4%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= t -1.04e+122)
(and (not (<= t 1.25e+21))
(or (<= t 1.5e+206) (not (<= t 1.2e+268)))))
(* a t)
(+ x (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.04e+122) || (!(t <= 1.25e+21) && ((t <= 1.5e+206) || !(t <= 1.2e+268)))) {
tmp = a * 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 ((t <= (-1.04d+122)) .or. (.not. (t <= 1.25d+21)) .and. (t <= 1.5d+206) .or. (.not. (t <= 1.2d+268))) then
tmp = a * 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 ((t <= -1.04e+122) || (!(t <= 1.25e+21) && ((t <= 1.5e+206) || !(t <= 1.2e+268)))) {
tmp = a * t;
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.04e+122) or (not (t <= 1.25e+21) and ((t <= 1.5e+206) or not (t <= 1.2e+268))): tmp = a * t else: tmp = x + (z * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.04e+122) || (!(t <= 1.25e+21) && ((t <= 1.5e+206) || !(t <= 1.2e+268)))) tmp = Float64(a * 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 ((t <= -1.04e+122) || (~((t <= 1.25e+21)) && ((t <= 1.5e+206) || ~((t <= 1.2e+268))))) tmp = a * t; else tmp = x + (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.04e+122], And[N[Not[LessEqual[t, 1.25e+21]], $MachinePrecision], Or[LessEqual[t, 1.5e+206], N[Not[LessEqual[t, 1.2e+268]], $MachinePrecision]]]], N[(a * t), $MachinePrecision], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.04 \cdot 10^{+122} \lor \neg \left(t \leq 1.25 \cdot 10^{+21}\right) \land \left(t \leq 1.5 \cdot 10^{+206} \lor \neg \left(t \leq 1.2 \cdot 10^{+268}\right)\right):\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if t < -1.04e122 or 1.25e21 < t < 1.5000000000000001e206 or 1.2e268 < t Initial program 92.5%
associate-+l+92.5%
associate-*l*96.8%
Simplified96.8%
Taylor expanded in t around inf 59.6%
if -1.04e122 < t < 1.25e21 or 1.5000000000000001e206 < t < 1.2e268Initial program 89.1%
associate-+l+89.1%
associate-*l*92.0%
Simplified92.0%
Taylor expanded in a around 0 65.5%
Final simplification63.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -0.0052) (not (<= z 6e-39))) (* z (+ y (+ (/ x z) (* a (+ b (/ t z)))))) (+ x (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -0.0052) || !(z <= 6e-39)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} else {
tmp = x + (a * (t + (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 <= (-0.0052d0)) .or. (.not. (z <= 6d-39))) then
tmp = z * (y + ((x / z) + (a * (b + (t / z)))))
else
tmp = x + (a * (t + (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 <= -0.0052) || !(z <= 6e-39)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -0.0052) or not (z <= 6e-39): tmp = z * (y + ((x / z) + (a * (b + (t / z))))) else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -0.0052) || !(z <= 6e-39)) tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * Float64(b + Float64(t / z)))))); else tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -0.0052) || ~((z <= 6e-39))) tmp = z * (y + ((x / z) + (a * (b + (t / z))))); else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -0.0052], N[Not[LessEqual[z, 6e-39]], $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[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.0052 \lor \neg \left(z \leq 6 \cdot 10^{-39}\right):\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if z < -0.0051999999999999998 or 6.00000000000000055e-39 < z Initial program 81.8%
associate-+l+81.8%
associate-*l*87.7%
Simplified87.7%
Taylor expanded in z around inf 96.8%
+-commutative96.8%
associate-+l+96.8%
+-commutative96.8%
associate-/l*98.3%
distribute-lft-out99.9%
Simplified99.9%
if -0.0051999999999999998 < z < 6.00000000000000055e-39Initial program 99.2%
associate-+l+99.2%
+-commutative99.2%
fma-define99.2%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
distribute-rgt-out100.0%
remove-double-neg100.0%
*-commutative100.0%
distribute-lft-neg-out100.0%
sub-neg100.0%
sub-neg100.0%
distribute-lft-neg-in100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 91.5%
Final simplification95.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.22e+44) (not (<= a 2.3e-102))) (+ x (* a (+ t (* z b)))) (+ x (+ (* z y) (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.22e+44) || !(a <= 2.3e-102)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + ((z * y) + (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 ((a <= (-1.22d+44)) .or. (.not. (a <= 2.3d-102))) then
tmp = x + (a * (t + (z * b)))
else
tmp = x + ((z * y) + (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 ((a <= -1.22e+44) || !(a <= 2.3e-102)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + ((z * y) + (a * t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.22e+44) or not (a <= 2.3e-102): tmp = x + (a * (t + (z * b))) else: tmp = x + ((z * y) + (a * t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.22e+44) || !(a <= 2.3e-102)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(x + Float64(Float64(z * y) + Float64(a * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.22e+44) || ~((a <= 2.3e-102))) tmp = x + (a * (t + (z * b))); else tmp = x + ((z * y) + (a * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.22e+44], N[Not[LessEqual[a, 2.3e-102]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z * y), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.22 \cdot 10^{+44} \lor \neg \left(a \leq 2.3 \cdot 10^{-102}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(z \cdot y + a \cdot t\right)\\
\end{array}
\end{array}
if a < -1.22e44 or 2.29999999999999987e-102 < a Initial program 85.2%
associate-+l+85.2%
+-commutative85.2%
fma-define85.2%
associate-*l*92.8%
*-commutative92.8%
*-commutative92.8%
distribute-rgt-out95.6%
remove-double-neg95.6%
*-commutative95.6%
distribute-lft-neg-out95.6%
sub-neg95.6%
sub-neg95.6%
distribute-lft-neg-in95.6%
remove-double-neg95.6%
Simplified95.6%
Taylor expanded in y around 0 90.5%
if -1.22e44 < a < 2.29999999999999987e-102Initial program 96.6%
associate-+l+96.6%
associate-*l*94.9%
Simplified94.9%
Taylor expanded in b around 0 90.0%
Final simplification90.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.25e+185) (not (<= y 1.7e+164))) (+ (* z y) (* a t)) (+ x (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.25e+185) || !(y <= 1.7e+164)) {
tmp = (z * y) + (a * t);
} else {
tmp = x + (a * (t + (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 ((y <= (-1.25d+185)) .or. (.not. (y <= 1.7d+164))) then
tmp = (z * y) + (a * t)
else
tmp = x + (a * (t + (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 ((y <= -1.25e+185) || !(y <= 1.7e+164)) {
tmp = (z * y) + (a * t);
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.25e+185) or not (y <= 1.7e+164): tmp = (z * y) + (a * t) else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.25e+185) || !(y <= 1.7e+164)) tmp = Float64(Float64(z * y) + Float64(a * t)); else tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.25e+185) || ~((y <= 1.7e+164))) tmp = (z * y) + (a * t); else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.25e+185], N[Not[LessEqual[y, 1.7e+164]], $MachinePrecision]], N[(N[(z * y), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{+185} \lor \neg \left(y \leq 1.7 \cdot 10^{+164}\right):\\
\;\;\;\;z \cdot y + a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if y < -1.24999999999999997e185 or 1.7000000000000001e164 < y Initial program 87.2%
associate-+l+87.2%
associate-*l*87.2%
Simplified87.2%
Taylor expanded in z around inf 77.7%
associate-/l*75.6%
distribute-lft-out75.6%
Simplified75.6%
Taylor expanded in z around 0 91.6%
Taylor expanded in x around 0 85.5%
if -1.24999999999999997e185 < y < 1.7000000000000001e164Initial program 91.1%
associate-+l+91.1%
+-commutative91.1%
fma-define91.1%
associate-*l*95.2%
*-commutative95.2%
*-commutative95.2%
distribute-rgt-out97.1%
remove-double-neg97.1%
*-commutative97.1%
distribute-lft-neg-out97.1%
sub-neg97.1%
sub-neg97.1%
distribute-lft-neg-in97.1%
remove-double-neg97.1%
Simplified97.1%
Taylor expanded in y around 0 85.6%
Final simplification85.5%
(FPCore (x y z t a b) :precision binary64 (if (<= t -5.4e+57) (* a t) (if (<= t -3e-47) (* z y) (if (<= t 1.15e+21) x (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -5.4e+57) {
tmp = a * t;
} else if (t <= -3e-47) {
tmp = z * y;
} else if (t <= 1.15e+21) {
tmp = x;
} else {
tmp = 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 (t <= (-5.4d+57)) then
tmp = a * t
else if (t <= (-3d-47)) then
tmp = z * y
else if (t <= 1.15d+21) then
tmp = x
else
tmp = 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 (t <= -5.4e+57) {
tmp = a * t;
} else if (t <= -3e-47) {
tmp = z * y;
} else if (t <= 1.15e+21) {
tmp = x;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -5.4e+57: tmp = a * t elif t <= -3e-47: tmp = z * y elif t <= 1.15e+21: tmp = x else: tmp = a * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -5.4e+57) tmp = Float64(a * t); elseif (t <= -3e-47) tmp = Float64(z * y); elseif (t <= 1.15e+21) tmp = x; else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -5.4e+57) tmp = a * t; elseif (t <= -3e-47) tmp = z * y; elseif (t <= 1.15e+21) tmp = x; else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -5.4e+57], N[(a * t), $MachinePrecision], If[LessEqual[t, -3e-47], N[(z * y), $MachinePrecision], If[LessEqual[t, 1.15e+21], x, N[(a * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.4 \cdot 10^{+57}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;t \leq -3 \cdot 10^{-47}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{+21}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if t < -5.3999999999999997e57 or 1.15e21 < t Initial program 91.3%
associate-+l+91.3%
associate-*l*93.9%
Simplified93.9%
Taylor expanded in t around inf 53.3%
if -5.3999999999999997e57 < t < -3.00000000000000017e-47Initial program 90.3%
associate-+l+90.3%
associate-*l*95.0%
Simplified95.0%
Taylor expanded in y around inf 50.9%
*-commutative50.9%
Simplified50.9%
if -3.00000000000000017e-47 < t < 1.15e21Initial program 89.4%
associate-+l+89.5%
associate-*l*93.4%
Simplified93.4%
Taylor expanded in x around inf 41.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -4.9e+62) (not (<= t 29.0))) (+ x (* a t)) (+ x (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -4.9e+62) || !(t <= 29.0)) {
tmp = x + (a * 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 ((t <= (-4.9d+62)) .or. (.not. (t <= 29.0d0))) then
tmp = x + (a * 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 ((t <= -4.9e+62) || !(t <= 29.0)) {
tmp = x + (a * t);
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -4.9e+62) or not (t <= 29.0): tmp = x + (a * t) else: tmp = x + (z * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -4.9e+62) || !(t <= 29.0)) tmp = Float64(x + Float64(a * 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 ((t <= -4.9e+62) || ~((t <= 29.0))) tmp = x + (a * t); else tmp = x + (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -4.9e+62], N[Not[LessEqual[t, 29.0]], $MachinePrecision]], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.9 \cdot 10^{+62} \lor \neg \left(t \leq 29\right):\\
\;\;\;\;x + a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if t < -4.8999999999999997e62 or 29 < t Initial program 91.5%
associate-+l+91.5%
associate-*l*94.0%
Simplified94.0%
Taylor expanded in z around 0 66.5%
+-commutative66.5%
Simplified66.5%
if -4.8999999999999997e62 < t < 29Initial program 89.4%
associate-+l+89.4%
associate-*l*93.5%
Simplified93.5%
Taylor expanded in a around 0 67.9%
Final simplification67.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -3.55e+121) (not (<= t 6.5e+19))) (* a t) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -3.55e+121) || !(t <= 6.5e+19)) {
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 <= (-3.55d+121)) .or. (.not. (t <= 6.5d+19))) 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 <= -3.55e+121) || !(t <= 6.5e+19)) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -3.55e+121) or not (t <= 6.5e+19): tmp = a * t else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -3.55e+121) || !(t <= 6.5e+19)) 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 <= -3.55e+121) || ~((t <= 6.5e+19))) tmp = a * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -3.55e+121], N[Not[LessEqual[t, 6.5e+19]], $MachinePrecision]], N[(a * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.55 \cdot 10^{+121} \lor \neg \left(t \leq 6.5 \cdot 10^{+19}\right):\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -3.55000000000000012e121 or 6.5e19 < t Initial program 90.4%
associate-+l+90.4%
associate-*l*93.3%
Simplified93.3%
Taylor expanded in t around inf 55.5%
if -3.55000000000000012e121 < t < 6.5e19Initial program 90.3%
associate-+l+90.3%
associate-*l*94.1%
Simplified94.1%
Taylor expanded in x around inf 39.1%
Final simplification45.8%
(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*93.8%
Simplified93.8%
Taylor expanded in x around inf 28.1%
(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 2024088
(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)))