
(FPCore (x y z t) :precision binary64 (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * ((((y + z) + z) + y) + t)) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
def code(x, y, z, t): return (x * ((((y + z) + z) + y) + t)) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(Float64(Float64(Float64(y + z) + z) + y) + t)) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * ((((y + z) + z) + y) + t)) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(N[(N[(y + z), $MachinePrecision] + z), $MachinePrecision] + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * ((((y + z) + z) + y) + t)) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
def code(x, y, z, t): return (x * ((((y + z) + z) + y) + t)) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(Float64(Float64(Float64(y + z) + z) + y) + t)) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * ((((y + z) + z) + y) + t)) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(N[(N[(y + z), $MachinePrecision] + z), $MachinePrecision] + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (+ y z))))
(if (<= x -1.5e-50)
(* x (+ t (+ t_1 (* 5.0 (/ y x)))))
(if (<= x 2e+109)
(+ (* x (+ t (* 2.0 z))) (* y (+ 5.0 (* x 2.0))))
(* x (+ t_1 t))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (y + z);
double tmp;
if (x <= -1.5e-50) {
tmp = x * (t + (t_1 + (5.0 * (y / x))));
} else if (x <= 2e+109) {
tmp = (x * (t + (2.0 * z))) + (y * (5.0 + (x * 2.0)));
} else {
tmp = x * (t_1 + t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (y + z)
if (x <= (-1.5d-50)) then
tmp = x * (t + (t_1 + (5.0d0 * (y / x))))
else if (x <= 2d+109) then
tmp = (x * (t + (2.0d0 * z))) + (y * (5.0d0 + (x * 2.0d0)))
else
tmp = x * (t_1 + t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (y + z);
double tmp;
if (x <= -1.5e-50) {
tmp = x * (t + (t_1 + (5.0 * (y / x))));
} else if (x <= 2e+109) {
tmp = (x * (t + (2.0 * z))) + (y * (5.0 + (x * 2.0)));
} else {
tmp = x * (t_1 + t);
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (y + z) tmp = 0 if x <= -1.5e-50: tmp = x * (t + (t_1 + (5.0 * (y / x)))) elif x <= 2e+109: tmp = (x * (t + (2.0 * z))) + (y * (5.0 + (x * 2.0))) else: tmp = x * (t_1 + t) return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(y + z)) tmp = 0.0 if (x <= -1.5e-50) tmp = Float64(x * Float64(t + Float64(t_1 + Float64(5.0 * Float64(y / x))))); elseif (x <= 2e+109) tmp = Float64(Float64(x * Float64(t + Float64(2.0 * z))) + Float64(y * Float64(5.0 + Float64(x * 2.0)))); else tmp = Float64(x * Float64(t_1 + t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (y + z); tmp = 0.0; if (x <= -1.5e-50) tmp = x * (t + (t_1 + (5.0 * (y / x)))); elseif (x <= 2e+109) tmp = (x * (t + (2.0 * z))) + (y * (5.0 + (x * 2.0))); else tmp = x * (t_1 + t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.5e-50], N[(x * N[(t + N[(t$95$1 + N[(5.0 * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2e+109], N[(N[(x * N[(t + N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t$95$1 + t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(y + z\right)\\
\mathbf{if}\;x \leq -1.5 \cdot 10^{-50}:\\
\;\;\;\;x \cdot \left(t + \left(t\_1 + 5 \cdot \frac{y}{x}\right)\right)\\
\mathbf{elif}\;x \leq 2 \cdot 10^{+109}:\\
\;\;\;\;x \cdot \left(t + 2 \cdot z\right) + y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t\_1 + t\right)\\
\end{array}
\end{array}
if x < -1.49999999999999995e-50Initial program 99.9%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
if -1.49999999999999995e-50 < x < 1.99999999999999996e109Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in y around 0 99.9%
if 1.99999999999999996e109 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (fma x (+ (* 2.0 (+ y z)) t) (* y 5.0)))
double code(double x, double y, double z, double t) {
return fma(x, ((2.0 * (y + z)) + t), (y * 5.0));
}
function code(x, y, z, t) return fma(x, Float64(Float64(2.0 * Float64(y + z)) + t), Float64(y * 5.0)) end
code[x_, y_, z_, t_] := N[(x * N[(N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, 2 \cdot \left(y + z\right) + t, y \cdot 5\right)
\end{array}
Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
(FPCore (x y z t)
:precision binary64
(if (<= y -4.6e+238)
(* y (+ 5.0 (* x 2.0)))
(if (<= y 5.2e+60)
(* x (+ t (+ (* 2.0 (+ y z)) (* 5.0 (/ y x)))))
(+ (* y 5.0) (* 2.0 (* x (+ y z)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.6e+238) {
tmp = y * (5.0 + (x * 2.0));
} else if (y <= 5.2e+60) {
tmp = x * (t + ((2.0 * (y + z)) + (5.0 * (y / x))));
} else {
tmp = (y * 5.0) + (2.0 * (x * (y + z)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-4.6d+238)) then
tmp = y * (5.0d0 + (x * 2.0d0))
else if (y <= 5.2d+60) then
tmp = x * (t + ((2.0d0 * (y + z)) + (5.0d0 * (y / x))))
else
tmp = (y * 5.0d0) + (2.0d0 * (x * (y + z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.6e+238) {
tmp = y * (5.0 + (x * 2.0));
} else if (y <= 5.2e+60) {
tmp = x * (t + ((2.0 * (y + z)) + (5.0 * (y / x))));
} else {
tmp = (y * 5.0) + (2.0 * (x * (y + z)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4.6e+238: tmp = y * (5.0 + (x * 2.0)) elif y <= 5.2e+60: tmp = x * (t + ((2.0 * (y + z)) + (5.0 * (y / x)))) else: tmp = (y * 5.0) + (2.0 * (x * (y + z))) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4.6e+238) tmp = Float64(y * Float64(5.0 + Float64(x * 2.0))); elseif (y <= 5.2e+60) tmp = Float64(x * Float64(t + Float64(Float64(2.0 * Float64(y + z)) + Float64(5.0 * Float64(y / x))))); else tmp = Float64(Float64(y * 5.0) + Float64(2.0 * Float64(x * Float64(y + z)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -4.6e+238) tmp = y * (5.0 + (x * 2.0)); elseif (y <= 5.2e+60) tmp = x * (t + ((2.0 * (y + z)) + (5.0 * (y / x)))); else tmp = (y * 5.0) + (2.0 * (x * (y + z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.6e+238], N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.2e+60], N[(x * N[(t + N[(N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision] + N[(5.0 * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.6 \cdot 10^{+238}:\\
\;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+60}:\\
\;\;\;\;x \cdot \left(t + \left(2 \cdot \left(y + z\right) + 5 \cdot \frac{y}{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\end{array}
\end{array}
if y < -4.60000000000000005e238Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in y around inf 99.9%
if -4.60000000000000005e238 < y < 5.20000000000000016e60Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 97.2%
if 5.20000000000000016e60 < y Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in t around 0 98.1%
Final simplification97.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ (* 2.0 (+ y z)) t))))
(if (<= x -7.5e-6)
t_1
(if (<= x -3.2e-130)
(+ (* y 5.0) (* 2.0 (* x (+ y z))))
(if (<= x 1.1e-129) (+ (* y 5.0) (* x t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((2.0 * (y + z)) + t);
double tmp;
if (x <= -7.5e-6) {
tmp = t_1;
} else if (x <= -3.2e-130) {
tmp = (y * 5.0) + (2.0 * (x * (y + z)));
} else if (x <= 1.1e-129) {
tmp = (y * 5.0) + (x * t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * ((2.0d0 * (y + z)) + t)
if (x <= (-7.5d-6)) then
tmp = t_1
else if (x <= (-3.2d-130)) then
tmp = (y * 5.0d0) + (2.0d0 * (x * (y + z)))
else if (x <= 1.1d-129) then
tmp = (y * 5.0d0) + (x * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * ((2.0 * (y + z)) + t);
double tmp;
if (x <= -7.5e-6) {
tmp = t_1;
} else if (x <= -3.2e-130) {
tmp = (y * 5.0) + (2.0 * (x * (y + z)));
} else if (x <= 1.1e-129) {
tmp = (y * 5.0) + (x * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((2.0 * (y + z)) + t) tmp = 0 if x <= -7.5e-6: tmp = t_1 elif x <= -3.2e-130: tmp = (y * 5.0) + (2.0 * (x * (y + z))) elif x <= 1.1e-129: tmp = (y * 5.0) + (x * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(2.0 * Float64(y + z)) + t)) tmp = 0.0 if (x <= -7.5e-6) tmp = t_1; elseif (x <= -3.2e-130) tmp = Float64(Float64(y * 5.0) + Float64(2.0 * Float64(x * Float64(y + z)))); elseif (x <= 1.1e-129) tmp = Float64(Float64(y * 5.0) + Float64(x * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((2.0 * (y + z)) + t); tmp = 0.0; if (x <= -7.5e-6) tmp = t_1; elseif (x <= -3.2e-130) tmp = (y * 5.0) + (2.0 * (x * (y + z))); elseif (x <= 1.1e-129) tmp = (y * 5.0) + (x * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7.5e-6], t$95$1, If[LessEqual[x, -3.2e-130], N[(N[(y * 5.0), $MachinePrecision] + N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.1e-129], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(2 \cdot \left(y + z\right) + t\right)\\
\mathbf{if}\;x \leq -7.5 \cdot 10^{-6}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -3.2 \cdot 10^{-130}:\\
\;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{-129}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -7.50000000000000019e-6 or 1.10000000000000001e-129 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 96.5%
if -7.50000000000000019e-6 < x < -3.2e-130Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in t around 0 85.9%
if -3.2e-130 < x < 1.10000000000000001e-129Initial program 99.9%
Taylor expanded in t around inf 87.2%
Final simplification92.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ (* 2.0 (+ y z)) t))))
(if (<= x -5e-17)
t_1
(if (<= x -3.6e-131)
(+ (* y 5.0) (* 2.0 (* x z)))
(if (<= x 1.15e-129) (+ (* y 5.0) (* x t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((2.0 * (y + z)) + t);
double tmp;
if (x <= -5e-17) {
tmp = t_1;
} else if (x <= -3.6e-131) {
tmp = (y * 5.0) + (2.0 * (x * z));
} else if (x <= 1.15e-129) {
tmp = (y * 5.0) + (x * t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * ((2.0d0 * (y + z)) + t)
if (x <= (-5d-17)) then
tmp = t_1
else if (x <= (-3.6d-131)) then
tmp = (y * 5.0d0) + (2.0d0 * (x * z))
else if (x <= 1.15d-129) then
tmp = (y * 5.0d0) + (x * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * ((2.0 * (y + z)) + t);
double tmp;
if (x <= -5e-17) {
tmp = t_1;
} else if (x <= -3.6e-131) {
tmp = (y * 5.0) + (2.0 * (x * z));
} else if (x <= 1.15e-129) {
tmp = (y * 5.0) + (x * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((2.0 * (y + z)) + t) tmp = 0 if x <= -5e-17: tmp = t_1 elif x <= -3.6e-131: tmp = (y * 5.0) + (2.0 * (x * z)) elif x <= 1.15e-129: tmp = (y * 5.0) + (x * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(2.0 * Float64(y + z)) + t)) tmp = 0.0 if (x <= -5e-17) tmp = t_1; elseif (x <= -3.6e-131) tmp = Float64(Float64(y * 5.0) + Float64(2.0 * Float64(x * z))); elseif (x <= 1.15e-129) tmp = Float64(Float64(y * 5.0) + Float64(x * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((2.0 * (y + z)) + t); tmp = 0.0; if (x <= -5e-17) tmp = t_1; elseif (x <= -3.6e-131) tmp = (y * 5.0) + (2.0 * (x * z)); elseif (x <= 1.15e-129) tmp = (y * 5.0) + (x * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5e-17], t$95$1, If[LessEqual[x, -3.6e-131], N[(N[(y * 5.0), $MachinePrecision] + N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.15e-129], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(2 \cdot \left(y + z\right) + t\right)\\
\mathbf{if}\;x \leq -5 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -3.6 \cdot 10^{-131}:\\
\;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-129}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.9999999999999999e-17 or 1.15e-129 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 95.9%
if -4.9999999999999999e-17 < x < -3.5999999999999999e-131Initial program 99.9%
Taylor expanded in z around inf 87.5%
if -3.5999999999999999e-131 < x < 1.15e-129Initial program 99.9%
Taylor expanded in t around inf 87.2%
Final simplification92.3%
(FPCore (x y z t)
:precision binary64
(if (<= x -1e-17)
(* x (* 2.0 (+ y z)))
(if (<= x 5e-131)
(* y 5.0)
(if (<= x 1.3e+63) (* x (+ t (* 2.0 z))) (* x (+ t (* 2.0 y)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1e-17) {
tmp = x * (2.0 * (y + z));
} else if (x <= 5e-131) {
tmp = y * 5.0;
} else if (x <= 1.3e+63) {
tmp = x * (t + (2.0 * z));
} else {
tmp = x * (t + (2.0 * y));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-1d-17)) then
tmp = x * (2.0d0 * (y + z))
else if (x <= 5d-131) then
tmp = y * 5.0d0
else if (x <= 1.3d+63) then
tmp = x * (t + (2.0d0 * z))
else
tmp = x * (t + (2.0d0 * y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1e-17) {
tmp = x * (2.0 * (y + z));
} else if (x <= 5e-131) {
tmp = y * 5.0;
} else if (x <= 1.3e+63) {
tmp = x * (t + (2.0 * z));
} else {
tmp = x * (t + (2.0 * y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1e-17: tmp = x * (2.0 * (y + z)) elif x <= 5e-131: tmp = y * 5.0 elif x <= 1.3e+63: tmp = x * (t + (2.0 * z)) else: tmp = x * (t + (2.0 * y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1e-17) tmp = Float64(x * Float64(2.0 * Float64(y + z))); elseif (x <= 5e-131) tmp = Float64(y * 5.0); elseif (x <= 1.3e+63) tmp = Float64(x * Float64(t + Float64(2.0 * z))); else tmp = Float64(x * Float64(t + Float64(2.0 * y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1e-17) tmp = x * (2.0 * (y + z)); elseif (x <= 5e-131) tmp = y * 5.0; elseif (x <= 1.3e+63) tmp = x * (t + (2.0 * z)); else tmp = x * (t + (2.0 * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1e-17], N[(x * N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5e-131], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 1.3e+63], N[(x * N[(t + N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t + N[(2.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{-17}:\\
\;\;\;\;x \cdot \left(2 \cdot \left(y + z\right)\right)\\
\mathbf{elif}\;x \leq 5 \cdot 10^{-131}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{+63}:\\
\;\;\;\;x \cdot \left(t + 2 \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + 2 \cdot y\right)\\
\end{array}
\end{array}
if x < -1.00000000000000007e-17Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 98.6%
Taylor expanded in t around 0 77.9%
+-commutative77.9%
Simplified77.9%
if -1.00000000000000007e-17 < x < 5.0000000000000004e-131Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in y around inf 64.4%
Taylor expanded in x around 0 64.4%
if 5.0000000000000004e-131 < x < 1.3000000000000001e63Initial program 99.9%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 83.1%
Taylor expanded in y around 0 80.2%
if 1.3000000000000001e63 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
Taylor expanded in z around 0 77.8%
Final simplification72.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (* x 2.0))))
(if (<= x -8.6e-5)
t_1
(if (<= x 2.6e-90) (* y 5.0) (if (<= x 1.1e+52) (* x t) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = y * (x * 2.0);
double tmp;
if (x <= -8.6e-5) {
tmp = t_1;
} else if (x <= 2.6e-90) {
tmp = y * 5.0;
} else if (x <= 1.1e+52) {
tmp = x * t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = y * (x * 2.0d0)
if (x <= (-8.6d-5)) then
tmp = t_1
else if (x <= 2.6d-90) then
tmp = y * 5.0d0
else if (x <= 1.1d+52) then
tmp = x * t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y * (x * 2.0);
double tmp;
if (x <= -8.6e-5) {
tmp = t_1;
} else if (x <= 2.6e-90) {
tmp = y * 5.0;
} else if (x <= 1.1e+52) {
tmp = x * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (x * 2.0) tmp = 0 if x <= -8.6e-5: tmp = t_1 elif x <= 2.6e-90: tmp = y * 5.0 elif x <= 1.1e+52: tmp = x * t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(x * 2.0)) tmp = 0.0 if (x <= -8.6e-5) tmp = t_1; elseif (x <= 2.6e-90) tmp = Float64(y * 5.0); elseif (x <= 1.1e+52) tmp = Float64(x * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (x * 2.0); tmp = 0.0; if (x <= -8.6e-5) tmp = t_1; elseif (x <= 2.6e-90) tmp = y * 5.0; elseif (x <= 1.1e+52) tmp = x * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8.6e-5], t$95$1, If[LessEqual[x, 2.6e-90], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 1.1e+52], N[(x * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(x \cdot 2\right)\\
\mathbf{if}\;x \leq -8.6 \cdot 10^{-5}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{-90}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{+52}:\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -8.6000000000000003e-5 or 1.1e52 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in y around inf 47.3%
Taylor expanded in x around inf 47.3%
if -8.6000000000000003e-5 < x < 2.6e-90Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in y around inf 61.2%
Taylor expanded in x around 0 61.1%
if 2.6e-90 < x < 1.1e52Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 84.5%
Taylor expanded in z around 0 52.8%
Taylor expanded in t around inf 49.0%
*-commutative49.0%
Simplified49.0%
Final simplification53.7%
(FPCore (x y z t) :precision binary64 (if (or (<= x -4.5e-20) (not (<= x 1.15e-129))) (* x (+ (* 2.0 (+ y z)) t)) (+ (* y 5.0) (* x t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -4.5e-20) || !(x <= 1.15e-129)) {
tmp = x * ((2.0 * (y + z)) + t);
} else {
tmp = (y * 5.0) + (x * t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-4.5d-20)) .or. (.not. (x <= 1.15d-129))) then
tmp = x * ((2.0d0 * (y + z)) + t)
else
tmp = (y * 5.0d0) + (x * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -4.5e-20) || !(x <= 1.15e-129)) {
tmp = x * ((2.0 * (y + z)) + t);
} else {
tmp = (y * 5.0) + (x * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -4.5e-20) or not (x <= 1.15e-129): tmp = x * ((2.0 * (y + z)) + t) else: tmp = (y * 5.0) + (x * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -4.5e-20) || !(x <= 1.15e-129)) tmp = Float64(x * Float64(Float64(2.0 * Float64(y + z)) + t)); else tmp = Float64(Float64(y * 5.0) + Float64(x * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -4.5e-20) || ~((x <= 1.15e-129))) tmp = x * ((2.0 * (y + z)) + t); else tmp = (y * 5.0) + (x * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -4.5e-20], N[Not[LessEqual[x, 1.15e-129]], $MachinePrecision]], N[(x * N[(N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{-20} \lor \neg \left(x \leq 1.15 \cdot 10^{-129}\right):\\
\;\;\;\;x \cdot \left(2 \cdot \left(y + z\right) + t\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\end{array}
\end{array}
if x < -4.5000000000000001e-20 or 1.15e-129 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 95.9%
if -4.5000000000000001e-20 < x < 1.15e-129Initial program 99.9%
Taylor expanded in t around inf 81.9%
Final simplification90.1%
(FPCore (x y z t) :precision binary64 (if (or (<= y -7.5e+99) (not (<= y 6.9e-16))) (* y (+ 5.0 (* x 2.0))) (* x (+ t (* 2.0 z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -7.5e+99) || !(y <= 6.9e-16)) {
tmp = y * (5.0 + (x * 2.0));
} else {
tmp = x * (t + (2.0 * z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-7.5d+99)) .or. (.not. (y <= 6.9d-16))) then
tmp = y * (5.0d0 + (x * 2.0d0))
else
tmp = x * (t + (2.0d0 * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -7.5e+99) || !(y <= 6.9e-16)) {
tmp = y * (5.0 + (x * 2.0));
} else {
tmp = x * (t + (2.0 * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -7.5e+99) or not (y <= 6.9e-16): tmp = y * (5.0 + (x * 2.0)) else: tmp = x * (t + (2.0 * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -7.5e+99) || !(y <= 6.9e-16)) tmp = Float64(y * Float64(5.0 + Float64(x * 2.0))); else tmp = Float64(x * Float64(t + Float64(2.0 * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -7.5e+99) || ~((y <= 6.9e-16))) tmp = y * (5.0 + (x * 2.0)); else tmp = x * (t + (2.0 * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -7.5e+99], N[Not[LessEqual[y, 6.9e-16]], $MachinePrecision]], N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t + N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5 \cdot 10^{+99} \lor \neg \left(y \leq 6.9 \cdot 10^{-16}\right):\\
\;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + 2 \cdot z\right)\\
\end{array}
\end{array}
if y < -7.49999999999999963e99 or 6.8999999999999997e-16 < y Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in y around inf 83.6%
if -7.49999999999999963e99 < y < 6.8999999999999997e-16Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 85.8%
Taylor expanded in y around 0 80.8%
Final simplification82.1%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.32e-23) (not (<= x 5.3e-130))) (* x (* 2.0 (+ y z))) (* y 5.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.32e-23) || !(x <= 5.3e-130)) {
tmp = x * (2.0 * (y + z));
} else {
tmp = y * 5.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-1.32d-23)) .or. (.not. (x <= 5.3d-130))) then
tmp = x * (2.0d0 * (y + z))
else
tmp = y * 5.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.32e-23) || !(x <= 5.3e-130)) {
tmp = x * (2.0 * (y + z));
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.32e-23) or not (x <= 5.3e-130): tmp = x * (2.0 * (y + z)) else: tmp = y * 5.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.32e-23) || !(x <= 5.3e-130)) tmp = Float64(x * Float64(2.0 * Float64(y + z))); else tmp = Float64(y * 5.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.32e-23) || ~((x <= 5.3e-130))) tmp = x * (2.0 * (y + z)); else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.32e-23], N[Not[LessEqual[x, 5.3e-130]], $MachinePrecision]], N[(x * N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.32 \cdot 10^{-23} \lor \neg \left(x \leq 5.3 \cdot 10^{-130}\right):\\
\;\;\;\;x \cdot \left(2 \cdot \left(y + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -1.31999999999999994e-23 or 5.3000000000000004e-130 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 95.9%
Taylor expanded in t around 0 70.0%
+-commutative70.0%
Simplified70.0%
if -1.31999999999999994e-23 < x < 5.3000000000000004e-130Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in y around inf 64.4%
Taylor expanded in x around 0 64.4%
Final simplification67.6%
(FPCore (x y z t) :precision binary64 (if (<= x -7.2e-18) (* x (* 2.0 (+ y z))) (if (<= x 2.6e-90) (* y 5.0) (* x (+ t (* 2.0 y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -7.2e-18) {
tmp = x * (2.0 * (y + z));
} else if (x <= 2.6e-90) {
tmp = y * 5.0;
} else {
tmp = x * (t + (2.0 * y));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-7.2d-18)) then
tmp = x * (2.0d0 * (y + z))
else if (x <= 2.6d-90) then
tmp = y * 5.0d0
else
tmp = x * (t + (2.0d0 * y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -7.2e-18) {
tmp = x * (2.0 * (y + z));
} else if (x <= 2.6e-90) {
tmp = y * 5.0;
} else {
tmp = x * (t + (2.0 * y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -7.2e-18: tmp = x * (2.0 * (y + z)) elif x <= 2.6e-90: tmp = y * 5.0 else: tmp = x * (t + (2.0 * y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -7.2e-18) tmp = Float64(x * Float64(2.0 * Float64(y + z))); elseif (x <= 2.6e-90) tmp = Float64(y * 5.0); else tmp = Float64(x * Float64(t + Float64(2.0 * y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -7.2e-18) tmp = x * (2.0 * (y + z)); elseif (x <= 2.6e-90) tmp = y * 5.0; else tmp = x * (t + (2.0 * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -7.2e-18], N[(x * N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.6e-90], N[(y * 5.0), $MachinePrecision], N[(x * N[(t + N[(2.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.2 \cdot 10^{-18}:\\
\;\;\;\;x \cdot \left(2 \cdot \left(y + z\right)\right)\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{-90}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + 2 \cdot y\right)\\
\end{array}
\end{array}
if x < -7.20000000000000021e-18Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 98.6%
Taylor expanded in t around 0 77.9%
+-commutative77.9%
Simplified77.9%
if -7.20000000000000021e-18 < x < 2.6e-90Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in y around inf 62.4%
Taylor expanded in x around 0 62.4%
if 2.6e-90 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 95.0%
Taylor expanded in z around 0 68.7%
Final simplification68.5%
(FPCore (x y z t) :precision binary64 (+ (* y 5.0) (* x (+ t (+ y (+ z (+ y z)))))))
double code(double x, double y, double z, double t) {
return (y * 5.0) + (x * (t + (y + (z + (y + z)))));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (y * 5.0d0) + (x * (t + (y + (z + (y + z)))))
end function
public static double code(double x, double y, double z, double t) {
return (y * 5.0) + (x * (t + (y + (z + (y + z)))));
}
def code(x, y, z, t): return (y * 5.0) + (x * (t + (y + (z + (y + z)))))
function code(x, y, z, t) return Float64(Float64(y * 5.0) + Float64(x * Float64(t + Float64(y + Float64(z + Float64(y + z)))))) end
function tmp = code(x, y, z, t) tmp = (y * 5.0) + (x * (t + (y + (z + (y + z))))); end
code[x_, y_, z_, t_] := N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(t + N[(y + N[(z + N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot 5 + x \cdot \left(t + \left(y + \left(z + \left(y + z\right)\right)\right)\right)
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -7e-17) (not (<= x 2.6e-90))) (* x t) (* y 5.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -7e-17) || !(x <= 2.6e-90)) {
tmp = x * t;
} else {
tmp = y * 5.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-7d-17)) .or. (.not. (x <= 2.6d-90))) then
tmp = x * t
else
tmp = y * 5.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -7e-17) || !(x <= 2.6e-90)) {
tmp = x * t;
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -7e-17) or not (x <= 2.6e-90): tmp = x * t else: tmp = y * 5.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -7e-17) || !(x <= 2.6e-90)) tmp = Float64(x * t); else tmp = Float64(y * 5.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -7e-17) || ~((x <= 2.6e-90))) tmp = x * t; else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -7e-17], N[Not[LessEqual[x, 2.6e-90]], $MachinePrecision]], N[(x * t), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7 \cdot 10^{-17} \lor \neg \left(x \leq 2.6 \cdot 10^{-90}\right):\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -7.0000000000000003e-17 or 2.6e-90 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 96.7%
Taylor expanded in z around 0 68.4%
Taylor expanded in t around inf 35.1%
*-commutative35.1%
Simplified35.1%
if -7.0000000000000003e-17 < x < 2.6e-90Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in y around inf 61.9%
Taylor expanded in x around 0 61.9%
Final simplification46.8%
(FPCore (x y z t) :precision binary64 (* x t))
double code(double x, double y, double z, double t) {
return x * t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x * t
end function
public static double code(double x, double y, double z, double t) {
return x * t;
}
def code(x, y, z, t): return x * t
function code(x, y, z, t) return Float64(x * t) end
function tmp = code(x, y, z, t) tmp = x * t; end
code[x_, y_, z_, t_] := N[(x * t), $MachinePrecision]
\begin{array}{l}
\\
x \cdot t
\end{array}
Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 71.9%
Taylor expanded in z around 0 46.7%
Taylor expanded in t around inf 28.0%
*-commutative28.0%
Simplified28.0%
herbie shell --seed 2024180
(FPCore (x y z t)
:name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, B"
:precision binary64
(+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))