
(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 12 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 1e+41) (fma y z (fma a (fma z b t) x)) (fma z (fma a b y) (fma t a x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1e+41) {
tmp = fma(y, z, fma(a, fma(z, b, t), x));
} else {
tmp = fma(z, fma(a, b, y), fma(t, a, x));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 1e+41) tmp = fma(y, z, fma(a, fma(z, b, t), x)); else tmp = fma(z, fma(a, b, y), fma(t, a, x)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 1e+41], N[(y * z + N[(a * N[(z * b + t), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(z * N[(a * b + y), $MachinePrecision] + N[(t * a + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 10^{+41}:\\
\;\;\;\;\mathsf{fma}\left(y, z, \mathsf{fma}\left(a, \mathsf{fma}\left(z, b, t\right), x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(a, b, y\right), \mathsf{fma}\left(t, a, x\right)\right)\\
\end{array}
\end{array}
if z < 1.00000000000000001e41Initial program 93.9%
associate-+l+93.9%
+-commutative93.9%
associate-+l+93.9%
fma-def94.8%
+-commutative94.8%
*-commutative94.8%
associate-*l*94.5%
distribute-lft-out98.0%
fma-def98.0%
+-commutative98.0%
fma-def98.0%
Simplified98.0%
if 1.00000000000000001e41 < z Initial program 83.6%
+-commutative83.6%
+-commutative83.6%
associate-+l+83.6%
associate-+r+83.6%
*-commutative83.6%
associate-*l*87.2%
*-commutative87.2%
distribute-lft-out98.2%
fma-def98.2%
fma-def98.2%
+-commutative98.2%
fma-def98.2%
Simplified98.2%
Final simplification98.1%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (* a t) (+ x (* z y))) (* b (* z a))))) (if (<= t_1 INFINITY) t_1 (fma y z (fma a (fma z b t) x)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((a * t) + (x + (z * y))) + (b * (z * a));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(y, z, fma(a, fma(z, b, t), x));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(a * t) + Float64(x + Float64(z * y))) + Float64(b * Float64(z * a))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = fma(y, z, fma(a, fma(z, b, t), x)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(a * t), $MachinePrecision] + N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(y * z + N[(a * N[(z * b + t), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot t + \left(x + z \cdot y\right)\right) + b \cdot \left(z \cdot a\right)\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, z, \mathsf{fma}\left(a, \mathsf{fma}\left(z, b, t\right), 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.6%
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+0.0%
fma-def27.8%
+-commutative27.8%
*-commutative27.8%
associate-*l*38.9%
distribute-lft-out83.3%
fma-def83.3%
+-commutative83.3%
fma-def83.3%
Simplified83.3%
Final simplification97.5%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (* a t) (+ x (* z y))) (* b (* z a))))) (if (<= t_1 INFINITY) t_1 (+ x (* a (+ t (* z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((a * t) + (x + (z * y))) + (b * (z * a));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((a * t) + (x + (z * y))) + (b * (z * a));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((a * t) + (x + (z * y))) + (b * (z * a)) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(a * t) + Float64(x + Float64(z * y))) + Float64(b * Float64(z * a))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; 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) t_1 = ((a * t) + (x + (z * y))) + (b * (z * a)); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(a * t), $MachinePrecision] + N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot t + \left(x + z \cdot y\right)\right) + b \cdot \left(z \cdot a\right)\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \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.6%
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+0.0%
fma-def27.8%
+-commutative27.8%
*-commutative27.8%
associate-*l*38.9%
distribute-lft-out83.3%
fma-def83.3%
+-commutative83.3%
fma-def83.3%
Simplified83.3%
Taylor expanded in y around 0 77.8%
Final simplification97.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -5.2e+171) (not (<= z 2.5e+107))) (* z (+ y (* a b))) (+ (+ (* a t) (* a (* z b))) (+ x (* z y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -5.2e+171) || !(z <= 2.5e+107)) {
tmp = z * (y + (a * b));
} else {
tmp = ((a * t) + (a * (z * b))) + (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 ((z <= (-5.2d+171)) .or. (.not. (z <= 2.5d+107))) then
tmp = z * (y + (a * b))
else
tmp = ((a * t) + (a * (z * b))) + (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 ((z <= -5.2e+171) || !(z <= 2.5e+107)) {
tmp = z * (y + (a * b));
} else {
tmp = ((a * t) + (a * (z * b))) + (x + (z * y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -5.2e+171) or not (z <= 2.5e+107): tmp = z * (y + (a * b)) else: tmp = ((a * t) + (a * (z * b))) + (x + (z * y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -5.2e+171) || !(z <= 2.5e+107)) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(Float64(Float64(a * t) + Float64(a * Float64(z * b))) + Float64(x + Float64(z * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -5.2e+171) || ~((z <= 2.5e+107))) tmp = z * (y + (a * b)); else tmp = ((a * t) + (a * (z * b))) + (x + (z * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -5.2e+171], N[Not[LessEqual[z, 2.5e+107]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * t), $MachinePrecision] + N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+171} \lor \neg \left(z \leq 2.5 \cdot 10^{+107}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot t + a \cdot \left(z \cdot b\right)\right) + \left(x + z \cdot y\right)\\
\end{array}
\end{array}
if z < -5.2e171 or 2.5000000000000001e107 < z Initial program 79.0%
associate-+l+79.0%
+-commutative79.0%
associate-+l+79.0%
fma-def86.6%
+-commutative86.6%
*-commutative86.6%
associate-*l*77.8%
distribute-lft-out82.3%
fma-def82.3%
+-commutative82.3%
fma-def82.3%
Simplified82.3%
Taylor expanded in z around inf 89.6%
if -5.2e171 < z < 2.5000000000000001e107Initial program 96.1%
associate-+l+96.1%
associate-*l*96.8%
Simplified96.8%
Final simplification95.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* a t))))
(if (<= z -9.5e+223)
(* a (* z b))
(if (<= z -1.05e+122)
(* z y)
(if (<= z -5.4e+60)
(* b (* z a))
(if (<= z 3.6e+70)
t_1
(if (<= z 1.8e+121)
(* z y)
(if (<= z 2.2e+139) t_1 (* z (* a b))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (a * t);
double tmp;
if (z <= -9.5e+223) {
tmp = a * (z * b);
} else if (z <= -1.05e+122) {
tmp = z * y;
} else if (z <= -5.4e+60) {
tmp = b * (z * a);
} else if (z <= 3.6e+70) {
tmp = t_1;
} else if (z <= 1.8e+121) {
tmp = z * y;
} else if (z <= 2.2e+139) {
tmp = t_1;
} else {
tmp = z * (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) :: t_1
real(8) :: tmp
t_1 = x + (a * t)
if (z <= (-9.5d+223)) then
tmp = a * (z * b)
else if (z <= (-1.05d+122)) then
tmp = z * y
else if (z <= (-5.4d+60)) then
tmp = b * (z * a)
else if (z <= 3.6d+70) then
tmp = t_1
else if (z <= 1.8d+121) then
tmp = z * y
else if (z <= 2.2d+139) then
tmp = t_1
else
tmp = z * (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 t_1 = x + (a * t);
double tmp;
if (z <= -9.5e+223) {
tmp = a * (z * b);
} else if (z <= -1.05e+122) {
tmp = z * y;
} else if (z <= -5.4e+60) {
tmp = b * (z * a);
} else if (z <= 3.6e+70) {
tmp = t_1;
} else if (z <= 1.8e+121) {
tmp = z * y;
} else if (z <= 2.2e+139) {
tmp = t_1;
} else {
tmp = z * (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (a * t) tmp = 0 if z <= -9.5e+223: tmp = a * (z * b) elif z <= -1.05e+122: tmp = z * y elif z <= -5.4e+60: tmp = b * (z * a) elif z <= 3.6e+70: tmp = t_1 elif z <= 1.8e+121: tmp = z * y elif z <= 2.2e+139: tmp = t_1 else: tmp = z * (a * b) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(a * t)) tmp = 0.0 if (z <= -9.5e+223) tmp = Float64(a * Float64(z * b)); elseif (z <= -1.05e+122) tmp = Float64(z * y); elseif (z <= -5.4e+60) tmp = Float64(b * Float64(z * a)); elseif (z <= 3.6e+70) tmp = t_1; elseif (z <= 1.8e+121) tmp = Float64(z * y); elseif (z <= 2.2e+139) tmp = t_1; else tmp = Float64(z * Float64(a * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (a * t); tmp = 0.0; if (z <= -9.5e+223) tmp = a * (z * b); elseif (z <= -1.05e+122) tmp = z * y; elseif (z <= -5.4e+60) tmp = b * (z * a); elseif (z <= 3.6e+70) tmp = t_1; elseif (z <= 1.8e+121) tmp = z * y; elseif (z <= 2.2e+139) tmp = t_1; else tmp = z * (a * 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[z, -9.5e+223], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.05e+122], N[(z * y), $MachinePrecision], If[LessEqual[z, -5.4e+60], N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6e+70], t$95$1, If[LessEqual[z, 1.8e+121], N[(z * y), $MachinePrecision], If[LessEqual[z, 2.2e+139], t$95$1, N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + a \cdot t\\
\mathbf{if}\;z \leq -9.5 \cdot 10^{+223}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{+122}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;z \leq -5.4 \cdot 10^{+60}:\\
\;\;\;\;b \cdot \left(z \cdot a\right)\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+70}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{+121}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{+139}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if z < -9.50000000000000064e223Initial program 72.2%
associate-+l+72.2%
+-commutative72.2%
associate-+l+72.2%
fma-def81.7%
+-commutative81.7%
*-commutative81.7%
associate-*l*81.0%
distribute-lft-out90.5%
fma-def90.5%
+-commutative90.5%
fma-def90.5%
Simplified90.5%
Taylor expanded in a around inf 71.7%
Taylor expanded in z around inf 62.9%
if -9.50000000000000064e223 < z < -1.05000000000000008e122 or 3.6e70 < z < 1.79999999999999991e121Initial program 92.5%
associate-+l+92.5%
+-commutative92.5%
associate-+l+92.5%
fma-def92.5%
+-commutative92.5%
*-commutative92.5%
associate-*l*92.5%
distribute-lft-out92.5%
fma-def92.5%
+-commutative92.5%
fma-def92.5%
Simplified92.5%
Taylor expanded in y around inf 58.7%
*-commutative58.7%
Simplified58.7%
if -1.05000000000000008e122 < z < -5.3999999999999999e60Initial program 99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+l+99.8%
fma-def99.8%
+-commutative99.8%
*-commutative99.8%
associate-*l*88.8%
distribute-lft-out88.8%
fma-def88.8%
+-commutative88.8%
fma-def88.8%
Simplified88.8%
Taylor expanded in a around inf 39.4%
Taylor expanded in z around inf 40.1%
*-commutative40.1%
*-commutative40.1%
associate-*l*51.1%
Simplified51.1%
if -5.3999999999999999e60 < z < 3.6e70 or 1.79999999999999991e121 < z < 2.1999999999999999e139Initial program 95.5%
associate-+l+95.5%
+-commutative95.5%
associate-+l+95.5%
fma-def96.1%
+-commutative96.1%
*-commutative96.1%
associate-*l*96.3%
distribute-lft-out99.3%
fma-def99.3%
+-commutative99.3%
fma-def99.4%
Simplified99.4%
Taylor expanded in y around 0 86.9%
Taylor expanded in z around 0 71.0%
if 2.1999999999999999e139 < z Initial program 82.3%
associate-+l+82.3%
+-commutative82.3%
associate-+l+82.3%
fma-def88.1%
+-commutative88.1%
*-commutative88.1%
associate-*l*77.3%
distribute-lft-out80.3%
fma-def80.3%
+-commutative80.3%
fma-def80.3%
Simplified80.3%
Taylor expanded in a around inf 57.2%
Taylor expanded in z around inf 57.3%
*-commutative57.3%
associate-*r*62.8%
Simplified62.8%
Final simplification67.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* a t))) (t_2 (+ x (* z y))))
(if (<= z -7.8e-25)
t_2
(if (<= z 3.2e-141)
t_1
(if (<= z 2.65e-89)
t_2
(if (<= z 8.5e+48) t_1 (if (<= z 1.05e+196) t_2 (* z (* a b)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (a * t);
double t_2 = x + (z * y);
double tmp;
if (z <= -7.8e-25) {
tmp = t_2;
} else if (z <= 3.2e-141) {
tmp = t_1;
} else if (z <= 2.65e-89) {
tmp = t_2;
} else if (z <= 8.5e+48) {
tmp = t_1;
} else if (z <= 1.05e+196) {
tmp = t_2;
} else {
tmp = z * (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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + (a * t)
t_2 = x + (z * y)
if (z <= (-7.8d-25)) then
tmp = t_2
else if (z <= 3.2d-141) then
tmp = t_1
else if (z <= 2.65d-89) then
tmp = t_2
else if (z <= 8.5d+48) then
tmp = t_1
else if (z <= 1.05d+196) then
tmp = t_2
else
tmp = z * (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 t_1 = x + (a * t);
double t_2 = x + (z * y);
double tmp;
if (z <= -7.8e-25) {
tmp = t_2;
} else if (z <= 3.2e-141) {
tmp = t_1;
} else if (z <= 2.65e-89) {
tmp = t_2;
} else if (z <= 8.5e+48) {
tmp = t_1;
} else if (z <= 1.05e+196) {
tmp = t_2;
} else {
tmp = z * (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (a * t) t_2 = x + (z * y) tmp = 0 if z <= -7.8e-25: tmp = t_2 elif z <= 3.2e-141: tmp = t_1 elif z <= 2.65e-89: tmp = t_2 elif z <= 8.5e+48: tmp = t_1 elif z <= 1.05e+196: tmp = t_2 else: tmp = z * (a * b) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(a * t)) t_2 = Float64(x + Float64(z * y)) tmp = 0.0 if (z <= -7.8e-25) tmp = t_2; elseif (z <= 3.2e-141) tmp = t_1; elseif (z <= 2.65e-89) tmp = t_2; elseif (z <= 8.5e+48) tmp = t_1; elseif (z <= 1.05e+196) tmp = t_2; else tmp = Float64(z * Float64(a * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (a * t); t_2 = x + (z * y); tmp = 0.0; if (z <= -7.8e-25) tmp = t_2; elseif (z <= 3.2e-141) tmp = t_1; elseif (z <= 2.65e-89) tmp = t_2; elseif (z <= 8.5e+48) tmp = t_1; elseif (z <= 1.05e+196) tmp = t_2; else tmp = z * (a * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.8e-25], t$95$2, If[LessEqual[z, 3.2e-141], t$95$1, If[LessEqual[z, 2.65e-89], t$95$2, If[LessEqual[z, 8.5e+48], t$95$1, If[LessEqual[z, 1.05e+196], t$95$2, N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + a \cdot t\\
t_2 := x + z \cdot y\\
\mathbf{if}\;z \leq -7.8 \cdot 10^{-25}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-141}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.65 \cdot 10^{-89}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+48}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{+196}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if z < -7.8e-25 or 3.2000000000000001e-141 < z < 2.65e-89 or 8.5000000000000001e48 < z < 1.05000000000000007e196Initial program 89.2%
associate-+l+89.2%
+-commutative89.2%
associate-+l+89.2%
fma-def93.2%
+-commutative93.2%
*-commutative93.2%
associate-*l*89.2%
distribute-lft-out91.2%
fma-def91.2%
+-commutative91.2%
fma-def91.2%
Simplified91.2%
Taylor expanded in a around 0 61.1%
if -7.8e-25 < z < 3.2000000000000001e-141 or 2.65e-89 < z < 8.5000000000000001e48Initial program 95.1%
associate-+l+95.1%
+-commutative95.1%
associate-+l+95.1%
fma-def95.1%
+-commutative95.1%
*-commutative95.1%
associate-*l*96.2%
distribute-lft-out99.9%
fma-def100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in y around 0 92.9%
Taylor expanded in z around 0 77.4%
if 1.05000000000000007e196 < z Initial program 82.5%
associate-+l+82.5%
+-commutative82.5%
associate-+l+82.5%
fma-def86.8%
+-commutative86.8%
*-commutative86.8%
associate-*l*79.3%
distribute-lft-out83.7%
fma-def83.7%
+-commutative83.7%
fma-def83.7%
Simplified83.7%
Taylor expanded in a around inf 66.7%
Taylor expanded in z around inf 66.7%
*-commutative66.7%
associate-*r*70.5%
Simplified70.5%
Final simplification70.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.5e+68) (not (<= z 3.7e+70))) (* z (+ y (* a b))) (+ x (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.5e+68) || !(z <= 3.7e+70)) {
tmp = z * (y + (a * b));
} 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 <= (-2.5d+68)) .or. (.not. (z <= 3.7d+70))) then
tmp = z * (y + (a * b))
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 <= -2.5e+68) || !(z <= 3.7e+70)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.5e+68) or not (z <= 3.7e+70): tmp = z * (y + (a * b)) else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.5e+68) || !(z <= 3.7e+70)) tmp = Float64(z * Float64(y + Float64(a * b))); 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 <= -2.5e+68) || ~((z <= 3.7e+70))) tmp = z * (y + (a * b)); else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.5e+68], N[Not[LessEqual[z, 3.7e+70]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $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 -2.5 \cdot 10^{+68} \lor \neg \left(z \leq 3.7 \cdot 10^{+70}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if z < -2.5000000000000002e68 or 3.69999999999999989e70 < z Initial program 83.5%
associate-+l+83.5%
+-commutative83.5%
associate-+l+83.5%
fma-def89.1%
+-commutative89.1%
*-commutative89.1%
associate-*l*82.7%
distribute-lft-out86.0%
fma-def86.0%
+-commutative86.0%
fma-def86.0%
Simplified86.0%
Taylor expanded in z around inf 86.9%
if -2.5000000000000002e68 < z < 3.69999999999999989e70Initial program 96.1%
associate-+l+96.1%
+-commutative96.1%
associate-+l+96.1%
fma-def96.1%
+-commutative96.1%
*-commutative96.1%
associate-*l*96.9%
distribute-lft-out99.9%
fma-def99.9%
+-commutative99.9%
fma-def100.0%
Simplified100.0%
Taylor expanded in y around 0 87.4%
Final simplification87.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1650000.0) (not (<= a 7e-74))) (+ x (* a (+ t (* z b)))) (+ (* z y) (+ x (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1650000.0) || !(a <= 7e-74)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = (z * y) + (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 ((a <= (-1650000.0d0)) .or. (.not. (a <= 7d-74))) then
tmp = x + (a * (t + (z * b)))
else
tmp = (z * y) + (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 ((a <= -1650000.0) || !(a <= 7e-74)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = (z * y) + (x + (a * t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1650000.0) or not (a <= 7e-74): tmp = x + (a * (t + (z * b))) else: tmp = (z * y) + (x + (a * t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1650000.0) || !(a <= 7e-74)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(Float64(z * y) + Float64(x + Float64(a * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1650000.0) || ~((a <= 7e-74))) tmp = x + (a * (t + (z * b))); else tmp = (z * y) + (x + (a * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1650000.0], N[Not[LessEqual[a, 7e-74]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * y), $MachinePrecision] + N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1650000 \lor \neg \left(a \leq 7 \cdot 10^{-74}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot y + \left(x + a \cdot t\right)\\
\end{array}
\end{array}
if a < -1.65e6 or 7.00000000000000029e-74 < a Initial program 86.4%
associate-+l+86.4%
+-commutative86.4%
associate-+l+86.4%
fma-def90.0%
+-commutative90.0%
*-commutative90.0%
associate-*l*93.5%
distribute-lft-out99.2%
fma-def99.2%
+-commutative99.2%
fma-def99.2%
Simplified99.2%
Taylor expanded in y around 0 92.4%
if -1.65e6 < a < 7.00000000000000029e-74Initial program 97.9%
associate-+l+97.9%
+-commutative97.9%
associate-+l+97.9%
fma-def97.9%
+-commutative97.9%
*-commutative97.9%
associate-*l*90.1%
distribute-lft-out90.1%
fma-def90.1%
+-commutative90.1%
fma-def90.1%
Simplified90.1%
Taylor expanded in b around 0 90.4%
Final simplification91.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -1.25e+90)
(* a t)
(if (<= t -4.9e-210)
x
(if (<= t 1.45e-21) (* a (* z b)) (if (<= t 6.4e+71) x (* a t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.25e+90) {
tmp = a * t;
} else if (t <= -4.9e-210) {
tmp = x;
} else if (t <= 1.45e-21) {
tmp = a * (z * b);
} else if (t <= 6.4e+71) {
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 <= (-1.25d+90)) then
tmp = a * t
else if (t <= (-4.9d-210)) then
tmp = x
else if (t <= 1.45d-21) then
tmp = a * (z * b)
else if (t <= 6.4d+71) 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 <= -1.25e+90) {
tmp = a * t;
} else if (t <= -4.9e-210) {
tmp = x;
} else if (t <= 1.45e-21) {
tmp = a * (z * b);
} else if (t <= 6.4e+71) {
tmp = x;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.25e+90: tmp = a * t elif t <= -4.9e-210: tmp = x elif t <= 1.45e-21: tmp = a * (z * b) elif t <= 6.4e+71: tmp = x else: tmp = a * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.25e+90) tmp = Float64(a * t); elseif (t <= -4.9e-210) tmp = x; elseif (t <= 1.45e-21) tmp = Float64(a * Float64(z * b)); elseif (t <= 6.4e+71) 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 <= -1.25e+90) tmp = a * t; elseif (t <= -4.9e-210) tmp = x; elseif (t <= 1.45e-21) tmp = a * (z * b); elseif (t <= 6.4e+71) tmp = x; else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.25e+90], N[(a * t), $MachinePrecision], If[LessEqual[t, -4.9e-210], x, If[LessEqual[t, 1.45e-21], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.4e+71], x, N[(a * t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.25 \cdot 10^{+90}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;t \leq -4.9 \cdot 10^{-210}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 1.45 \cdot 10^{-21}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;t \leq 6.4 \cdot 10^{+71}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if t < -1.2500000000000001e90 or 6.40000000000000046e71 < t Initial program 86.0%
associate-+l+86.0%
+-commutative86.0%
associate-+l+86.0%
fma-def88.2%
+-commutative88.2%
*-commutative88.2%
associate-*l*84.1%
distribute-lft-out92.7%
fma-def92.7%
+-commutative92.7%
fma-def92.7%
Simplified92.7%
Taylor expanded in a around inf 68.7%
Taylor expanded in z around 0 56.1%
*-commutative56.1%
Simplified56.1%
if -1.2500000000000001e90 < t < -4.8999999999999998e-210 or 1.45e-21 < t < 6.40000000000000046e71Initial program 96.2%
associate-+l+96.2%
+-commutative96.2%
associate-+l+96.2%
fma-def97.3%
+-commutative97.3%
*-commutative97.3%
associate-*l*95.7%
distribute-lft-out95.7%
fma-def95.8%
+-commutative95.8%
fma-def95.8%
Simplified95.8%
Taylor expanded in y around 0 74.3%
Taylor expanded in x around inf 39.7%
if -4.8999999999999998e-210 < t < 1.45e-21Initial program 93.2%
associate-+l+93.2%
+-commutative93.2%
associate-+l+93.2%
fma-def96.0%
+-commutative96.0%
*-commutative96.0%
associate-*l*97.2%
distribute-lft-out97.2%
fma-def97.2%
+-commutative97.2%
fma-def97.2%
Simplified97.2%
Taylor expanded in a around inf 49.3%
Taylor expanded in z around inf 49.2%
Final simplification48.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -9.5) (not (<= a 3350.0))) (* 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 <= -9.5) || !(a <= 3350.0)) {
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 <= (-9.5d0)) .or. (.not. (a <= 3350.0d0))) 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 <= -9.5) || !(a <= 3350.0)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -9.5) or not (a <= 3350.0): 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 <= -9.5) || !(a <= 3350.0)) 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 <= -9.5) || ~((a <= 3350.0))) 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, -9.5], N[Not[LessEqual[a, 3350.0]], $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 -9.5 \lor \neg \left(a \leq 3350\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -9.5 or 3350 < a Initial program 85.1%
associate-+l+85.1%
+-commutative85.1%
associate-+l+85.1%
fma-def89.1%
+-commutative89.1%
*-commutative89.1%
associate-*l*92.8%
distribute-lft-out99.1%
fma-def99.2%
+-commutative99.2%
fma-def99.2%
Simplified99.2%
Taylor expanded in a around inf 81.0%
if -9.5 < a < 3350Initial program 98.1%
associate-+l+98.1%
+-commutative98.1%
associate-+l+98.1%
fma-def98.1%
+-commutative98.1%
*-commutative98.1%
associate-*l*91.0%
distribute-lft-out91.0%
fma-def91.0%
+-commutative91.0%
fma-def91.0%
Simplified91.0%
Taylor expanded in a around 0 74.7%
Final simplification77.9%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.3e+90) (* a t) (if (<= t 5.4e+73) x (* a t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.3e+90) {
tmp = a * t;
} else if (t <= 5.4e+73) {
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 <= (-1.3d+90)) then
tmp = a * t
else if (t <= 5.4d+73) 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 <= -1.3e+90) {
tmp = a * t;
} else if (t <= 5.4e+73) {
tmp = x;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.3e+90: tmp = a * t elif t <= 5.4e+73: tmp = x else: tmp = a * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.3e+90) tmp = Float64(a * t); elseif (t <= 5.4e+73) 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 <= -1.3e+90) tmp = a * t; elseif (t <= 5.4e+73) tmp = x; else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.3e+90], N[(a * t), $MachinePrecision], If[LessEqual[t, 5.4e+73], x, N[(a * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.3 \cdot 10^{+90}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;t \leq 5.4 \cdot 10^{+73}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if t < -1.2999999999999999e90 or 5.3999999999999998e73 < t Initial program 86.0%
associate-+l+86.0%
+-commutative86.0%
associate-+l+86.0%
fma-def88.2%
+-commutative88.2%
*-commutative88.2%
associate-*l*84.1%
distribute-lft-out92.7%
fma-def92.7%
+-commutative92.7%
fma-def92.7%
Simplified92.7%
Taylor expanded in a around inf 68.7%
Taylor expanded in z around 0 56.1%
*-commutative56.1%
Simplified56.1%
if -1.2999999999999999e90 < t < 5.3999999999999998e73Initial program 94.9%
associate-+l+94.9%
+-commutative94.9%
associate-+l+94.9%
fma-def96.7%
+-commutative96.7%
*-commutative96.7%
associate-*l*96.4%
distribute-lft-out96.4%
fma-def96.4%
+-commutative96.4%
fma-def96.4%
Simplified96.4%
Taylor expanded in y around 0 74.2%
Taylor expanded in x around inf 34.3%
Final simplification42.3%
(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 91.7%
associate-+l+91.7%
+-commutative91.7%
associate-+l+91.7%
fma-def93.6%
+-commutative93.6%
*-commutative93.6%
associate-*l*91.9%
distribute-lft-out95.0%
fma-def95.1%
+-commutative95.1%
fma-def95.1%
Simplified95.1%
Taylor expanded in y around 0 76.7%
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 2023257
(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)))