
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
(FPCore (x y z t a b c) :precision binary64 (fma y x (+ (/ (* z t) 16.0) (- c (* b (* a 0.25))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(y, x, (((z * t) / 16.0) + (c - (b * (a * 0.25)))));
}
function code(x, y, z, t, a, b, c) return fma(y, x, Float64(Float64(Float64(z * t) / 16.0) + Float64(c - Float64(b * Float64(a * 0.25))))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(y * x + N[(N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision] + N[(c - N[(b * N[(a * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, x, \frac{z \cdot t}{16} + \left(c - b \cdot \left(a \cdot 0.25\right)\right)\right)
\end{array}
Initial program 97.7%
associate-+l-N/A
associate--l+N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
div-invN/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-eval98.5%
Applied egg-rr98.5%
Final simplification98.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* a (* b -0.25))) (t_2 (* 0.0625 (* z t))) (t_3 (+ t_2 t_1)))
(if (<= b -4.7e-108)
t_3
(if (<= b 1.2e+132)
(+ c (+ (* y x) t_2))
(if (<= b 1.8e+243) (+ (* y x) t_1) t_3)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = a * (b * -0.25);
double t_2 = 0.0625 * (z * t);
double t_3 = t_2 + t_1;
double tmp;
if (b <= -4.7e-108) {
tmp = t_3;
} else if (b <= 1.2e+132) {
tmp = c + ((y * x) + t_2);
} else if (b <= 1.8e+243) {
tmp = (y * x) + t_1;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = a * (b * (-0.25d0))
t_2 = 0.0625d0 * (z * t)
t_3 = t_2 + t_1
if (b <= (-4.7d-108)) then
tmp = t_3
else if (b <= 1.2d+132) then
tmp = c + ((y * x) + t_2)
else if (b <= 1.8d+243) then
tmp = (y * x) + t_1
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = a * (b * -0.25);
double t_2 = 0.0625 * (z * t);
double t_3 = t_2 + t_1;
double tmp;
if (b <= -4.7e-108) {
tmp = t_3;
} else if (b <= 1.2e+132) {
tmp = c + ((y * x) + t_2);
} else if (b <= 1.8e+243) {
tmp = (y * x) + t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = a * (b * -0.25) t_2 = 0.0625 * (z * t) t_3 = t_2 + t_1 tmp = 0 if b <= -4.7e-108: tmp = t_3 elif b <= 1.2e+132: tmp = c + ((y * x) + t_2) elif b <= 1.8e+243: tmp = (y * x) + t_1 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(a * Float64(b * -0.25)) t_2 = Float64(0.0625 * Float64(z * t)) t_3 = Float64(t_2 + t_1) tmp = 0.0 if (b <= -4.7e-108) tmp = t_3; elseif (b <= 1.2e+132) tmp = Float64(c + Float64(Float64(y * x) + t_2)); elseif (b <= 1.8e+243) tmp = Float64(Float64(y * x) + t_1); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = a * (b * -0.25); t_2 = 0.0625 * (z * t); t_3 = t_2 + t_1; tmp = 0.0; if (b <= -4.7e-108) tmp = t_3; elseif (b <= 1.2e+132) tmp = c + ((y * x) + t_2); elseif (b <= 1.8e+243) tmp = (y * x) + t_1; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 + t$95$1), $MachinePrecision]}, If[LessEqual[b, -4.7e-108], t$95$3, If[LessEqual[b, 1.2e+132], N[(c + N[(N[(y * x), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.8e+243], N[(N[(y * x), $MachinePrecision] + t$95$1), $MachinePrecision], t$95$3]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(b \cdot -0.25\right)\\
t_2 := 0.0625 \cdot \left(z \cdot t\right)\\
t_3 := t\_2 + t\_1\\
\mathbf{if}\;b \leq -4.7 \cdot 10^{-108}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;b \leq 1.2 \cdot 10^{+132}:\\
\;\;\;\;c + \left(y \cdot x + t\_2\right)\\
\mathbf{elif}\;b \leq 1.8 \cdot 10^{+243}:\\
\;\;\;\;y \cdot x + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if b < -4.70000000000000013e-108 or 1.7999999999999998e243 < b Initial program 97.3%
Taylor expanded in x around 0
*-lowering-*.f64N/A
*-lowering-*.f6479.2%
Simplified79.2%
Taylor expanded in c around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6467.3%
Simplified67.3%
if -4.70000000000000013e-108 < b < 1.2000000000000001e132Initial program 97.7%
Taylor expanded in a around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6491.6%
Simplified91.6%
if 1.2000000000000001e132 < b < 1.7999999999999998e243Initial program 100.0%
Taylor expanded in x around inf
*-lowering-*.f6495.5%
Simplified95.5%
Taylor expanded in c around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6491.0%
Simplified91.0%
Final simplification81.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))))
(if (<= (* b a) -5e+153)
(+ t_1 (* a (* b -0.25)))
(if (<= (* b a) 2e+99)
(+ c (+ (* y x) t_1))
(+ c (- (* y x) (/ (* b a) 4.0)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if ((b * a) <= -5e+153) {
tmp = t_1 + (a * (b * -0.25));
} else if ((b * a) <= 2e+99) {
tmp = c + ((y * x) + t_1);
} else {
tmp = c + ((y * x) - ((b * a) / 4.0));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = 0.0625d0 * (z * t)
if ((b * a) <= (-5d+153)) then
tmp = t_1 + (a * (b * (-0.25d0)))
else if ((b * a) <= 2d+99) then
tmp = c + ((y * x) + t_1)
else
tmp = c + ((y * x) - ((b * a) / 4.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if ((b * a) <= -5e+153) {
tmp = t_1 + (a * (b * -0.25));
} else if ((b * a) <= 2e+99) {
tmp = c + ((y * x) + t_1);
} else {
tmp = c + ((y * x) - ((b * a) / 4.0));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) tmp = 0 if (b * a) <= -5e+153: tmp = t_1 + (a * (b * -0.25)) elif (b * a) <= 2e+99: tmp = c + ((y * x) + t_1) else: tmp = c + ((y * x) - ((b * a) / 4.0)) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(z * t)) tmp = 0.0 if (Float64(b * a) <= -5e+153) tmp = Float64(t_1 + Float64(a * Float64(b * -0.25))); elseif (Float64(b * a) <= 2e+99) tmp = Float64(c + Float64(Float64(y * x) + t_1)); else tmp = Float64(c + Float64(Float64(y * x) - Float64(Float64(b * a) / 4.0))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 0.0625 * (z * t); tmp = 0.0; if ((b * a) <= -5e+153) tmp = t_1 + (a * (b * -0.25)); elseif ((b * a) <= 2e+99) tmp = c + ((y * x) + t_1); else tmp = c + ((y * x) - ((b * a) / 4.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * a), $MachinePrecision], -5e+153], N[(t$95$1 + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 2e+99], N[(c + N[(N[(y * x), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(y * x), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;b \cdot a \leq -5 \cdot 10^{+153}:\\
\;\;\;\;t\_1 + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;b \cdot a \leq 2 \cdot 10^{+99}:\\
\;\;\;\;c + \left(y \cdot x + t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;c + \left(y \cdot x - \frac{b \cdot a}{4}\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -5.00000000000000018e153Initial program 100.0%
Taylor expanded in x around 0
*-lowering-*.f64N/A
*-lowering-*.f6497.2%
Simplified97.2%
Taylor expanded in c around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6497.2%
Simplified97.2%
if -5.00000000000000018e153 < (*.f64 a b) < 1.9999999999999999e99Initial program 98.3%
Taylor expanded in a around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6493.3%
Simplified93.3%
if 1.9999999999999999e99 < (*.f64 a b) Initial program 94.0%
Taylor expanded in x around inf
*-lowering-*.f6488.0%
Simplified88.0%
Final simplification92.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (- (* y x) (* t (* z -0.0625)))))
(if (<= (* y x) -5.4e+118)
t_1
(if (<= (* y x) 3.6e+91) (+ (* 0.0625 (* z t)) (* a (* b -0.25))) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (y * x) - (t * (z * -0.0625));
double tmp;
if ((y * x) <= -5.4e+118) {
tmp = t_1;
} else if ((y * x) <= 3.6e+91) {
tmp = (0.0625 * (z * t)) + (a * (b * -0.25));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (y * x) - (t * (z * (-0.0625d0)))
if ((y * x) <= (-5.4d+118)) then
tmp = t_1
else if ((y * x) <= 3.6d+91) then
tmp = (0.0625d0 * (z * t)) + (a * (b * (-0.25d0)))
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 c) {
double t_1 = (y * x) - (t * (z * -0.0625));
double tmp;
if ((y * x) <= -5.4e+118) {
tmp = t_1;
} else if ((y * x) <= 3.6e+91) {
tmp = (0.0625 * (z * t)) + (a * (b * -0.25));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (y * x) - (t * (z * -0.0625)) tmp = 0 if (y * x) <= -5.4e+118: tmp = t_1 elif (y * x) <= 3.6e+91: tmp = (0.0625 * (z * t)) + (a * (b * -0.25)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(y * x) - Float64(t * Float64(z * -0.0625))) tmp = 0.0 if (Float64(y * x) <= -5.4e+118) tmp = t_1; elseif (Float64(y * x) <= 3.6e+91) tmp = Float64(Float64(0.0625 * Float64(z * t)) + Float64(a * Float64(b * -0.25))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (y * x) - (t * (z * -0.0625)); tmp = 0.0; if ((y * x) <= -5.4e+118) tmp = t_1; elseif ((y * x) <= 3.6e+91) tmp = (0.0625 * (z * t)) + (a * (b * -0.25)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(y * x), $MachinePrecision] - N[(t * N[(z * -0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(y * x), $MachinePrecision], -5.4e+118], t$95$1, If[LessEqual[N[(y * x), $MachinePrecision], 3.6e+91], N[(N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot x - t \cdot \left(z \cdot -0.0625\right)\\
\mathbf{if}\;y \cdot x \leq -5.4 \cdot 10^{+118}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \cdot x \leq 3.6 \cdot 10^{+91}:\\
\;\;\;\;0.0625 \cdot \left(z \cdot t\right) + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -5.4e118 or 3.6e91 < (*.f64 x y) Initial program 95.1%
Taylor expanded in a around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6488.2%
Simplified88.2%
Taylor expanded in c around 0
associate-*r*N/A
+-commutativeN/A
*-rgt-identityN/A
cancel-sign-subN/A
distribute-lft-neg-outN/A
*-rgt-identityN/A
mul-1-negN/A
associate-*r*N/A
associate-*r*N/A
metadata-evalN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6481.0%
Simplified81.0%
if -5.4e118 < (*.f64 x y) < 3.6e91Initial program 99.3%
Taylor expanded in x around 0
*-lowering-*.f64N/A
*-lowering-*.f6495.6%
Simplified95.6%
Taylor expanded in c around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6471.5%
Simplified71.5%
Final simplification75.1%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* a (* b -0.25))) (t_2 (- (* y x) (* t (* z -0.0625)))))
(if (<= z -9e+66)
t_2
(if (<= z -4.5e-240) (+ (* y x) t_1) (if (<= z 1.6e-21) (+ c t_1) t_2)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = a * (b * -0.25);
double t_2 = (y * x) - (t * (z * -0.0625));
double tmp;
if (z <= -9e+66) {
tmp = t_2;
} else if (z <= -4.5e-240) {
tmp = (y * x) + t_1;
} else if (z <= 1.6e-21) {
tmp = c + t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a * (b * (-0.25d0))
t_2 = (y * x) - (t * (z * (-0.0625d0)))
if (z <= (-9d+66)) then
tmp = t_2
else if (z <= (-4.5d-240)) then
tmp = (y * x) + t_1
else if (z <= 1.6d-21) then
tmp = c + 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 c) {
double t_1 = a * (b * -0.25);
double t_2 = (y * x) - (t * (z * -0.0625));
double tmp;
if (z <= -9e+66) {
tmp = t_2;
} else if (z <= -4.5e-240) {
tmp = (y * x) + t_1;
} else if (z <= 1.6e-21) {
tmp = c + t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = a * (b * -0.25) t_2 = (y * x) - (t * (z * -0.0625)) tmp = 0 if z <= -9e+66: tmp = t_2 elif z <= -4.5e-240: tmp = (y * x) + t_1 elif z <= 1.6e-21: tmp = c + t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(a * Float64(b * -0.25)) t_2 = Float64(Float64(y * x) - Float64(t * Float64(z * -0.0625))) tmp = 0.0 if (z <= -9e+66) tmp = t_2; elseif (z <= -4.5e-240) tmp = Float64(Float64(y * x) + t_1); elseif (z <= 1.6e-21) tmp = Float64(c + t_1); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = a * (b * -0.25); t_2 = (y * x) - (t * (z * -0.0625)); tmp = 0.0; if (z <= -9e+66) tmp = t_2; elseif (z <= -4.5e-240) tmp = (y * x) + t_1; elseif (z <= 1.6e-21) tmp = c + t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * x), $MachinePrecision] - N[(t * N[(z * -0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9e+66], t$95$2, If[LessEqual[z, -4.5e-240], N[(N[(y * x), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[z, 1.6e-21], N[(c + t$95$1), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(b \cdot -0.25\right)\\
t_2 := y \cdot x - t \cdot \left(z \cdot -0.0625\right)\\
\mathbf{if}\;z \leq -9 \cdot 10^{+66}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{-240}:\\
\;\;\;\;y \cdot x + t\_1\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-21}:\\
\;\;\;\;c + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -8.9999999999999997e66 or 1.6000000000000001e-21 < z Initial program 96.1%
Taylor expanded in a around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6479.7%
Simplified79.7%
Taylor expanded in c around 0
associate-*r*N/A
+-commutativeN/A
*-rgt-identityN/A
cancel-sign-subN/A
distribute-lft-neg-outN/A
*-rgt-identityN/A
mul-1-negN/A
associate-*r*N/A
associate-*r*N/A
metadata-evalN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6466.0%
Simplified66.0%
if -8.9999999999999997e66 < z < -4.5000000000000001e-240Initial program 98.2%
Taylor expanded in x around inf
*-lowering-*.f6487.8%
Simplified87.8%
Taylor expanded in c around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6469.5%
Simplified69.5%
if -4.5000000000000001e-240 < z < 1.6000000000000001e-21Initial program 100.0%
Taylor expanded in a around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6466.3%
Simplified66.3%
Final simplification66.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* a (* b -0.25))) (t_2 (+ c (* 0.0625 (* z t)))))
(if (<= z -1.2e+90)
t_2
(if (<= z -1.5e-239) (+ (* y x) t_1) (if (<= z 4.5e-17) (+ c t_1) t_2)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = a * (b * -0.25);
double t_2 = c + (0.0625 * (z * t));
double tmp;
if (z <= -1.2e+90) {
tmp = t_2;
} else if (z <= -1.5e-239) {
tmp = (y * x) + t_1;
} else if (z <= 4.5e-17) {
tmp = c + t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a * (b * (-0.25d0))
t_2 = c + (0.0625d0 * (z * t))
if (z <= (-1.2d+90)) then
tmp = t_2
else if (z <= (-1.5d-239)) then
tmp = (y * x) + t_1
else if (z <= 4.5d-17) then
tmp = c + 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 c) {
double t_1 = a * (b * -0.25);
double t_2 = c + (0.0625 * (z * t));
double tmp;
if (z <= -1.2e+90) {
tmp = t_2;
} else if (z <= -1.5e-239) {
tmp = (y * x) + t_1;
} else if (z <= 4.5e-17) {
tmp = c + t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = a * (b * -0.25) t_2 = c + (0.0625 * (z * t)) tmp = 0 if z <= -1.2e+90: tmp = t_2 elif z <= -1.5e-239: tmp = (y * x) + t_1 elif z <= 4.5e-17: tmp = c + t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(a * Float64(b * -0.25)) t_2 = Float64(c + Float64(0.0625 * Float64(z * t))) tmp = 0.0 if (z <= -1.2e+90) tmp = t_2; elseif (z <= -1.5e-239) tmp = Float64(Float64(y * x) + t_1); elseif (z <= 4.5e-17) tmp = Float64(c + t_1); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = a * (b * -0.25); t_2 = c + (0.0625 * (z * t)); tmp = 0.0; if (z <= -1.2e+90) tmp = t_2; elseif (z <= -1.5e-239) tmp = (y * x) + t_1; elseif (z <= 4.5e-17) tmp = c + t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.2e+90], t$95$2, If[LessEqual[z, -1.5e-239], N[(N[(y * x), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[z, 4.5e-17], N[(c + t$95$1), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(b \cdot -0.25\right)\\
t_2 := c + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;z \leq -1.2 \cdot 10^{+90}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-239}:\\
\;\;\;\;y \cdot x + t\_1\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-17}:\\
\;\;\;\;c + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1.20000000000000005e90 or 4.49999999999999978e-17 < z Initial program 96.8%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-lowering-*.f6462.8%
Simplified62.8%
if -1.20000000000000005e90 < z < -1.4999999999999999e-239Initial program 96.7%
Taylor expanded in x around inf
*-lowering-*.f6488.6%
Simplified88.6%
Taylor expanded in c around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6471.5%
Simplified71.5%
if -1.4999999999999999e-239 < z < 4.49999999999999978e-17Initial program 100.0%
Taylor expanded in a around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6465.4%
Simplified65.4%
Final simplification65.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* y x))))
(if (<= (* y x) -2e+119)
t_1
(if (<= (* y x) 3.7e+49) (+ c (* a (* b -0.25))) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (y * x);
double tmp;
if ((y * x) <= -2e+119) {
tmp = t_1;
} else if ((y * x) <= 3.7e+49) {
tmp = c + (a * (b * -0.25));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = c + (y * x)
if ((y * x) <= (-2d+119)) then
tmp = t_1
else if ((y * x) <= 3.7d+49) then
tmp = c + (a * (b * (-0.25d0)))
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 c) {
double t_1 = c + (y * x);
double tmp;
if ((y * x) <= -2e+119) {
tmp = t_1;
} else if ((y * x) <= 3.7e+49) {
tmp = c + (a * (b * -0.25));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (y * x) tmp = 0 if (y * x) <= -2e+119: tmp = t_1 elif (y * x) <= 3.7e+49: tmp = c + (a * (b * -0.25)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(y * x)) tmp = 0.0 if (Float64(y * x) <= -2e+119) tmp = t_1; elseif (Float64(y * x) <= 3.7e+49) tmp = Float64(c + Float64(a * Float64(b * -0.25))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (y * x); tmp = 0.0; if ((y * x) <= -2e+119) tmp = t_1; elseif ((y * x) <= 3.7e+49) tmp = c + (a * (b * -0.25)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(y * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(y * x), $MachinePrecision], -2e+119], t$95$1, If[LessEqual[N[(y * x), $MachinePrecision], 3.7e+49], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + y \cdot x\\
\mathbf{if}\;y \cdot x \leq -2 \cdot 10^{+119}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \cdot x \leq 3.7 \cdot 10^{+49}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -1.99999999999999989e119 or 3.70000000000000018e49 < (*.f64 x y) Initial program 95.5%
Taylor expanded in x around inf
*-lowering-*.f6474.0%
Simplified74.0%
if -1.99999999999999989e119 < (*.f64 x y) < 3.70000000000000018e49Initial program 99.3%
Taylor expanded in a around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6466.2%
Simplified66.2%
Final simplification69.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* y x))))
(if (<= (* y x) -4.8e+140)
t_1
(if (<= (* y x) 1.66e+59) (+ c (* 0.0625 (* z t))) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (y * x);
double tmp;
if ((y * x) <= -4.8e+140) {
tmp = t_1;
} else if ((y * x) <= 1.66e+59) {
tmp = c + (0.0625 * (z * t));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = c + (y * x)
if ((y * x) <= (-4.8d+140)) then
tmp = t_1
else if ((y * x) <= 1.66d+59) then
tmp = c + (0.0625d0 * (z * 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 c) {
double t_1 = c + (y * x);
double tmp;
if ((y * x) <= -4.8e+140) {
tmp = t_1;
} else if ((y * x) <= 1.66e+59) {
tmp = c + (0.0625 * (z * t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (y * x) tmp = 0 if (y * x) <= -4.8e+140: tmp = t_1 elif (y * x) <= 1.66e+59: tmp = c + (0.0625 * (z * t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(y * x)) tmp = 0.0 if (Float64(y * x) <= -4.8e+140) tmp = t_1; elseif (Float64(y * x) <= 1.66e+59) tmp = Float64(c + Float64(0.0625 * Float64(z * t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (y * x); tmp = 0.0; if ((y * x) <= -4.8e+140) tmp = t_1; elseif ((y * x) <= 1.66e+59) tmp = c + (0.0625 * (z * t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(y * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(y * x), $MachinePrecision], -4.8e+140], t$95$1, If[LessEqual[N[(y * x), $MachinePrecision], 1.66e+59], N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + y \cdot x\\
\mathbf{if}\;y \cdot x \leq -4.8 \cdot 10^{+140}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \cdot x \leq 1.66 \cdot 10^{+59}:\\
\;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -4.7999999999999999e140 or 1.6599999999999999e59 < (*.f64 x y) Initial program 95.2%
Taylor expanded in x around inf
*-lowering-*.f6476.0%
Simplified76.0%
if -4.7999999999999999e140 < (*.f64 x y) < 1.6599999999999999e59Initial program 99.3%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-lowering-*.f6458.2%
Simplified58.2%
Final simplification65.2%
(FPCore (x y z t a b c) :precision binary64 (if (<= (* y x) -3.6e+119) (* y x) (if (<= (* y x) 9.1e+49) (* a (* b -0.25)) (* y x))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((y * x) <= -3.6e+119) {
tmp = y * x;
} else if ((y * x) <= 9.1e+49) {
tmp = a * (b * -0.25);
} else {
tmp = y * x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: tmp
if ((y * x) <= (-3.6d+119)) then
tmp = y * x
else if ((y * x) <= 9.1d+49) then
tmp = a * (b * (-0.25d0))
else
tmp = y * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((y * x) <= -3.6e+119) {
tmp = y * x;
} else if ((y * x) <= 9.1e+49) {
tmp = a * (b * -0.25);
} else {
tmp = y * x;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (y * x) <= -3.6e+119: tmp = y * x elif (y * x) <= 9.1e+49: tmp = a * (b * -0.25) else: tmp = y * x return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(y * x) <= -3.6e+119) tmp = Float64(y * x); elseif (Float64(y * x) <= 9.1e+49) tmp = Float64(a * Float64(b * -0.25)); else tmp = Float64(y * x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((y * x) <= -3.6e+119) tmp = y * x; elseif ((y * x) <= 9.1e+49) tmp = a * (b * -0.25); else tmp = y * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(y * x), $MachinePrecision], -3.6e+119], N[(y * x), $MachinePrecision], If[LessEqual[N[(y * x), $MachinePrecision], 9.1e+49], N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \cdot x \leq -3.6 \cdot 10^{+119}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;y \cdot x \leq 9.1 \cdot 10^{+49}:\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if (*.f64 x y) < -3.60000000000000001e119 or 9.09999999999999986e49 < (*.f64 x y) Initial program 95.5%
Taylor expanded in x around inf
*-lowering-*.f6465.4%
Simplified65.4%
if -3.60000000000000001e119 < (*.f64 x y) < 9.09999999999999986e49Initial program 99.3%
Taylor expanded in a around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6442.4%
Simplified42.4%
Final simplification52.0%
(FPCore (x y z t a b c) :precision binary64 (if (<= (* y x) -1.8e+141) (* y x) (if (<= (* y x) 1.7e+63) (* 0.0625 (* z t)) (* y x))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((y * x) <= -1.8e+141) {
tmp = y * x;
} else if ((y * x) <= 1.7e+63) {
tmp = 0.0625 * (z * t);
} else {
tmp = y * x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: tmp
if ((y * x) <= (-1.8d+141)) then
tmp = y * x
else if ((y * x) <= 1.7d+63) then
tmp = 0.0625d0 * (z * t)
else
tmp = y * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((y * x) <= -1.8e+141) {
tmp = y * x;
} else if ((y * x) <= 1.7e+63) {
tmp = 0.0625 * (z * t);
} else {
tmp = y * x;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (y * x) <= -1.8e+141: tmp = y * x elif (y * x) <= 1.7e+63: tmp = 0.0625 * (z * t) else: tmp = y * x return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(y * x) <= -1.8e+141) tmp = Float64(y * x); elseif (Float64(y * x) <= 1.7e+63) tmp = Float64(0.0625 * Float64(z * t)); else tmp = Float64(y * x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((y * x) <= -1.8e+141) tmp = y * x; elseif ((y * x) <= 1.7e+63) tmp = 0.0625 * (z * t); else tmp = y * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(y * x), $MachinePrecision], -1.8e+141], N[(y * x), $MachinePrecision], If[LessEqual[N[(y * x), $MachinePrecision], 1.7e+63], N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \cdot x \leq -1.8 \cdot 10^{+141}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;y \cdot x \leq 1.7 \cdot 10^{+63}:\\
\;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if (*.f64 x y) < -1.8000000000000001e141 or 1.6999999999999999e63 < (*.f64 x y) Initial program 95.2%
Taylor expanded in x around inf
*-lowering-*.f6467.8%
Simplified67.8%
if -1.8000000000000001e141 < (*.f64 x y) < 1.6999999999999999e63Initial program 99.3%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-lowering-*.f6434.5%
Simplified34.5%
Final simplification47.5%
(FPCore (x y z t a b c) :precision binary64 (if (<= (* y x) -3.1e+84) (* y x) (if (<= (* y x) 7.3e+50) c (* y x))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((y * x) <= -3.1e+84) {
tmp = y * x;
} else if ((y * x) <= 7.3e+50) {
tmp = c;
} else {
tmp = y * x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: tmp
if ((y * x) <= (-3.1d+84)) then
tmp = y * x
else if ((y * x) <= 7.3d+50) then
tmp = c
else
tmp = y * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((y * x) <= -3.1e+84) {
tmp = y * x;
} else if ((y * x) <= 7.3e+50) {
tmp = c;
} else {
tmp = y * x;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (y * x) <= -3.1e+84: tmp = y * x elif (y * x) <= 7.3e+50: tmp = c else: tmp = y * x return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(y * x) <= -3.1e+84) tmp = Float64(y * x); elseif (Float64(y * x) <= 7.3e+50) tmp = c; else tmp = Float64(y * x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((y * x) <= -3.1e+84) tmp = y * x; elseif ((y * x) <= 7.3e+50) tmp = c; else tmp = y * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(y * x), $MachinePrecision], -3.1e+84], N[(y * x), $MachinePrecision], If[LessEqual[N[(y * x), $MachinePrecision], 7.3e+50], c, N[(y * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \cdot x \leq -3.1 \cdot 10^{+84}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;y \cdot x \leq 7.3 \cdot 10^{+50}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if (*.f64 x y) < -3.10000000000000003e84 or 7.3000000000000003e50 < (*.f64 x y) Initial program 95.7%
Taylor expanded in x around inf
*-lowering-*.f6464.1%
Simplified64.1%
if -3.10000000000000003e84 < (*.f64 x y) < 7.3000000000000003e50Initial program 99.3%
Taylor expanded in c around inf
Simplified26.4%
Final simplification42.7%
(FPCore (x y z t a b c) :precision binary64 (+ c (- (+ (* y x) (* z (/ t 16.0))) (/ (* b a) 4.0))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return c + (((y * x) + (z * (t / 16.0))) - ((b * a) / 4.0));
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
code = c + (((y * x) + (z * (t / 16.0d0))) - ((b * a) / 4.0d0))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c + (((y * x) + (z * (t / 16.0))) - ((b * a) / 4.0));
}
def code(x, y, z, t, a, b, c): return c + (((y * x) + (z * (t / 16.0))) - ((b * a) / 4.0))
function code(x, y, z, t, a, b, c) return Float64(c + Float64(Float64(Float64(y * x) + Float64(z * Float64(t / 16.0))) - Float64(Float64(b * a) / 4.0))) end
function tmp = code(x, y, z, t, a, b, c) tmp = c + (((y * x) + (z * (t / 16.0))) - ((b * a) / 4.0)); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(N[(N[(y * x), $MachinePrecision] + N[(z * N[(t / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c + \left(\left(y \cdot x + z \cdot \frac{t}{16}\right) - \frac{b \cdot a}{4}\right)
\end{array}
Initial program 97.7%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6498.0%
Applied egg-rr98.0%
Final simplification98.0%
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (* a (* b -0.25)))) (if (<= b -4.7e-108) t_1 (if (<= b 8.5e+109) (+ c (* y x)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = a * (b * -0.25);
double tmp;
if (b <= -4.7e-108) {
tmp = t_1;
} else if (b <= 8.5e+109) {
tmp = c + (y * x);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = a * (b * (-0.25d0))
if (b <= (-4.7d-108)) then
tmp = t_1
else if (b <= 8.5d+109) then
tmp = c + (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 c) {
double t_1 = a * (b * -0.25);
double tmp;
if (b <= -4.7e-108) {
tmp = t_1;
} else if (b <= 8.5e+109) {
tmp = c + (y * x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = a * (b * -0.25) tmp = 0 if b <= -4.7e-108: tmp = t_1 elif b <= 8.5e+109: tmp = c + (y * x) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(a * Float64(b * -0.25)) tmp = 0.0 if (b <= -4.7e-108) tmp = t_1; elseif (b <= 8.5e+109) tmp = Float64(c + Float64(y * x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = a * (b * -0.25); tmp = 0.0; if (b <= -4.7e-108) tmp = t_1; elseif (b <= 8.5e+109) tmp = c + (y * x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -4.7e-108], t$95$1, If[LessEqual[b, 8.5e+109], N[(c + N[(y * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(b \cdot -0.25\right)\\
\mathbf{if}\;b \leq -4.7 \cdot 10^{-108}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 8.5 \cdot 10^{+109}:\\
\;\;\;\;c + y \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -4.70000000000000013e-108 or 8.5000000000000004e109 < b Initial program 97.8%
Taylor expanded in a around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6452.7%
Simplified52.7%
if -4.70000000000000013e-108 < b < 8.5000000000000004e109Initial program 97.6%
Taylor expanded in x around inf
*-lowering-*.f6461.7%
Simplified61.7%
Final simplification57.1%
(FPCore (x y z t a b c) :precision binary64 c)
double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
code = c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
def code(x, y, z, t, a, b, c): return c
function code(x, y, z, t, a, b, c) return c end
function tmp = code(x, y, z, t, a, b, c) tmp = c; end
code[x_, y_, z_, t_, a_, b_, c_] := c
\begin{array}{l}
\\
c
\end{array}
Initial program 97.7%
Taylor expanded in c around inf
Simplified18.9%
herbie shell --seed 2024185
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:quartForm from diagrams-solve-0.1, C"
:precision binary64
(+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))