
(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 13 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 (fma y 5.0 (* x (+ (* (+ y z) 2.0) t))))
double code(double x, double y, double z, double t) {
return fma(y, 5.0, (x * (((y + z) * 2.0) + t)));
}
function code(x, y, z, t) return fma(y, 5.0, Float64(x * Float64(Float64(Float64(y + z) * 2.0) + t))) end
code[x_, y_, z_, t_] := N[(y * 5.0 + N[(x * N[(N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, 5, x \cdot \left(\left(y + z\right) \cdot 2 + t\right)\right)
\end{array}
Initial program 99.9%
+-commutative99.9%
fma-def100.0%
associate-+l+100.0%
*-un-lft-identity100.0%
+-commutative100.0%
*-un-lft-identity100.0%
distribute-rgt-out100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Final simplification100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* z 2.0)))) (t_2 (* x (+ t (* y 2.0)))))
(if (<= x -5.4e+30)
t_2
(if (<= x -4.2e+15)
t_1
(if (<= x -1.8e-7)
t_2
(if (or (<= x -5.5e-25) (and (not (<= x -1.6e-150)) (<= x 6.8e-8)))
(* y 5.0)
t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + (z * 2.0));
double t_2 = x * (t + (y * 2.0));
double tmp;
if (x <= -5.4e+30) {
tmp = t_2;
} else if (x <= -4.2e+15) {
tmp = t_1;
} else if (x <= -1.8e-7) {
tmp = t_2;
} else if ((x <= -5.5e-25) || (!(x <= -1.6e-150) && (x <= 6.8e-8))) {
tmp = y * 5.0;
} 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) :: t_2
real(8) :: tmp
t_1 = x * (t + (z * 2.0d0))
t_2 = x * (t + (y * 2.0d0))
if (x <= (-5.4d+30)) then
tmp = t_2
else if (x <= (-4.2d+15)) then
tmp = t_1
else if (x <= (-1.8d-7)) then
tmp = t_2
else if ((x <= (-5.5d-25)) .or. (.not. (x <= (-1.6d-150))) .and. (x <= 6.8d-8)) then
tmp = y * 5.0d0
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 * (t + (z * 2.0));
double t_2 = x * (t + (y * 2.0));
double tmp;
if (x <= -5.4e+30) {
tmp = t_2;
} else if (x <= -4.2e+15) {
tmp = t_1;
} else if (x <= -1.8e-7) {
tmp = t_2;
} else if ((x <= -5.5e-25) || (!(x <= -1.6e-150) && (x <= 6.8e-8))) {
tmp = y * 5.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + (z * 2.0)) t_2 = x * (t + (y * 2.0)) tmp = 0 if x <= -5.4e+30: tmp = t_2 elif x <= -4.2e+15: tmp = t_1 elif x <= -1.8e-7: tmp = t_2 elif (x <= -5.5e-25) or (not (x <= -1.6e-150) and (x <= 6.8e-8)): tmp = y * 5.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(z * 2.0))) t_2 = Float64(x * Float64(t + Float64(y * 2.0))) tmp = 0.0 if (x <= -5.4e+30) tmp = t_2; elseif (x <= -4.2e+15) tmp = t_1; elseif (x <= -1.8e-7) tmp = t_2; elseif ((x <= -5.5e-25) || (!(x <= -1.6e-150) && (x <= 6.8e-8))) tmp = Float64(y * 5.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + (z * 2.0)); t_2 = x * (t + (y * 2.0)); tmp = 0.0; if (x <= -5.4e+30) tmp = t_2; elseif (x <= -4.2e+15) tmp = t_1; elseif (x <= -1.8e-7) tmp = t_2; elseif ((x <= -5.5e-25) || (~((x <= -1.6e-150)) && (x <= 6.8e-8))) tmp = y * 5.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.4e+30], t$95$2, If[LessEqual[x, -4.2e+15], t$95$1, If[LessEqual[x, -1.8e-7], t$95$2, If[Or[LessEqual[x, -5.5e-25], And[N[Not[LessEqual[x, -1.6e-150]], $MachinePrecision], LessEqual[x, 6.8e-8]]], N[(y * 5.0), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + z \cdot 2\right)\\
t_2 := x \cdot \left(t + y \cdot 2\right)\\
\mathbf{if}\;x \leq -5.4 \cdot 10^{+30}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -4.2 \cdot 10^{+15}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.8 \cdot 10^{-7}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -5.5 \cdot 10^{-25} \lor \neg \left(x \leq -1.6 \cdot 10^{-150}\right) \land x \leq 6.8 \cdot 10^{-8}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -5.3999999999999997e30 or -4.2e15 < x < -1.79999999999999997e-7Initial program 100.0%
Taylor expanded in y around inf 81.6%
Taylor expanded in y around 0 78.2%
Taylor expanded in x around inf 78.2%
*-commutative78.2%
Simplified78.2%
if -5.3999999999999997e30 < x < -4.2e15 or -5.50000000000000004e-25 < x < -1.5999999999999999e-150 or 6.8e-8 < x Initial program 100.0%
Taylor expanded in y around 0 74.3%
if -1.79999999999999997e-7 < x < -5.50000000000000004e-25 or -1.5999999999999999e-150 < x < 6.8e-8Initial program 99.8%
Taylor expanded in x around 0 70.4%
Final simplification73.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (* y 5.0) (* x t))))
(if (<= t -2.9e+232)
t_1
(if (<= t -3.05e+159)
(* x (+ t (* z 2.0)))
(if (or (<= t -4.1e+76) (not (<= t 4.3e+73)))
t_1
(+ (* 2.0 (* x (+ y z))) (* y 5.0)))))))
double code(double x, double y, double z, double t) {
double t_1 = (y * 5.0) + (x * t);
double tmp;
if (t <= -2.9e+232) {
tmp = t_1;
} else if (t <= -3.05e+159) {
tmp = x * (t + (z * 2.0));
} else if ((t <= -4.1e+76) || !(t <= 4.3e+73)) {
tmp = t_1;
} else {
tmp = (2.0 * (x * (y + z))) + (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) :: t_1
real(8) :: tmp
t_1 = (y * 5.0d0) + (x * t)
if (t <= (-2.9d+232)) then
tmp = t_1
else if (t <= (-3.05d+159)) then
tmp = x * (t + (z * 2.0d0))
else if ((t <= (-4.1d+76)) .or. (.not. (t <= 4.3d+73))) then
tmp = t_1
else
tmp = (2.0d0 * (x * (y + z))) + (y * 5.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y * 5.0) + (x * t);
double tmp;
if (t <= -2.9e+232) {
tmp = t_1;
} else if (t <= -3.05e+159) {
tmp = x * (t + (z * 2.0));
} else if ((t <= -4.1e+76) || !(t <= 4.3e+73)) {
tmp = t_1;
} else {
tmp = (2.0 * (x * (y + z))) + (y * 5.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y * 5.0) + (x * t) tmp = 0 if t <= -2.9e+232: tmp = t_1 elif t <= -3.05e+159: tmp = x * (t + (z * 2.0)) elif (t <= -4.1e+76) or not (t <= 4.3e+73): tmp = t_1 else: tmp = (2.0 * (x * (y + z))) + (y * 5.0) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y * 5.0) + Float64(x * t)) tmp = 0.0 if (t <= -2.9e+232) tmp = t_1; elseif (t <= -3.05e+159) tmp = Float64(x * Float64(t + Float64(z * 2.0))); elseif ((t <= -4.1e+76) || !(t <= 4.3e+73)) tmp = t_1; else tmp = Float64(Float64(2.0 * Float64(x * Float64(y + z))) + Float64(y * 5.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y * 5.0) + (x * t); tmp = 0.0; if (t <= -2.9e+232) tmp = t_1; elseif (t <= -3.05e+159) tmp = x * (t + (z * 2.0)); elseif ((t <= -4.1e+76) || ~((t <= 4.3e+73))) tmp = t_1; else tmp = (2.0 * (x * (y + z))) + (y * 5.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.9e+232], t$95$1, If[LessEqual[t, -3.05e+159], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -4.1e+76], N[Not[LessEqual[t, 4.3e+73]], $MachinePrecision]], t$95$1, N[(N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot 5 + x \cdot t\\
\mathbf{if}\;t \leq -2.9 \cdot 10^{+232}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -3.05 \cdot 10^{+159}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{elif}\;t \leq -4.1 \cdot 10^{+76} \lor \neg \left(t \leq 4.3 \cdot 10^{+73}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right) + y \cdot 5\\
\end{array}
\end{array}
if t < -2.90000000000000023e232 or -3.05e159 < t < -4.0999999999999998e76 or 4.30000000000000013e73 < t Initial program 99.9%
distribute-rgt-in95.0%
fma-def98.7%
associate-+l+98.7%
*-un-lft-identity98.7%
+-commutative98.7%
*-un-lft-identity98.7%
distribute-rgt-out98.7%
metadata-eval98.7%
*-commutative98.7%
Applied egg-rr98.7%
Taylor expanded in t around inf 85.8%
*-commutative85.8%
Simplified85.8%
if -2.90000000000000023e232 < t < -3.05e159Initial program 100.0%
Taylor expanded in y around 0 91.1%
if -4.0999999999999998e76 < t < 4.30000000000000013e73Initial program 99.9%
+-commutative99.9%
fma-def100.0%
associate-+l+100.0%
*-un-lft-identity100.0%
+-commutative100.0%
*-un-lft-identity100.0%
distribute-rgt-out100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in t around 0 93.4%
Final simplification90.8%
(FPCore (x y z t)
:precision binary64
(if (or (<= x -1.36e-9)
(and (not (<= x -6.5e-25))
(or (<= x -1.55e-150) (not (<= x 6.8e-8)))))
(* x (+ t (* z 2.0)))
(* y 5.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.36e-9) || (!(x <= -6.5e-25) && ((x <= -1.55e-150) || !(x <= 6.8e-8)))) {
tmp = x * (t + (z * 2.0));
} 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.36d-9)) .or. (.not. (x <= (-6.5d-25))) .and. (x <= (-1.55d-150)) .or. (.not. (x <= 6.8d-8))) then
tmp = x * (t + (z * 2.0d0))
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.36e-9) || (!(x <= -6.5e-25) && ((x <= -1.55e-150) || !(x <= 6.8e-8)))) {
tmp = x * (t + (z * 2.0));
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.36e-9) or (not (x <= -6.5e-25) and ((x <= -1.55e-150) or not (x <= 6.8e-8))): tmp = x * (t + (z * 2.0)) else: tmp = y * 5.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.36e-9) || (!(x <= -6.5e-25) && ((x <= -1.55e-150) || !(x <= 6.8e-8)))) tmp = Float64(x * Float64(t + Float64(z * 2.0))); else tmp = Float64(y * 5.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.36e-9) || (~((x <= -6.5e-25)) && ((x <= -1.55e-150) || ~((x <= 6.8e-8))))) tmp = x * (t + (z * 2.0)); else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.36e-9], And[N[Not[LessEqual[x, -6.5e-25]], $MachinePrecision], Or[LessEqual[x, -1.55e-150], N[Not[LessEqual[x, 6.8e-8]], $MachinePrecision]]]], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.36 \cdot 10^{-9} \lor \neg \left(x \leq -6.5 \cdot 10^{-25}\right) \land \left(x \leq -1.55 \cdot 10^{-150} \lor \neg \left(x \leq 6.8 \cdot 10^{-8}\right)\right):\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -1.36000000000000006e-9 or -6.5e-25 < x < -1.54999999999999999e-150 or 6.8e-8 < x Initial program 100.0%
Taylor expanded in y around 0 71.2%
if -1.36000000000000006e-9 < x < -6.5e-25 or -1.54999999999999999e-150 < x < 6.8e-8Initial program 99.8%
Taylor expanded in x around 0 70.4%
Final simplification70.9%
(FPCore (x y z t)
:precision binary64
(if (or (<= y -7.5e+15)
(not (or (<= y 2e-45) (and (not (<= y 2.8e-17)) (<= y 1.9e+124)))))
(* y (+ 5.0 (* x 2.0)))
(* x (+ t (* z 2.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -7.5e+15) || !((y <= 2e-45) || (!(y <= 2.8e-17) && (y <= 1.9e+124)))) {
tmp = y * (5.0 + (x * 2.0));
} else {
tmp = x * (t + (z * 2.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 ((y <= (-7.5d+15)) .or. (.not. (y <= 2d-45) .or. (.not. (y <= 2.8d-17)) .and. (y <= 1.9d+124))) then
tmp = y * (5.0d0 + (x * 2.0d0))
else
tmp = x * (t + (z * 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -7.5e+15) || !((y <= 2e-45) || (!(y <= 2.8e-17) && (y <= 1.9e+124)))) {
tmp = y * (5.0 + (x * 2.0));
} else {
tmp = x * (t + (z * 2.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -7.5e+15) or not ((y <= 2e-45) or (not (y <= 2.8e-17) and (y <= 1.9e+124))): tmp = y * (5.0 + (x * 2.0)) else: tmp = x * (t + (z * 2.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -7.5e+15) || !((y <= 2e-45) || (!(y <= 2.8e-17) && (y <= 1.9e+124)))) tmp = Float64(y * Float64(5.0 + Float64(x * 2.0))); else tmp = Float64(x * Float64(t + Float64(z * 2.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -7.5e+15) || ~(((y <= 2e-45) || (~((y <= 2.8e-17)) && (y <= 1.9e+124))))) tmp = y * (5.0 + (x * 2.0)); else tmp = x * (t + (z * 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -7.5e+15], N[Not[Or[LessEqual[y, 2e-45], And[N[Not[LessEqual[y, 2.8e-17]], $MachinePrecision], LessEqual[y, 1.9e+124]]]], $MachinePrecision]], N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5 \cdot 10^{+15} \lor \neg \left(y \leq 2 \cdot 10^{-45} \lor \neg \left(y \leq 2.8 \cdot 10^{-17}\right) \land y \leq 1.9 \cdot 10^{+124}\right):\\
\;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\end{array}
\end{array}
if y < -7.5e15 or 1.99999999999999997e-45 < y < 2.7999999999999999e-17 or 1.8999999999999999e124 < y Initial program 99.9%
Taylor expanded in y around inf 90.0%
Simplified90.0%
if -7.5e15 < y < 1.99999999999999997e-45 or 2.7999999999999999e-17 < y < 1.8999999999999999e124Initial program 99.9%
Taylor expanded in y around 0 77.5%
Final simplification82.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* z 2.0)))) (t_2 (* y (+ 5.0 (* x 2.0)))))
(if (<= y -3.3e+28)
t_2
(if (<= y 2.6e-55)
t_1
(if (<= y 1.45e-18)
(+ (* y 5.0) (* x t))
(if (<= y 1.9e+124) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + (z * 2.0));
double t_2 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -3.3e+28) {
tmp = t_2;
} else if (y <= 2.6e-55) {
tmp = t_1;
} else if (y <= 1.45e-18) {
tmp = (y * 5.0) + (x * t);
} else if (y <= 1.9e+124) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = x * (t + (z * 2.0d0))
t_2 = y * (5.0d0 + (x * 2.0d0))
if (y <= (-3.3d+28)) then
tmp = t_2
else if (y <= 2.6d-55) then
tmp = t_1
else if (y <= 1.45d-18) then
tmp = (y * 5.0d0) + (x * t)
else if (y <= 1.9d+124) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (t + (z * 2.0));
double t_2 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -3.3e+28) {
tmp = t_2;
} else if (y <= 2.6e-55) {
tmp = t_1;
} else if (y <= 1.45e-18) {
tmp = (y * 5.0) + (x * t);
} else if (y <= 1.9e+124) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + (z * 2.0)) t_2 = y * (5.0 + (x * 2.0)) tmp = 0 if y <= -3.3e+28: tmp = t_2 elif y <= 2.6e-55: tmp = t_1 elif y <= 1.45e-18: tmp = (y * 5.0) + (x * t) elif y <= 1.9e+124: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(z * 2.0))) t_2 = Float64(y * Float64(5.0 + Float64(x * 2.0))) tmp = 0.0 if (y <= -3.3e+28) tmp = t_2; elseif (y <= 2.6e-55) tmp = t_1; elseif (y <= 1.45e-18) tmp = Float64(Float64(y * 5.0) + Float64(x * t)); elseif (y <= 1.9e+124) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + (z * 2.0)); t_2 = y * (5.0 + (x * 2.0)); tmp = 0.0; if (y <= -3.3e+28) tmp = t_2; elseif (y <= 2.6e-55) tmp = t_1; elseif (y <= 1.45e-18) tmp = (y * 5.0) + (x * t); elseif (y <= 1.9e+124) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.3e+28], t$95$2, If[LessEqual[y, 2.6e-55], t$95$1, If[LessEqual[y, 1.45e-18], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e+124], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + z \cdot 2\right)\\
t_2 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -3.3 \cdot 10^{+28}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{-55}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{-18}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{+124}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -3.3e28 or 1.8999999999999999e124 < y Initial program 99.9%
Taylor expanded in y around inf 89.9%
Simplified89.9%
if -3.3e28 < y < 2.5999999999999999e-55 or 1.45e-18 < y < 1.8999999999999999e124Initial program 99.9%
Taylor expanded in y around 0 77.9%
if 2.5999999999999999e-55 < y < 1.45e-18Initial program 99.8%
distribute-rgt-in99.8%
fma-def99.8%
associate-+l+99.8%
*-un-lft-identity99.8%
+-commutative99.8%
*-un-lft-identity99.8%
distribute-rgt-out99.8%
metadata-eval99.8%
*-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in t around inf 98.4%
*-commutative98.4%
Simplified98.4%
Final simplification82.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* z 2.0)))))
(if (<= y -5.2e+19)
(+ (* y 5.0) (* 2.0 (* y x)))
(if (<= y 6.8e-55)
t_1
(if (<= y 1.15e-16)
(+ (* y 5.0) (* x t))
(if (<= y 1.9e+124) t_1 (* y (+ 5.0 (* x 2.0)))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + (z * 2.0));
double tmp;
if (y <= -5.2e+19) {
tmp = (y * 5.0) + (2.0 * (y * x));
} else if (y <= 6.8e-55) {
tmp = t_1;
} else if (y <= 1.15e-16) {
tmp = (y * 5.0) + (x * t);
} else if (y <= 1.9e+124) {
tmp = t_1;
} else {
tmp = y * (5.0 + (x * 2.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) :: t_1
real(8) :: tmp
t_1 = x * (t + (z * 2.0d0))
if (y <= (-5.2d+19)) then
tmp = (y * 5.0d0) + (2.0d0 * (y * x))
else if (y <= 6.8d-55) then
tmp = t_1
else if (y <= 1.15d-16) then
tmp = (y * 5.0d0) + (x * t)
else if (y <= 1.9d+124) then
tmp = t_1
else
tmp = y * (5.0d0 + (x * 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (t + (z * 2.0));
double tmp;
if (y <= -5.2e+19) {
tmp = (y * 5.0) + (2.0 * (y * x));
} else if (y <= 6.8e-55) {
tmp = t_1;
} else if (y <= 1.15e-16) {
tmp = (y * 5.0) + (x * t);
} else if (y <= 1.9e+124) {
tmp = t_1;
} else {
tmp = y * (5.0 + (x * 2.0));
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + (z * 2.0)) tmp = 0 if y <= -5.2e+19: tmp = (y * 5.0) + (2.0 * (y * x)) elif y <= 6.8e-55: tmp = t_1 elif y <= 1.15e-16: tmp = (y * 5.0) + (x * t) elif y <= 1.9e+124: tmp = t_1 else: tmp = y * (5.0 + (x * 2.0)) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(z * 2.0))) tmp = 0.0 if (y <= -5.2e+19) tmp = Float64(Float64(y * 5.0) + Float64(2.0 * Float64(y * x))); elseif (y <= 6.8e-55) tmp = t_1; elseif (y <= 1.15e-16) tmp = Float64(Float64(y * 5.0) + Float64(x * t)); elseif (y <= 1.9e+124) tmp = t_1; else tmp = Float64(y * Float64(5.0 + Float64(x * 2.0))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + (z * 2.0)); tmp = 0.0; if (y <= -5.2e+19) tmp = (y * 5.0) + (2.0 * (y * x)); elseif (y <= 6.8e-55) tmp = t_1; elseif (y <= 1.15e-16) tmp = (y * 5.0) + (x * t); elseif (y <= 1.9e+124) tmp = t_1; else tmp = y * (5.0 + (x * 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.2e+19], N[(N[(y * 5.0), $MachinePrecision] + N[(2.0 * N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.8e-55], t$95$1, If[LessEqual[y, 1.15e-16], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e+124], t$95$1, N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + z \cdot 2\right)\\
\mathbf{if}\;y \leq -5.2 \cdot 10^{+19}:\\
\;\;\;\;y \cdot 5 + 2 \cdot \left(y \cdot x\right)\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{-55}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{-16}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{+124}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\
\end{array}
\end{array}
if y < -5.2e19Initial program 99.9%
Taylor expanded in y around inf 85.0%
if -5.2e19 < y < 6.79999999999999946e-55 or 1.15e-16 < y < 1.8999999999999999e124Initial program 99.9%
Taylor expanded in y around 0 77.9%
if 6.79999999999999946e-55 < y < 1.15e-16Initial program 99.8%
distribute-rgt-in99.8%
fma-def99.8%
associate-+l+99.8%
*-un-lft-identity99.8%
+-commutative99.8%
*-un-lft-identity99.8%
distribute-rgt-out99.8%
metadata-eval99.8%
*-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in t around inf 98.4%
*-commutative98.4%
Simplified98.4%
if 1.8999999999999999e124 < y Initial program 99.9%
Taylor expanded in y around inf 99.9%
Simplified99.9%
Final simplification82.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -3.9e+96) (not (<= z 6.8e+25))) (+ (* 2.0 (* x (+ y z))) (* y 5.0)) (+ (* x t) (* y (+ 5.0 (* x 2.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.9e+96) || !(z <= 6.8e+25)) {
tmp = (2.0 * (x * (y + z))) + (y * 5.0);
} else {
tmp = (x * t) + (y * (5.0 + (x * 2.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 ((z <= (-3.9d+96)) .or. (.not. (z <= 6.8d+25))) then
tmp = (2.0d0 * (x * (y + z))) + (y * 5.0d0)
else
tmp = (x * t) + (y * (5.0d0 + (x * 2.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.9e+96) || !(z <= 6.8e+25)) {
tmp = (2.0 * (x * (y + z))) + (y * 5.0);
} else {
tmp = (x * t) + (y * (5.0 + (x * 2.0)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -3.9e+96) or not (z <= 6.8e+25): tmp = (2.0 * (x * (y + z))) + (y * 5.0) else: tmp = (x * t) + (y * (5.0 + (x * 2.0))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -3.9e+96) || !(z <= 6.8e+25)) tmp = Float64(Float64(2.0 * Float64(x * Float64(y + z))) + Float64(y * 5.0)); else tmp = Float64(Float64(x * t) + Float64(y * Float64(5.0 + Float64(x * 2.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -3.9e+96) || ~((z <= 6.8e+25))) tmp = (2.0 * (x * (y + z))) + (y * 5.0); else tmp = (x * t) + (y * (5.0 + (x * 2.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.9e+96], N[Not[LessEqual[z, 6.8e+25]], $MachinePrecision]], N[(N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * t), $MachinePrecision] + N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.9 \cdot 10^{+96} \lor \neg \left(z \leq 6.8 \cdot 10^{+25}\right):\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right) + y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot t + y \cdot \left(5 + x \cdot 2\right)\\
\end{array}
\end{array}
if z < -3.9e96 or 6.79999999999999967e25 < z Initial program 100.0%
+-commutative100.0%
fma-def100.0%
associate-+l+100.0%
*-un-lft-identity100.0%
+-commutative100.0%
*-un-lft-identity100.0%
distribute-rgt-out100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in t around 0 90.5%
if -3.9e96 < z < 6.79999999999999967e25Initial program 99.9%
Taylor expanded in y around inf 93.7%
Taylor expanded in y around 0 91.4%
Final simplification91.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.4e+97) (not (<= z 5.6e+25))) (+ (* 2.0 (* x (+ y z))) (* y 5.0)) (+ (* y 5.0) (* x (+ t (+ y y))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.4e+97) || !(z <= 5.6e+25)) {
tmp = (2.0 * (x * (y + z))) + (y * 5.0);
} else {
tmp = (y * 5.0) + (x * (t + (y + 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 ((z <= (-1.4d+97)) .or. (.not. (z <= 5.6d+25))) then
tmp = (2.0d0 * (x * (y + z))) + (y * 5.0d0)
else
tmp = (y * 5.0d0) + (x * (t + (y + y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.4e+97) || !(z <= 5.6e+25)) {
tmp = (2.0 * (x * (y + z))) + (y * 5.0);
} else {
tmp = (y * 5.0) + (x * (t + (y + y)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.4e+97) or not (z <= 5.6e+25): tmp = (2.0 * (x * (y + z))) + (y * 5.0) else: tmp = (y * 5.0) + (x * (t + (y + y))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.4e+97) || !(z <= 5.6e+25)) tmp = Float64(Float64(2.0 * Float64(x * Float64(y + z))) + Float64(y * 5.0)); else tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(t + Float64(y + y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.4e+97) || ~((z <= 5.6e+25))) tmp = (2.0 * (x * (y + z))) + (y * 5.0); else tmp = (y * 5.0) + (x * (t + (y + y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.4e+97], N[Not[LessEqual[z, 5.6e+25]], $MachinePrecision]], N[(N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(t + N[(y + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{+97} \lor \neg \left(z \leq 5.6 \cdot 10^{+25}\right):\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right) + y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot \left(t + \left(y + y\right)\right)\\
\end{array}
\end{array}
if z < -1.4e97 or 5.6000000000000003e25 < z Initial program 100.0%
+-commutative100.0%
fma-def100.0%
associate-+l+100.0%
*-un-lft-identity100.0%
+-commutative100.0%
*-un-lft-identity100.0%
distribute-rgt-out100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in t around 0 90.5%
if -1.4e97 < z < 5.6000000000000003e25Initial program 99.9%
Taylor expanded in y around inf 93.7%
Final simplification92.6%
(FPCore (x y z t) :precision binary64 (+ (* x (+ (* (+ y z) 2.0) t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * (((y + z) * 2.0) + 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) * 2.0d0) + t)) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * (((y + z) * 2.0) + t)) + (y * 5.0);
}
def code(x, y, z, t): return (x * (((y + z) * 2.0) + t)) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(Float64(Float64(y + z) * 2.0) + t)) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * (((y + z) * 2.0) + t)) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\left(y + z\right) \cdot 2 + t\right) + y \cdot 5
\end{array}
Initial program 99.9%
associate-+l+99.9%
*-un-lft-identity99.9%
+-commutative99.9%
*-un-lft-identity99.9%
distribute-rgt-out99.9%
metadata-eval99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(if (<= t -2.75e+48)
(* x t)
(if (<= t 5.8e-277)
(* y 5.0)
(if (<= t 1.04e-141)
(* 2.0 (* x z))
(if (<= t 1.8e-9) (* y 5.0) (* x t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.75e+48) {
tmp = x * t;
} else if (t <= 5.8e-277) {
tmp = y * 5.0;
} else if (t <= 1.04e-141) {
tmp = 2.0 * (x * z);
} else if (t <= 1.8e-9) {
tmp = y * 5.0;
} else {
tmp = 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 (t <= (-2.75d+48)) then
tmp = x * t
else if (t <= 5.8d-277) then
tmp = y * 5.0d0
else if (t <= 1.04d-141) then
tmp = 2.0d0 * (x * z)
else if (t <= 1.8d-9) then
tmp = y * 5.0d0
else
tmp = x * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.75e+48) {
tmp = x * t;
} else if (t <= 5.8e-277) {
tmp = y * 5.0;
} else if (t <= 1.04e-141) {
tmp = 2.0 * (x * z);
} else if (t <= 1.8e-9) {
tmp = y * 5.0;
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2.75e+48: tmp = x * t elif t <= 5.8e-277: tmp = y * 5.0 elif t <= 1.04e-141: tmp = 2.0 * (x * z) elif t <= 1.8e-9: tmp = y * 5.0 else: tmp = x * t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -2.75e+48) tmp = Float64(x * t); elseif (t <= 5.8e-277) tmp = Float64(y * 5.0); elseif (t <= 1.04e-141) tmp = Float64(2.0 * Float64(x * z)); elseif (t <= 1.8e-9) tmp = Float64(y * 5.0); else tmp = Float64(x * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -2.75e+48) tmp = x * t; elseif (t <= 5.8e-277) tmp = y * 5.0; elseif (t <= 1.04e-141) tmp = 2.0 * (x * z); elseif (t <= 1.8e-9) tmp = y * 5.0; else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.75e+48], N[(x * t), $MachinePrecision], If[LessEqual[t, 5.8e-277], N[(y * 5.0), $MachinePrecision], If[LessEqual[t, 1.04e-141], N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.8e-9], N[(y * 5.0), $MachinePrecision], N[(x * t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.75 \cdot 10^{+48}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;t \leq 5.8 \cdot 10^{-277}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;t \leq 1.04 \cdot 10^{-141}:\\
\;\;\;\;2 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;t \leq 1.8 \cdot 10^{-9}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if t < -2.7500000000000001e48 or 1.8e-9 < t Initial program 99.9%
Taylor expanded in t around inf 58.1%
if -2.7500000000000001e48 < t < 5.79999999999999955e-277 or 1.04e-141 < t < 1.8e-9Initial program 99.8%
Taylor expanded in x around 0 52.3%
if 5.79999999999999955e-277 < t < 1.04e-141Initial program 100.0%
Taylor expanded in z around inf 57.3%
Final simplification55.7%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.55e+51) (not (<= t 1.25e-8))) (* x t) (* y 5.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.55e+51) || !(t <= 1.25e-8)) {
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 ((t <= (-2.55d+51)) .or. (.not. (t <= 1.25d-8))) 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 ((t <= -2.55e+51) || !(t <= 1.25e-8)) {
tmp = x * t;
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2.55e+51) or not (t <= 1.25e-8): tmp = x * t else: tmp = y * 5.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2.55e+51) || !(t <= 1.25e-8)) 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 ((t <= -2.55e+51) || ~((t <= 1.25e-8))) tmp = x * t; else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.55e+51], N[Not[LessEqual[t, 1.25e-8]], $MachinePrecision]], N[(x * t), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.55 \cdot 10^{+51} \lor \neg \left(t \leq 1.25 \cdot 10^{-8}\right):\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if t < -2.55000000000000005e51 or 1.2499999999999999e-8 < t Initial program 99.9%
Taylor expanded in t around inf 58.1%
if -2.55000000000000005e51 < t < 1.2499999999999999e-8Initial program 99.9%
Taylor expanded in x around 0 44.7%
Final simplification51.0%
(FPCore (x y z t) :precision binary64 (* y 5.0))
double code(double x, double y, double z, double t) {
return 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 = y * 5.0d0
end function
public static double code(double x, double y, double z, double t) {
return y * 5.0;
}
def code(x, y, z, t): return y * 5.0
function code(x, y, z, t) return Float64(y * 5.0) end
function tmp = code(x, y, z, t) tmp = y * 5.0; end
code[x_, y_, z_, t_] := N[(y * 5.0), $MachinePrecision]
\begin{array}{l}
\\
y \cdot 5
\end{array}
Initial program 99.9%
Taylor expanded in x around 0 32.6%
Final simplification32.6%
herbie shell --seed 2023320
(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)))