
(FPCore (x y z t a) :precision binary64 (/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))
double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
real(8) function code(x, y, z, t, a)
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
code = ((x * y) - ((z * 9.0d0) * t)) / (a * 2.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
def code(x, y, z, t, a): return ((x * y) - ((z * 9.0) * t)) / (a * 2.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) / Float64(a * 2.0)) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) - ((z * 9.0) * t)) / (a * 2.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))
double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
real(8) function code(x, y, z, t, a)
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
code = ((x * y) - ((z * 9.0d0) * t)) / (a * 2.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
def code(x, y, z, t, a): return ((x * y) - ((z * 9.0) * t)) / (a * 2.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) / Float64(a * 2.0)) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) - ((z * 9.0) * t)) / (a * 2.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}
\end{array}
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (* z 9.0) t))) (if (<= t_1 1e+308) (/ (- (* x y) t_1) (* a 2.0)) (* z (/ (* t -4.5) a)))))
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double t_1 = (z * 9.0) * t;
double tmp;
if (t_1 <= 1e+308) {
tmp = ((x * y) - t_1) / (a * 2.0);
} else {
tmp = z * ((t * -4.5) / a);
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
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) :: t_1
real(8) :: tmp
t_1 = (z * 9.0d0) * t
if (t_1 <= 1d+308) then
tmp = ((x * y) - t_1) / (a * 2.0d0)
else
tmp = z * ((t * (-4.5d0)) / a)
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z * 9.0) * t;
double tmp;
if (t_1 <= 1e+308) {
tmp = ((x * y) - t_1) / (a * 2.0);
} else {
tmp = z * ((t * -4.5) / a);
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): t_1 = (z * 9.0) * t tmp = 0 if t_1 <= 1e+308: tmp = ((x * y) - t_1) / (a * 2.0) else: tmp = z * ((t * -4.5) / a) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a) t_1 = Float64(Float64(z * 9.0) * t) tmp = 0.0 if (t_1 <= 1e+308) tmp = Float64(Float64(Float64(x * y) - t_1) / Float64(a * 2.0)); else tmp = Float64(z * Float64(Float64(t * -4.5) / a)); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = (z * 9.0) * t;
tmp = 0.0;
if (t_1 <= 1e+308)
tmp = ((x * y) - t_1) / (a * 2.0);
else
tmp = z * ((t * -4.5) / a);
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+308], N[(N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(t * -4.5), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := \left(z \cdot 9\right) \cdot t\\
\mathbf{if}\;t_1 \leq 10^{+308}:\\
\;\;\;\;\frac{x \cdot y - t_1}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{t \cdot -4.5}{a}\\
\end{array}
\end{array}
if (*.f64 (*.f64 z 9) t) < 1e308Initial program 96.6%
if 1e308 < (*.f64 (*.f64 z 9) t) Initial program 54.4%
*-commutative54.4%
*-commutative54.4%
associate-*l*54.4%
Simplified54.4%
Taylor expanded in x around 0 54.4%
associate-*r/54.4%
associate-*r*54.4%
Simplified54.4%
associate-*l*54.4%
*-un-lft-identity54.4%
times-frac54.4%
metadata-eval54.4%
associate-*l/99.7%
associate-*r*99.8%
Applied egg-rr99.8%
expm1-log1p-u47.9%
expm1-udef34.0%
associate-*r/34.0%
*-commutative34.0%
associate-/l*34.0%
Applied egg-rr34.0%
expm1-def48.0%
expm1-log1p99.8%
associate-/l*99.8%
*-commutative99.8%
Simplified99.8%
Final simplification96.8%
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* x y) (* a 2.0))))
(if (<= (* x y) -400000000.0)
t_1
(if (<= (* x y) -1e-33)
(* z (* -4.5 (/ t a)))
(if (<= (* x y) -4e-84)
t_1
(if (<= (* x y) 1e+26)
(/ (* -9.0 (* z t)) (* a 2.0))
(* x (* y (/ 0.5 a)))))))))assert(z < t);
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) / (a * 2.0);
double tmp;
if ((x * y) <= -400000000.0) {
tmp = t_1;
} else if ((x * y) <= -1e-33) {
tmp = z * (-4.5 * (t / a));
} else if ((x * y) <= -4e-84) {
tmp = t_1;
} else if ((x * y) <= 1e+26) {
tmp = (-9.0 * (z * t)) / (a * 2.0);
} else {
tmp = x * (y * (0.5 / a));
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
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) :: t_1
real(8) :: tmp
t_1 = (x * y) / (a * 2.0d0)
if ((x * y) <= (-400000000.0d0)) then
tmp = t_1
else if ((x * y) <= (-1d-33)) then
tmp = z * ((-4.5d0) * (t / a))
else if ((x * y) <= (-4d-84)) then
tmp = t_1
else if ((x * y) <= 1d+26) then
tmp = ((-9.0d0) * (z * t)) / (a * 2.0d0)
else
tmp = x * (y * (0.5d0 / a))
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) / (a * 2.0);
double tmp;
if ((x * y) <= -400000000.0) {
tmp = t_1;
} else if ((x * y) <= -1e-33) {
tmp = z * (-4.5 * (t / a));
} else if ((x * y) <= -4e-84) {
tmp = t_1;
} else if ((x * y) <= 1e+26) {
tmp = (-9.0 * (z * t)) / (a * 2.0);
} else {
tmp = x * (y * (0.5 / a));
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): t_1 = (x * y) / (a * 2.0) tmp = 0 if (x * y) <= -400000000.0: tmp = t_1 elif (x * y) <= -1e-33: tmp = z * (-4.5 * (t / a)) elif (x * y) <= -4e-84: tmp = t_1 elif (x * y) <= 1e+26: tmp = (-9.0 * (z * t)) / (a * 2.0) else: tmp = x * (y * (0.5 / a)) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) / Float64(a * 2.0)) tmp = 0.0 if (Float64(x * y) <= -400000000.0) tmp = t_1; elseif (Float64(x * y) <= -1e-33) tmp = Float64(z * Float64(-4.5 * Float64(t / a))); elseif (Float64(x * y) <= -4e-84) tmp = t_1; elseif (Float64(x * y) <= 1e+26) tmp = Float64(Float64(-9.0 * Float64(z * t)) / Float64(a * 2.0)); else tmp = Float64(x * Float64(y * Float64(0.5 / a))); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = (x * y) / (a * 2.0);
tmp = 0.0;
if ((x * y) <= -400000000.0)
tmp = t_1;
elseif ((x * y) <= -1e-33)
tmp = z * (-4.5 * (t / a));
elseif ((x * y) <= -4e-84)
tmp = t_1;
elseif ((x * y) <= 1e+26)
tmp = (-9.0 * (z * t)) / (a * 2.0);
else
tmp = x * (y * (0.5 / a));
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -400000000.0], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1e-33], N[(z * N[(-4.5 * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -4e-84], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1e+26], N[(N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * N[(0.5 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x \cdot y}{a \cdot 2}\\
\mathbf{if}\;x \cdot y \leq -400000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-33}:\\
\;\;\;\;z \cdot \left(-4.5 \cdot \frac{t}{a}\right)\\
\mathbf{elif}\;x \cdot y \leq -4 \cdot 10^{-84}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 10^{+26}:\\
\;\;\;\;\frac{-9 \cdot \left(z \cdot t\right)}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{0.5}{a}\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -4e8 or -1.0000000000000001e-33 < (*.f64 x y) < -4.0000000000000001e-84Initial program 93.2%
*-commutative93.2%
*-commutative93.2%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in x around inf 73.8%
if -4e8 < (*.f64 x y) < -1.0000000000000001e-33Initial program 87.1%
*-commutative87.1%
*-commutative87.1%
associate-*l*87.1%
Simplified87.1%
Taylor expanded in x around 0 73.7%
associate-*r/74.2%
associate-*r*74.2%
Simplified74.2%
associate-*l*74.2%
*-un-lft-identity74.2%
times-frac73.7%
metadata-eval73.7%
associate-*l/86.6%
associate-*r*87.0%
Applied egg-rr87.0%
if -4.0000000000000001e-84 < (*.f64 x y) < 1.00000000000000005e26Initial program 98.1%
*-commutative98.1%
*-commutative98.1%
associate-*l*98.1%
Simplified98.1%
Taylor expanded in x around 0 84.1%
if 1.00000000000000005e26 < (*.f64 x y) Initial program 88.1%
*-commutative88.1%
*-commutative88.1%
associate-*l*88.1%
Simplified88.1%
Taylor expanded in x around inf 71.2%
associate-*r/71.2%
associate-*l/71.2%
*-commutative71.2%
associate-*l*77.9%
Simplified77.9%
Final simplification79.9%
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* x y) (* a 2.0))))
(if (<= (* x y) -400000000.0)
t_1
(if (<= (* x y) -1e-33)
(* z (* -4.5 (/ t a)))
(if (<= (* x y) -4e-84)
t_1
(if (<= (* x y) 1e+26)
(/ (* t (* z -9.0)) (* a 2.0))
(* x (* y (/ 0.5 a)))))))))assert(z < t);
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) / (a * 2.0);
double tmp;
if ((x * y) <= -400000000.0) {
tmp = t_1;
} else if ((x * y) <= -1e-33) {
tmp = z * (-4.5 * (t / a));
} else if ((x * y) <= -4e-84) {
tmp = t_1;
} else if ((x * y) <= 1e+26) {
tmp = (t * (z * -9.0)) / (a * 2.0);
} else {
tmp = x * (y * (0.5 / a));
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
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) :: t_1
real(8) :: tmp
t_1 = (x * y) / (a * 2.0d0)
if ((x * y) <= (-400000000.0d0)) then
tmp = t_1
else if ((x * y) <= (-1d-33)) then
tmp = z * ((-4.5d0) * (t / a))
else if ((x * y) <= (-4d-84)) then
tmp = t_1
else if ((x * y) <= 1d+26) then
tmp = (t * (z * (-9.0d0))) / (a * 2.0d0)
else
tmp = x * (y * (0.5d0 / a))
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) / (a * 2.0);
double tmp;
if ((x * y) <= -400000000.0) {
tmp = t_1;
} else if ((x * y) <= -1e-33) {
tmp = z * (-4.5 * (t / a));
} else if ((x * y) <= -4e-84) {
tmp = t_1;
} else if ((x * y) <= 1e+26) {
tmp = (t * (z * -9.0)) / (a * 2.0);
} else {
tmp = x * (y * (0.5 / a));
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): t_1 = (x * y) / (a * 2.0) tmp = 0 if (x * y) <= -400000000.0: tmp = t_1 elif (x * y) <= -1e-33: tmp = z * (-4.5 * (t / a)) elif (x * y) <= -4e-84: tmp = t_1 elif (x * y) <= 1e+26: tmp = (t * (z * -9.0)) / (a * 2.0) else: tmp = x * (y * (0.5 / a)) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) / Float64(a * 2.0)) tmp = 0.0 if (Float64(x * y) <= -400000000.0) tmp = t_1; elseif (Float64(x * y) <= -1e-33) tmp = Float64(z * Float64(-4.5 * Float64(t / a))); elseif (Float64(x * y) <= -4e-84) tmp = t_1; elseif (Float64(x * y) <= 1e+26) tmp = Float64(Float64(t * Float64(z * -9.0)) / Float64(a * 2.0)); else tmp = Float64(x * Float64(y * Float64(0.5 / a))); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = (x * y) / (a * 2.0);
tmp = 0.0;
if ((x * y) <= -400000000.0)
tmp = t_1;
elseif ((x * y) <= -1e-33)
tmp = z * (-4.5 * (t / a));
elseif ((x * y) <= -4e-84)
tmp = t_1;
elseif ((x * y) <= 1e+26)
tmp = (t * (z * -9.0)) / (a * 2.0);
else
tmp = x * (y * (0.5 / a));
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -400000000.0], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1e-33], N[(z * N[(-4.5 * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -4e-84], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1e+26], N[(N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * N[(0.5 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x \cdot y}{a \cdot 2}\\
\mathbf{if}\;x \cdot y \leq -400000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-33}:\\
\;\;\;\;z \cdot \left(-4.5 \cdot \frac{t}{a}\right)\\
\mathbf{elif}\;x \cdot y \leq -4 \cdot 10^{-84}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 10^{+26}:\\
\;\;\;\;\frac{t \cdot \left(z \cdot -9\right)}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{0.5}{a}\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -4e8 or -1.0000000000000001e-33 < (*.f64 x y) < -4.0000000000000001e-84Initial program 93.2%
*-commutative93.2%
*-commutative93.2%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in x around inf 73.8%
if -4e8 < (*.f64 x y) < -1.0000000000000001e-33Initial program 87.1%
*-commutative87.1%
*-commutative87.1%
associate-*l*87.1%
Simplified87.1%
Taylor expanded in x around 0 73.7%
associate-*r/74.2%
associate-*r*74.2%
Simplified74.2%
associate-*l*74.2%
*-un-lft-identity74.2%
times-frac73.7%
metadata-eval73.7%
associate-*l/86.6%
associate-*r*87.0%
Applied egg-rr87.0%
if -4.0000000000000001e-84 < (*.f64 x y) < 1.00000000000000005e26Initial program 98.1%
*-commutative98.1%
*-commutative98.1%
associate-*l*98.1%
Simplified98.1%
Taylor expanded in x around 0 84.1%
*-commutative84.1%
associate-*r*84.1%
Simplified84.1%
if 1.00000000000000005e26 < (*.f64 x y) Initial program 88.1%
*-commutative88.1%
*-commutative88.1%
associate-*l*88.1%
Simplified88.1%
Taylor expanded in x around inf 71.2%
associate-*r/71.2%
associate-*l/71.2%
*-commutative71.2%
associate-*l*77.9%
Simplified77.9%
Final simplification80.0%
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* x y) (* a 2.0))))
(if (<= (* x y) -400000000.0)
t_1
(if (<= (* x y) -1e-33)
(* z (* -4.5 (/ t a)))
(if (<= (* x y) -4e-84)
t_1
(if (<= (* x y) 1e+26)
(/ -4.5 (/ a (* z t)))
(* x (* y (/ 0.5 a)))))))))assert(z < t);
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) / (a * 2.0);
double tmp;
if ((x * y) <= -400000000.0) {
tmp = t_1;
} else if ((x * y) <= -1e-33) {
tmp = z * (-4.5 * (t / a));
} else if ((x * y) <= -4e-84) {
tmp = t_1;
} else if ((x * y) <= 1e+26) {
tmp = -4.5 / (a / (z * t));
} else {
tmp = x * (y * (0.5 / a));
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
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) :: t_1
real(8) :: tmp
t_1 = (x * y) / (a * 2.0d0)
if ((x * y) <= (-400000000.0d0)) then
tmp = t_1
else if ((x * y) <= (-1d-33)) then
tmp = z * ((-4.5d0) * (t / a))
else if ((x * y) <= (-4d-84)) then
tmp = t_1
else if ((x * y) <= 1d+26) then
tmp = (-4.5d0) / (a / (z * t))
else
tmp = x * (y * (0.5d0 / a))
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) / (a * 2.0);
double tmp;
if ((x * y) <= -400000000.0) {
tmp = t_1;
} else if ((x * y) <= -1e-33) {
tmp = z * (-4.5 * (t / a));
} else if ((x * y) <= -4e-84) {
tmp = t_1;
} else if ((x * y) <= 1e+26) {
tmp = -4.5 / (a / (z * t));
} else {
tmp = x * (y * (0.5 / a));
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): t_1 = (x * y) / (a * 2.0) tmp = 0 if (x * y) <= -400000000.0: tmp = t_1 elif (x * y) <= -1e-33: tmp = z * (-4.5 * (t / a)) elif (x * y) <= -4e-84: tmp = t_1 elif (x * y) <= 1e+26: tmp = -4.5 / (a / (z * t)) else: tmp = x * (y * (0.5 / a)) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) / Float64(a * 2.0)) tmp = 0.0 if (Float64(x * y) <= -400000000.0) tmp = t_1; elseif (Float64(x * y) <= -1e-33) tmp = Float64(z * Float64(-4.5 * Float64(t / a))); elseif (Float64(x * y) <= -4e-84) tmp = t_1; elseif (Float64(x * y) <= 1e+26) tmp = Float64(-4.5 / Float64(a / Float64(z * t))); else tmp = Float64(x * Float64(y * Float64(0.5 / a))); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = (x * y) / (a * 2.0);
tmp = 0.0;
if ((x * y) <= -400000000.0)
tmp = t_1;
elseif ((x * y) <= -1e-33)
tmp = z * (-4.5 * (t / a));
elseif ((x * y) <= -4e-84)
tmp = t_1;
elseif ((x * y) <= 1e+26)
tmp = -4.5 / (a / (z * t));
else
tmp = x * (y * (0.5 / a));
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -400000000.0], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1e-33], N[(z * N[(-4.5 * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -4e-84], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1e+26], N[(-4.5 / N[(a / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * N[(0.5 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x \cdot y}{a \cdot 2}\\
\mathbf{if}\;x \cdot y \leq -400000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-33}:\\
\;\;\;\;z \cdot \left(-4.5 \cdot \frac{t}{a}\right)\\
\mathbf{elif}\;x \cdot y \leq -4 \cdot 10^{-84}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 10^{+26}:\\
\;\;\;\;\frac{-4.5}{\frac{a}{z \cdot t}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{0.5}{a}\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -4e8 or -1.0000000000000001e-33 < (*.f64 x y) < -4.0000000000000001e-84Initial program 93.2%
*-commutative93.2%
*-commutative93.2%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in x around inf 73.8%
if -4e8 < (*.f64 x y) < -1.0000000000000001e-33Initial program 87.1%
*-commutative87.1%
*-commutative87.1%
associate-*l*87.1%
Simplified87.1%
Taylor expanded in x around 0 73.7%
associate-*r/74.2%
associate-*r*74.2%
Simplified74.2%
associate-*l*74.2%
*-un-lft-identity74.2%
times-frac73.7%
metadata-eval73.7%
associate-*l/86.6%
associate-*r*87.0%
Applied egg-rr87.0%
if -4.0000000000000001e-84 < (*.f64 x y) < 1.00000000000000005e26Initial program 98.1%
*-commutative98.1%
*-commutative98.1%
associate-*l*98.1%
Simplified98.1%
Taylor expanded in x around 0 84.0%
associate-*r/84.1%
associate-*r*84.1%
Simplified84.1%
associate-*l*84.1%
*-un-lft-identity84.1%
times-frac84.0%
metadata-eval84.0%
associate-*l/74.6%
associate-*r*74.6%
Applied egg-rr74.6%
associate-*l*74.6%
associate-/r/77.9%
clear-num77.8%
un-div-inv77.9%
associate-/l/84.1%
Applied egg-rr84.1%
if 1.00000000000000005e26 < (*.f64 x y) Initial program 88.1%
*-commutative88.1%
*-commutative88.1%
associate-*l*88.1%
Simplified88.1%
Taylor expanded in x around inf 71.2%
associate-*r/71.2%
associate-*l/71.2%
*-commutative71.2%
associate-*l*77.9%
Simplified77.9%
Final simplification79.9%
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* x y) (* a 2.0))))
(if (<= (* x y) -400000000.0)
t_1
(if (<= (* x y) -1e-33)
(* z (* -4.5 (/ t a)))
(if (<= (* x y) -4e-84)
t_1
(if (<= (* x y) 1e+26)
(/ (* z (* t -4.5)) a)
(* x (* y (/ 0.5 a)))))))))assert(z < t);
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) / (a * 2.0);
double tmp;
if ((x * y) <= -400000000.0) {
tmp = t_1;
} else if ((x * y) <= -1e-33) {
tmp = z * (-4.5 * (t / a));
} else if ((x * y) <= -4e-84) {
tmp = t_1;
} else if ((x * y) <= 1e+26) {
tmp = (z * (t * -4.5)) / a;
} else {
tmp = x * (y * (0.5 / a));
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
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) :: t_1
real(8) :: tmp
t_1 = (x * y) / (a * 2.0d0)
if ((x * y) <= (-400000000.0d0)) then
tmp = t_1
else if ((x * y) <= (-1d-33)) then
tmp = z * ((-4.5d0) * (t / a))
else if ((x * y) <= (-4d-84)) then
tmp = t_1
else if ((x * y) <= 1d+26) then
tmp = (z * (t * (-4.5d0))) / a
else
tmp = x * (y * (0.5d0 / a))
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) / (a * 2.0);
double tmp;
if ((x * y) <= -400000000.0) {
tmp = t_1;
} else if ((x * y) <= -1e-33) {
tmp = z * (-4.5 * (t / a));
} else if ((x * y) <= -4e-84) {
tmp = t_1;
} else if ((x * y) <= 1e+26) {
tmp = (z * (t * -4.5)) / a;
} else {
tmp = x * (y * (0.5 / a));
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): t_1 = (x * y) / (a * 2.0) tmp = 0 if (x * y) <= -400000000.0: tmp = t_1 elif (x * y) <= -1e-33: tmp = z * (-4.5 * (t / a)) elif (x * y) <= -4e-84: tmp = t_1 elif (x * y) <= 1e+26: tmp = (z * (t * -4.5)) / a else: tmp = x * (y * (0.5 / a)) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) / Float64(a * 2.0)) tmp = 0.0 if (Float64(x * y) <= -400000000.0) tmp = t_1; elseif (Float64(x * y) <= -1e-33) tmp = Float64(z * Float64(-4.5 * Float64(t / a))); elseif (Float64(x * y) <= -4e-84) tmp = t_1; elseif (Float64(x * y) <= 1e+26) tmp = Float64(Float64(z * Float64(t * -4.5)) / a); else tmp = Float64(x * Float64(y * Float64(0.5 / a))); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = (x * y) / (a * 2.0);
tmp = 0.0;
if ((x * y) <= -400000000.0)
tmp = t_1;
elseif ((x * y) <= -1e-33)
tmp = z * (-4.5 * (t / a));
elseif ((x * y) <= -4e-84)
tmp = t_1;
elseif ((x * y) <= 1e+26)
tmp = (z * (t * -4.5)) / a;
else
tmp = x * (y * (0.5 / a));
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -400000000.0], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1e-33], N[(z * N[(-4.5 * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -4e-84], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1e+26], N[(N[(z * N[(t * -4.5), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(x * N[(y * N[(0.5 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x \cdot y}{a \cdot 2}\\
\mathbf{if}\;x \cdot y \leq -400000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-33}:\\
\;\;\;\;z \cdot \left(-4.5 \cdot \frac{t}{a}\right)\\
\mathbf{elif}\;x \cdot y \leq -4 \cdot 10^{-84}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 10^{+26}:\\
\;\;\;\;\frac{z \cdot \left(t \cdot -4.5\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{0.5}{a}\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -4e8 or -1.0000000000000001e-33 < (*.f64 x y) < -4.0000000000000001e-84Initial program 93.2%
*-commutative93.2%
*-commutative93.2%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in x around inf 73.8%
if -4e8 < (*.f64 x y) < -1.0000000000000001e-33Initial program 87.1%
*-commutative87.1%
*-commutative87.1%
associate-*l*87.1%
Simplified87.1%
Taylor expanded in x around 0 73.7%
associate-*r/74.2%
associate-*r*74.2%
Simplified74.2%
associate-*l*74.2%
*-un-lft-identity74.2%
times-frac73.7%
metadata-eval73.7%
associate-*l/86.6%
associate-*r*87.0%
Applied egg-rr87.0%
if -4.0000000000000001e-84 < (*.f64 x y) < 1.00000000000000005e26Initial program 98.1%
*-commutative98.1%
*-commutative98.1%
associate-*l*98.1%
Simplified98.1%
Taylor expanded in x around 0 84.0%
associate-*r/84.1%
associate-*r*84.1%
Simplified84.1%
if 1.00000000000000005e26 < (*.f64 x y) Initial program 88.1%
*-commutative88.1%
*-commutative88.1%
associate-*l*88.1%
Simplified88.1%
Taylor expanded in x around inf 71.2%
associate-*r/71.2%
associate-*l/71.2%
*-commutative71.2%
associate-*l*77.9%
Simplified77.9%
Final simplification79.9%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* x y) 5e+303) (/ (- (* x y) (* z (* 9.0 t))) (* a 2.0)) (* x (/ (* y 0.5) a))))
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= 5e+303) {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
} else {
tmp = x * ((y * 0.5) / a);
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
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) :: tmp
if ((x * y) <= 5d+303) then
tmp = ((x * y) - (z * (9.0d0 * t))) / (a * 2.0d0)
else
tmp = x * ((y * 0.5d0) / a)
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= 5e+303) {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
} else {
tmp = x * ((y * 0.5) / a);
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if (x * y) <= 5e+303: tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0) else: tmp = x * ((y * 0.5) / a) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= 5e+303) tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(9.0 * t))) / Float64(a * 2.0)); else tmp = Float64(x * Float64(Float64(y * 0.5) / a)); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x * y) <= 5e+303)
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
else
tmp = x * ((y * 0.5) / a);
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], 5e+303], N[(N[(N[(x * y), $MachinePrecision] - N[(z * N[(9.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y * 0.5), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq 5 \cdot 10^{+303}:\\
\;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y \cdot 0.5}{a}\\
\end{array}
\end{array}
if (*.f64 x y) < 4.9999999999999997e303Initial program 95.9%
*-commutative95.9%
*-commutative95.9%
associate-*l*95.8%
Simplified95.8%
if 4.9999999999999997e303 < (*.f64 x y) Initial program 69.0%
*-commutative69.0%
*-commutative69.0%
associate-*l*69.0%
Simplified69.0%
Taylor expanded in x around inf 69.0%
associate-*r/69.0%
associate-*l/69.0%
*-commutative69.0%
associate-*l*99.8%
Simplified99.8%
associate-*r/99.9%
Applied egg-rr99.9%
Final simplification96.1%
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* 0.5 (/ x (/ a y)))) (t_2 (* -4.5 (* z (/ t a)))))
(if (<= t -2.3e-131)
t_2
(if (<= t 8.4e-170)
t_1
(if (<= t 5.7e-149)
(* -4.5 (/ (* z t) a))
(if (<= t 1.06e+120) t_1 t_2))))))assert(z < t);
double code(double x, double y, double z, double t, double a) {
double t_1 = 0.5 * (x / (a / y));
double t_2 = -4.5 * (z * (t / a));
double tmp;
if (t <= -2.3e-131) {
tmp = t_2;
} else if (t <= 8.4e-170) {
tmp = t_1;
} else if (t <= 5.7e-149) {
tmp = -4.5 * ((z * t) / a);
} else if (t <= 1.06e+120) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 0.5d0 * (x / (a / y))
t_2 = (-4.5d0) * (z * (t / a))
if (t <= (-2.3d-131)) then
tmp = t_2
else if (t <= 8.4d-170) then
tmp = t_1
else if (t <= 5.7d-149) then
tmp = (-4.5d0) * ((z * t) / a)
else if (t <= 1.06d+120) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = 0.5 * (x / (a / y));
double t_2 = -4.5 * (z * (t / a));
double tmp;
if (t <= -2.3e-131) {
tmp = t_2;
} else if (t <= 8.4e-170) {
tmp = t_1;
} else if (t <= 5.7e-149) {
tmp = -4.5 * ((z * t) / a);
} else if (t <= 1.06e+120) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): t_1 = 0.5 * (x / (a / y)) t_2 = -4.5 * (z * (t / a)) tmp = 0 if t <= -2.3e-131: tmp = t_2 elif t <= 8.4e-170: tmp = t_1 elif t <= 5.7e-149: tmp = -4.5 * ((z * t) / a) elif t <= 1.06e+120: tmp = t_1 else: tmp = t_2 return tmp
z, t = sort([z, t]) function code(x, y, z, t, a) t_1 = Float64(0.5 * Float64(x / Float64(a / y))) t_2 = Float64(-4.5 * Float64(z * Float64(t / a))) tmp = 0.0 if (t <= -2.3e-131) tmp = t_2; elseif (t <= 8.4e-170) tmp = t_1; elseif (t <= 5.7e-149) tmp = Float64(-4.5 * Float64(Float64(z * t) / a)); elseif (t <= 1.06e+120) tmp = t_1; else tmp = t_2; end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = 0.5 * (x / (a / y));
t_2 = -4.5 * (z * (t / a));
tmp = 0.0;
if (t <= -2.3e-131)
tmp = t_2;
elseif (t <= 8.4e-170)
tmp = t_1;
elseif (t <= 5.7e-149)
tmp = -4.5 * ((z * t) / a);
elseif (t <= 1.06e+120)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(0.5 * N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.3e-131], t$95$2, If[LessEqual[t, 8.4e-170], t$95$1, If[LessEqual[t, 5.7e-149], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.06e+120], t$95$1, t$95$2]]]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := 0.5 \cdot \frac{x}{\frac{a}{y}}\\
t_2 := -4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\
\mathbf{if}\;t \leq -2.3 \cdot 10^{-131}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 8.4 \cdot 10^{-170}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 5.7 \cdot 10^{-149}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\mathbf{elif}\;t \leq 1.06 \cdot 10^{+120}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -2.30000000000000022e-131 or 1.05999999999999994e120 < t Initial program 92.4%
*-commutative92.4%
*-commutative92.4%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in x around 0 70.3%
associate-/l*69.4%
associate-/r/71.7%
Simplified71.7%
if -2.30000000000000022e-131 < t < 8.4000000000000002e-170 or 5.6999999999999999e-149 < t < 1.05999999999999994e120Initial program 96.0%
*-commutative96.0%
*-commutative96.0%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in x around inf 65.4%
associate-/l*62.6%
Simplified62.6%
if 8.4000000000000002e-170 < t < 5.6999999999999999e-149Initial program 99.1%
*-commutative99.1%
*-commutative99.1%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in x around 0 71.2%
Final simplification67.3%
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* x (* y (/ 0.5 a)))) (t_2 (* -4.5 (* z (/ t a)))))
(if (<= t -3.4e-131)
t_2
(if (<= t 9e-170)
t_1
(if (<= t 5.2e-149)
(* -4.5 (/ (* z t) a))
(if (<= t 8.6e+119) t_1 t_2))))))assert(z < t);
double code(double x, double y, double z, double t, double a) {
double t_1 = x * (y * (0.5 / a));
double t_2 = -4.5 * (z * (t / a));
double tmp;
if (t <= -3.4e-131) {
tmp = t_2;
} else if (t <= 9e-170) {
tmp = t_1;
} else if (t <= 5.2e-149) {
tmp = -4.5 * ((z * t) / a);
} else if (t <= 8.6e+119) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * (y * (0.5d0 / a))
t_2 = (-4.5d0) * (z * (t / a))
if (t <= (-3.4d-131)) then
tmp = t_2
else if (t <= 9d-170) then
tmp = t_1
else if (t <= 5.2d-149) then
tmp = (-4.5d0) * ((z * t) / a)
else if (t <= 8.6d+119) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x * (y * (0.5 / a));
double t_2 = -4.5 * (z * (t / a));
double tmp;
if (t <= -3.4e-131) {
tmp = t_2;
} else if (t <= 9e-170) {
tmp = t_1;
} else if (t <= 5.2e-149) {
tmp = -4.5 * ((z * t) / a);
} else if (t <= 8.6e+119) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): t_1 = x * (y * (0.5 / a)) t_2 = -4.5 * (z * (t / a)) tmp = 0 if t <= -3.4e-131: tmp = t_2 elif t <= 9e-170: tmp = t_1 elif t <= 5.2e-149: tmp = -4.5 * ((z * t) / a) elif t <= 8.6e+119: tmp = t_1 else: tmp = t_2 return tmp
z, t = sort([z, t]) function code(x, y, z, t, a) t_1 = Float64(x * Float64(y * Float64(0.5 / a))) t_2 = Float64(-4.5 * Float64(z * Float64(t / a))) tmp = 0.0 if (t <= -3.4e-131) tmp = t_2; elseif (t <= 9e-170) tmp = t_1; elseif (t <= 5.2e-149) tmp = Float64(-4.5 * Float64(Float64(z * t) / a)); elseif (t <= 8.6e+119) tmp = t_1; else tmp = t_2; end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = x * (y * (0.5 / a));
t_2 = -4.5 * (z * (t / a));
tmp = 0.0;
if (t <= -3.4e-131)
tmp = t_2;
elseif (t <= 9e-170)
tmp = t_1;
elseif (t <= 5.2e-149)
tmp = -4.5 * ((z * t) / a);
elseif (t <= 8.6e+119)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(y * N[(0.5 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.4e-131], t$95$2, If[LessEqual[t, 9e-170], t$95$1, If[LessEqual[t, 5.2e-149], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.6e+119], t$95$1, t$95$2]]]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot \frac{0.5}{a}\right)\\
t_2 := -4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\
\mathbf{if}\;t \leq -3.4 \cdot 10^{-131}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 9 \cdot 10^{-170}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 5.2 \cdot 10^{-149}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\mathbf{elif}\;t \leq 8.6 \cdot 10^{+119}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -3.39999999999999995e-131 or 8.60000000000000063e119 < t Initial program 92.4%
*-commutative92.4%
*-commutative92.4%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in x around 0 70.3%
associate-/l*69.4%
associate-/r/71.7%
Simplified71.7%
if -3.39999999999999995e-131 < t < 9.00000000000000003e-170 or 5.19999999999999998e-149 < t < 8.60000000000000063e119Initial program 96.0%
*-commutative96.0%
*-commutative96.0%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in x around inf 65.4%
associate-*r/65.4%
associate-*l/65.3%
*-commutative65.3%
associate-*l*62.8%
Simplified62.8%
if 9.00000000000000003e-170 < t < 5.19999999999999998e-149Initial program 99.1%
*-commutative99.1%
*-commutative99.1%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in x around 0 71.2%
Final simplification67.4%
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* -4.5 (* z (/ t a)))))
(if (<= t -3.4e-131)
t_1
(if (<= t 7.6e-170)
(* x (* y (/ 0.5 a)))
(if (<= t 5.7e-149)
(* -4.5 (/ (* z t) a))
(if (<= t 9.2e+119) (* x (/ (* y 0.5) a)) t_1))))))assert(z < t);
double code(double x, double y, double z, double t, double a) {
double t_1 = -4.5 * (z * (t / a));
double tmp;
if (t <= -3.4e-131) {
tmp = t_1;
} else if (t <= 7.6e-170) {
tmp = x * (y * (0.5 / a));
} else if (t <= 5.7e-149) {
tmp = -4.5 * ((z * t) / a);
} else if (t <= 9.2e+119) {
tmp = x * ((y * 0.5) / a);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
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) :: t_1
real(8) :: tmp
t_1 = (-4.5d0) * (z * (t / a))
if (t <= (-3.4d-131)) then
tmp = t_1
else if (t <= 7.6d-170) then
tmp = x * (y * (0.5d0 / a))
else if (t <= 5.7d-149) then
tmp = (-4.5d0) * ((z * t) / a)
else if (t <= 9.2d+119) then
tmp = x * ((y * 0.5d0) / a)
else
tmp = t_1
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = -4.5 * (z * (t / a));
double tmp;
if (t <= -3.4e-131) {
tmp = t_1;
} else if (t <= 7.6e-170) {
tmp = x * (y * (0.5 / a));
} else if (t <= 5.7e-149) {
tmp = -4.5 * ((z * t) / a);
} else if (t <= 9.2e+119) {
tmp = x * ((y * 0.5) / a);
} else {
tmp = t_1;
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): t_1 = -4.5 * (z * (t / a)) tmp = 0 if t <= -3.4e-131: tmp = t_1 elif t <= 7.6e-170: tmp = x * (y * (0.5 / a)) elif t <= 5.7e-149: tmp = -4.5 * ((z * t) / a) elif t <= 9.2e+119: tmp = x * ((y * 0.5) / a) else: tmp = t_1 return tmp
z, t = sort([z, t]) function code(x, y, z, t, a) t_1 = Float64(-4.5 * Float64(z * Float64(t / a))) tmp = 0.0 if (t <= -3.4e-131) tmp = t_1; elseif (t <= 7.6e-170) tmp = Float64(x * Float64(y * Float64(0.5 / a))); elseif (t <= 5.7e-149) tmp = Float64(-4.5 * Float64(Float64(z * t) / a)); elseif (t <= 9.2e+119) tmp = Float64(x * Float64(Float64(y * 0.5) / a)); else tmp = t_1; end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = -4.5 * (z * (t / a));
tmp = 0.0;
if (t <= -3.4e-131)
tmp = t_1;
elseif (t <= 7.6e-170)
tmp = x * (y * (0.5 / a));
elseif (t <= 5.7e-149)
tmp = -4.5 * ((z * t) / a);
elseif (t <= 9.2e+119)
tmp = x * ((y * 0.5) / a);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.4e-131], t$95$1, If[LessEqual[t, 7.6e-170], N[(x * N[(y * N[(0.5 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.7e-149], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.2e+119], N[(x * N[(N[(y * 0.5), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := -4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\
\mathbf{if}\;t \leq -3.4 \cdot 10^{-131}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 7.6 \cdot 10^{-170}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{0.5}{a}\right)\\
\mathbf{elif}\;t \leq 5.7 \cdot 10^{-149}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\mathbf{elif}\;t \leq 9.2 \cdot 10^{+119}:\\
\;\;\;\;x \cdot \frac{y \cdot 0.5}{a}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -3.39999999999999995e-131 or 9.2000000000000003e119 < t Initial program 92.4%
*-commutative92.4%
*-commutative92.4%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in x around 0 70.3%
associate-/l*69.4%
associate-/r/71.7%
Simplified71.7%
if -3.39999999999999995e-131 < t < 7.5999999999999995e-170Initial program 96.8%
*-commutative96.8%
*-commutative96.8%
associate-*l*96.8%
Simplified96.8%
Taylor expanded in x around inf 71.4%
associate-*r/71.4%
associate-*l/71.4%
*-commutative71.4%
associate-*l*66.5%
Simplified66.5%
if 7.5999999999999995e-170 < t < 5.6999999999999999e-149Initial program 99.1%
*-commutative99.1%
*-commutative99.1%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in x around 0 71.2%
if 5.6999999999999999e-149 < t < 9.2000000000000003e119Initial program 95.0%
*-commutative95.0%
*-commutative95.0%
associate-*l*95.0%
Simplified95.0%
Taylor expanded in x around inf 58.7%
associate-*r/58.7%
associate-*l/58.7%
*-commutative58.7%
associate-*l*58.7%
Simplified58.7%
associate-*r/58.8%
Applied egg-rr58.8%
Final simplification67.4%
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* z (* -4.5 (/ t a)))))
(if (<= t -3.4e-131)
t_1
(if (<= t 9e-170)
(* x (* y (/ 0.5 a)))
(if (<= t 1.95e-148)
(* -4.5 (/ (* z t) a))
(if (<= t 1e+123) (* x (/ (* y 0.5) a)) t_1))))))assert(z < t);
double code(double x, double y, double z, double t, double a) {
double t_1 = z * (-4.5 * (t / a));
double tmp;
if (t <= -3.4e-131) {
tmp = t_1;
} else if (t <= 9e-170) {
tmp = x * (y * (0.5 / a));
} else if (t <= 1.95e-148) {
tmp = -4.5 * ((z * t) / a);
} else if (t <= 1e+123) {
tmp = x * ((y * 0.5) / a);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
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) :: t_1
real(8) :: tmp
t_1 = z * ((-4.5d0) * (t / a))
if (t <= (-3.4d-131)) then
tmp = t_1
else if (t <= 9d-170) then
tmp = x * (y * (0.5d0 / a))
else if (t <= 1.95d-148) then
tmp = (-4.5d0) * ((z * t) / a)
else if (t <= 1d+123) then
tmp = x * ((y * 0.5d0) / a)
else
tmp = t_1
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = z * (-4.5 * (t / a));
double tmp;
if (t <= -3.4e-131) {
tmp = t_1;
} else if (t <= 9e-170) {
tmp = x * (y * (0.5 / a));
} else if (t <= 1.95e-148) {
tmp = -4.5 * ((z * t) / a);
} else if (t <= 1e+123) {
tmp = x * ((y * 0.5) / a);
} else {
tmp = t_1;
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): t_1 = z * (-4.5 * (t / a)) tmp = 0 if t <= -3.4e-131: tmp = t_1 elif t <= 9e-170: tmp = x * (y * (0.5 / a)) elif t <= 1.95e-148: tmp = -4.5 * ((z * t) / a) elif t <= 1e+123: tmp = x * ((y * 0.5) / a) else: tmp = t_1 return tmp
z, t = sort([z, t]) function code(x, y, z, t, a) t_1 = Float64(z * Float64(-4.5 * Float64(t / a))) tmp = 0.0 if (t <= -3.4e-131) tmp = t_1; elseif (t <= 9e-170) tmp = Float64(x * Float64(y * Float64(0.5 / a))); elseif (t <= 1.95e-148) tmp = Float64(-4.5 * Float64(Float64(z * t) / a)); elseif (t <= 1e+123) tmp = Float64(x * Float64(Float64(y * 0.5) / a)); else tmp = t_1; end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = z * (-4.5 * (t / a));
tmp = 0.0;
if (t <= -3.4e-131)
tmp = t_1;
elseif (t <= 9e-170)
tmp = x * (y * (0.5 / a));
elseif (t <= 1.95e-148)
tmp = -4.5 * ((z * t) / a);
elseif (t <= 1e+123)
tmp = x * ((y * 0.5) / a);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(-4.5 * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.4e-131], t$95$1, If[LessEqual[t, 9e-170], N[(x * N[(y * N[(0.5 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.95e-148], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1e+123], N[(x * N[(N[(y * 0.5), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := z \cdot \left(-4.5 \cdot \frac{t}{a}\right)\\
\mathbf{if}\;t \leq -3.4 \cdot 10^{-131}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 9 \cdot 10^{-170}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{0.5}{a}\right)\\
\mathbf{elif}\;t \leq 1.95 \cdot 10^{-148}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\mathbf{elif}\;t \leq 10^{+123}:\\
\;\;\;\;x \cdot \frac{y \cdot 0.5}{a}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -3.39999999999999995e-131 or 9.99999999999999978e122 < t Initial program 92.4%
*-commutative92.4%
*-commutative92.4%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in x around 0 70.3%
associate-*r/70.4%
associate-*r*70.3%
Simplified70.3%
associate-*l*70.4%
*-un-lft-identity70.4%
times-frac70.3%
metadata-eval70.3%
associate-*l/71.7%
associate-*r*71.8%
Applied egg-rr71.8%
if -3.39999999999999995e-131 < t < 9.00000000000000003e-170Initial program 96.8%
*-commutative96.8%
*-commutative96.8%
associate-*l*96.8%
Simplified96.8%
Taylor expanded in x around inf 71.4%
associate-*r/71.4%
associate-*l/71.4%
*-commutative71.4%
associate-*l*66.5%
Simplified66.5%
if 9.00000000000000003e-170 < t < 1.94999999999999997e-148Initial program 99.1%
*-commutative99.1%
*-commutative99.1%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in x around 0 71.2%
if 1.94999999999999997e-148 < t < 9.99999999999999978e122Initial program 95.0%
*-commutative95.0%
*-commutative95.0%
associate-*l*95.0%
Simplified95.0%
Taylor expanded in x around inf 58.7%
associate-*r/58.7%
associate-*l/58.7%
*-commutative58.7%
associate-*l*58.7%
Simplified58.7%
associate-*r/58.8%
Applied egg-rr58.8%
Final simplification67.4%
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= t -2e-132)
(* z (* -4.5 (/ t a)))
(if (<= t 6e-170)
(* x (* y (/ 0.5 a)))
(if (<= t 4.8e-146)
(* -4.5 (/ (* z t) a))
(if (<= t 8.6e+119) (* x (/ (* y 0.5) a)) (* z (/ (* t -4.5) a)))))))assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2e-132) {
tmp = z * (-4.5 * (t / a));
} else if (t <= 6e-170) {
tmp = x * (y * (0.5 / a));
} else if (t <= 4.8e-146) {
tmp = -4.5 * ((z * t) / a);
} else if (t <= 8.6e+119) {
tmp = x * ((y * 0.5) / a);
} else {
tmp = z * ((t * -4.5) / a);
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
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) :: tmp
if (t <= (-2d-132)) then
tmp = z * ((-4.5d0) * (t / a))
else if (t <= 6d-170) then
tmp = x * (y * (0.5d0 / a))
else if (t <= 4.8d-146) then
tmp = (-4.5d0) * ((z * t) / a)
else if (t <= 8.6d+119) then
tmp = x * ((y * 0.5d0) / a)
else
tmp = z * ((t * (-4.5d0)) / a)
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2e-132) {
tmp = z * (-4.5 * (t / a));
} else if (t <= 6e-170) {
tmp = x * (y * (0.5 / a));
} else if (t <= 4.8e-146) {
tmp = -4.5 * ((z * t) / a);
} else if (t <= 8.6e+119) {
tmp = x * ((y * 0.5) / a);
} else {
tmp = z * ((t * -4.5) / a);
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if t <= -2e-132: tmp = z * (-4.5 * (t / a)) elif t <= 6e-170: tmp = x * (y * (0.5 / a)) elif t <= 4.8e-146: tmp = -4.5 * ((z * t) / a) elif t <= 8.6e+119: tmp = x * ((y * 0.5) / a) else: tmp = z * ((t * -4.5) / a) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (t <= -2e-132) tmp = Float64(z * Float64(-4.5 * Float64(t / a))); elseif (t <= 6e-170) tmp = Float64(x * Float64(y * Float64(0.5 / a))); elseif (t <= 4.8e-146) tmp = Float64(-4.5 * Float64(Float64(z * t) / a)); elseif (t <= 8.6e+119) tmp = Float64(x * Float64(Float64(y * 0.5) / a)); else tmp = Float64(z * Float64(Float64(t * -4.5) / a)); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (t <= -2e-132)
tmp = z * (-4.5 * (t / a));
elseif (t <= 6e-170)
tmp = x * (y * (0.5 / a));
elseif (t <= 4.8e-146)
tmp = -4.5 * ((z * t) / a);
elseif (t <= 8.6e+119)
tmp = x * ((y * 0.5) / a);
else
tmp = z * ((t * -4.5) / a);
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2e-132], N[(z * N[(-4.5 * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6e-170], N[(x * N[(y * N[(0.5 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.8e-146], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.6e+119], N[(x * N[(N[(y * 0.5), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(t * -4.5), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{-132}:\\
\;\;\;\;z \cdot \left(-4.5 \cdot \frac{t}{a}\right)\\
\mathbf{elif}\;t \leq 6 \cdot 10^{-170}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{0.5}{a}\right)\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{-146}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\mathbf{elif}\;t \leq 8.6 \cdot 10^{+119}:\\
\;\;\;\;x \cdot \frac{y \cdot 0.5}{a}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{t \cdot -4.5}{a}\\
\end{array}
\end{array}
if t < -2e-132Initial program 92.8%
*-commutative92.8%
*-commutative92.8%
associate-*l*92.8%
Simplified92.8%
Taylor expanded in x around 0 67.6%
associate-*r/67.6%
associate-*r*67.6%
Simplified67.6%
associate-*l*67.6%
*-un-lft-identity67.6%
times-frac67.6%
metadata-eval67.6%
associate-*l/66.5%
associate-*r*66.6%
Applied egg-rr66.6%
if -2e-132 < t < 6.00000000000000027e-170Initial program 96.8%
*-commutative96.8%
*-commutative96.8%
associate-*l*96.8%
Simplified96.8%
Taylor expanded in x around inf 71.4%
associate-*r/71.4%
associate-*l/71.4%
*-commutative71.4%
associate-*l*66.5%
Simplified66.5%
if 6.00000000000000027e-170 < t < 4.8000000000000003e-146Initial program 99.1%
*-commutative99.1%
*-commutative99.1%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in x around 0 71.2%
if 4.8000000000000003e-146 < t < 8.60000000000000063e119Initial program 95.0%
*-commutative95.0%
*-commutative95.0%
associate-*l*95.0%
Simplified95.0%
Taylor expanded in x around inf 58.7%
associate-*r/58.7%
associate-*l/58.7%
*-commutative58.7%
associate-*l*58.7%
Simplified58.7%
associate-*r/58.8%
Applied egg-rr58.8%
if 8.60000000000000063e119 < t Initial program 90.9%
*-commutative90.9%
*-commutative90.9%
associate-*l*90.7%
Simplified90.7%
Taylor expanded in x around 0 78.5%
associate-*r/78.6%
associate-*r*78.5%
Simplified78.5%
associate-*l*78.6%
*-un-lft-identity78.6%
times-frac78.5%
metadata-eval78.5%
associate-*l/87.5%
associate-*r*87.5%
Applied egg-rr87.5%
expm1-log1p-u15.9%
expm1-udef12.8%
associate-*r/12.8%
*-commutative12.8%
associate-/l*12.8%
Applied egg-rr12.8%
expm1-def15.9%
expm1-log1p87.5%
associate-/l*87.6%
*-commutative87.6%
Simplified87.6%
Final simplification67.4%
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.5e-140)
(* z (* -4.5 (/ t a)))
(if (<= t 8.8e-170)
(* x (* y (/ 0.5 a)))
(if (<= t 5.1e-149)
(/ -4.5 (/ a (* z t)))
(if (<= t 1.25e+120) (* x (/ (* y 0.5) a)) (* z (/ (* t -4.5) a)))))))assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.5e-140) {
tmp = z * (-4.5 * (t / a));
} else if (t <= 8.8e-170) {
tmp = x * (y * (0.5 / a));
} else if (t <= 5.1e-149) {
tmp = -4.5 / (a / (z * t));
} else if (t <= 1.25e+120) {
tmp = x * ((y * 0.5) / a);
} else {
tmp = z * ((t * -4.5) / a);
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
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) :: tmp
if (t <= (-1.5d-140)) then
tmp = z * ((-4.5d0) * (t / a))
else if (t <= 8.8d-170) then
tmp = x * (y * (0.5d0 / a))
else if (t <= 5.1d-149) then
tmp = (-4.5d0) / (a / (z * t))
else if (t <= 1.25d+120) then
tmp = x * ((y * 0.5d0) / a)
else
tmp = z * ((t * (-4.5d0)) / a)
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.5e-140) {
tmp = z * (-4.5 * (t / a));
} else if (t <= 8.8e-170) {
tmp = x * (y * (0.5 / a));
} else if (t <= 5.1e-149) {
tmp = -4.5 / (a / (z * t));
} else if (t <= 1.25e+120) {
tmp = x * ((y * 0.5) / a);
} else {
tmp = z * ((t * -4.5) / a);
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if t <= -1.5e-140: tmp = z * (-4.5 * (t / a)) elif t <= 8.8e-170: tmp = x * (y * (0.5 / a)) elif t <= 5.1e-149: tmp = -4.5 / (a / (z * t)) elif t <= 1.25e+120: tmp = x * ((y * 0.5) / a) else: tmp = z * ((t * -4.5) / a) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.5e-140) tmp = Float64(z * Float64(-4.5 * Float64(t / a))); elseif (t <= 8.8e-170) tmp = Float64(x * Float64(y * Float64(0.5 / a))); elseif (t <= 5.1e-149) tmp = Float64(-4.5 / Float64(a / Float64(z * t))); elseif (t <= 1.25e+120) tmp = Float64(x * Float64(Float64(y * 0.5) / a)); else tmp = Float64(z * Float64(Float64(t * -4.5) / a)); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (t <= -1.5e-140)
tmp = z * (-4.5 * (t / a));
elseif (t <= 8.8e-170)
tmp = x * (y * (0.5 / a));
elseif (t <= 5.1e-149)
tmp = -4.5 / (a / (z * t));
elseif (t <= 1.25e+120)
tmp = x * ((y * 0.5) / a);
else
tmp = z * ((t * -4.5) / a);
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.5e-140], N[(z * N[(-4.5 * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.8e-170], N[(x * N[(y * N[(0.5 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.1e-149], N[(-4.5 / N[(a / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.25e+120], N[(x * N[(N[(y * 0.5), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(t * -4.5), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.5 \cdot 10^{-140}:\\
\;\;\;\;z \cdot \left(-4.5 \cdot \frac{t}{a}\right)\\
\mathbf{elif}\;t \leq 8.8 \cdot 10^{-170}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{0.5}{a}\right)\\
\mathbf{elif}\;t \leq 5.1 \cdot 10^{-149}:\\
\;\;\;\;\frac{-4.5}{\frac{a}{z \cdot t}}\\
\mathbf{elif}\;t \leq 1.25 \cdot 10^{+120}:\\
\;\;\;\;x \cdot \frac{y \cdot 0.5}{a}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{t \cdot -4.5}{a}\\
\end{array}
\end{array}
if t < -1.50000000000000009e-140Initial program 92.9%
*-commutative92.9%
*-commutative92.9%
associate-*l*92.9%
Simplified92.9%
Taylor expanded in x around 0 66.9%
associate-*r/67.0%
associate-*r*67.0%
Simplified67.0%
associate-*l*67.0%
*-un-lft-identity67.0%
times-frac66.9%
metadata-eval66.9%
associate-*l/65.9%
associate-*r*66.0%
Applied egg-rr66.0%
if -1.50000000000000009e-140 < t < 8.80000000000000059e-170Initial program 96.7%
*-commutative96.7%
*-commutative96.7%
associate-*l*96.7%
Simplified96.7%
Taylor expanded in x around inf 71.0%
associate-*r/71.0%
associate-*l/71.0%
*-commutative71.0%
associate-*l*66.7%
Simplified66.7%
if 8.80000000000000059e-170 < t < 5.09999999999999983e-149Initial program 99.1%
*-commutative99.1%
*-commutative99.1%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in x around 0 71.2%
associate-*r/71.0%
associate-*r*71.0%
Simplified71.0%
associate-*l*71.0%
*-un-lft-identity71.0%
times-frac71.2%
metadata-eval71.2%
associate-*l/51.9%
associate-*r*52.1%
Applied egg-rr52.1%
associate-*l*51.9%
associate-/r/57.9%
clear-num57.7%
un-div-inv57.9%
associate-/l/71.4%
Applied egg-rr71.4%
if 5.09999999999999983e-149 < t < 1.25000000000000005e120Initial program 95.0%
*-commutative95.0%
*-commutative95.0%
associate-*l*95.0%
Simplified95.0%
Taylor expanded in x around inf 58.7%
associate-*r/58.7%
associate-*l/58.7%
*-commutative58.7%
associate-*l*58.7%
Simplified58.7%
associate-*r/58.8%
Applied egg-rr58.8%
if 1.25000000000000005e120 < t Initial program 90.9%
*-commutative90.9%
*-commutative90.9%
associate-*l*90.7%
Simplified90.7%
Taylor expanded in x around 0 78.5%
associate-*r/78.6%
associate-*r*78.5%
Simplified78.5%
associate-*l*78.6%
*-un-lft-identity78.6%
times-frac78.5%
metadata-eval78.5%
associate-*l/87.5%
associate-*r*87.5%
Applied egg-rr87.5%
expm1-log1p-u15.9%
expm1-udef12.8%
associate-*r/12.8%
*-commutative12.8%
associate-/l*12.8%
Applied egg-rr12.8%
expm1-def15.9%
expm1-log1p87.5%
associate-/l*87.6%
*-commutative87.6%
Simplified87.6%
Final simplification67.2%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (or (<= y -7.2e-68) (not (<= y 1.4e+101))) (* 0.5 (* y (/ x a))) (* -4.5 (/ (* z t) a))))
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -7.2e-68) || !(y <= 1.4e+101)) {
tmp = 0.5 * (y * (x / a));
} else {
tmp = -4.5 * ((z * t) / a);
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
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) :: tmp
if ((y <= (-7.2d-68)) .or. (.not. (y <= 1.4d+101))) then
tmp = 0.5d0 * (y * (x / a))
else
tmp = (-4.5d0) * ((z * t) / a)
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -7.2e-68) || !(y <= 1.4e+101)) {
tmp = 0.5 * (y * (x / a));
} else {
tmp = -4.5 * ((z * t) / a);
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if (y <= -7.2e-68) or not (y <= 1.4e+101): tmp = 0.5 * (y * (x / a)) else: tmp = -4.5 * ((z * t) / a) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if ((y <= -7.2e-68) || !(y <= 1.4e+101)) tmp = Float64(0.5 * Float64(y * Float64(x / a))); else tmp = Float64(-4.5 * Float64(Float64(z * t) / a)); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((y <= -7.2e-68) || ~((y <= 1.4e+101)))
tmp = 0.5 * (y * (x / a));
else
tmp = -4.5 * ((z * t) / a);
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -7.2e-68], N[Not[LessEqual[y, 1.4e+101]], $MachinePrecision]], N[(0.5 * N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{-68} \lor \neg \left(y \leq 1.4 \cdot 10^{+101}\right):\\
\;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\end{array}
\end{array}
if y < -7.20000000000000015e-68 or 1.39999999999999991e101 < y Initial program 92.4%
*-commutative92.4%
*-commutative92.4%
associate-*l*92.4%
Simplified92.4%
Taylor expanded in x around inf 63.5%
associate-/l*62.8%
Simplified62.8%
associate-/r/63.9%
Applied egg-rr63.9%
if -7.20000000000000015e-68 < y < 1.39999999999999991e101Initial program 95.8%
*-commutative95.8%
*-commutative95.8%
associate-*l*95.7%
Simplified95.7%
Taylor expanded in x around 0 69.1%
Final simplification66.8%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* -4.5 (* z (/ t a))))
assert(z < t);
double code(double x, double y, double z, double t, double a) {
return -4.5 * (z * (t / a));
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
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
code = (-4.5d0) * (z * (t / a))
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
return -4.5 * (z * (t / a));
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): return -4.5 * (z * (t / a))
z, t = sort([z, t]) function code(x, y, z, t, a) return Float64(-4.5 * Float64(z * Float64(t / a))) end
z, t = num2cell(sort([z, t])){:}
function tmp = code(x, y, z, t, a)
tmp = -4.5 * (z * (t / a));
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
-4.5 \cdot \left(z \cdot \frac{t}{a}\right)
\end{array}
Initial program 94.3%
*-commutative94.3%
*-commutative94.3%
associate-*l*94.2%
Simplified94.2%
Taylor expanded in x around 0 53.3%
associate-/l*52.1%
associate-/r/50.9%
Simplified50.9%
Final simplification50.9%
(FPCore (x y z t a)
:precision binary64
(if (< a -2.090464557976709e+86)
(- (* 0.5 (/ (* y x) a)) (* 4.5 (/ t (/ a z))))
(if (< a 2.144030707833976e+99)
(/ (- (* x y) (* z (* 9.0 t))) (* a 2.0))
(- (* (/ y a) (* x 0.5)) (* (/ t a) (* z 4.5))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a < -2.090464557976709e+86) {
tmp = (0.5 * ((y * x) / a)) - (4.5 * (t / (a / z)));
} else if (a < 2.144030707833976e+99) {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
} else {
tmp = ((y / a) * (x * 0.5)) - ((t / a) * (z * 4.5));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: tmp
if (a < (-2.090464557976709d+86)) then
tmp = (0.5d0 * ((y * x) / a)) - (4.5d0 * (t / (a / z)))
else if (a < 2.144030707833976d+99) then
tmp = ((x * y) - (z * (9.0d0 * t))) / (a * 2.0d0)
else
tmp = ((y / a) * (x * 0.5d0)) - ((t / a) * (z * 4.5d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a < -2.090464557976709e+86) {
tmp = (0.5 * ((y * x) / a)) - (4.5 * (t / (a / z)));
} else if (a < 2.144030707833976e+99) {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
} else {
tmp = ((y / a) * (x * 0.5)) - ((t / a) * (z * 4.5));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a < -2.090464557976709e+86: tmp = (0.5 * ((y * x) / a)) - (4.5 * (t / (a / z))) elif a < 2.144030707833976e+99: tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0) else: tmp = ((y / a) * (x * 0.5)) - ((t / a) * (z * 4.5)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a < -2.090464557976709e+86) tmp = Float64(Float64(0.5 * Float64(Float64(y * x) / a)) - Float64(4.5 * Float64(t / Float64(a / z)))); elseif (a < 2.144030707833976e+99) tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(9.0 * t))) / Float64(a * 2.0)); else tmp = Float64(Float64(Float64(y / a) * Float64(x * 0.5)) - Float64(Float64(t / a) * Float64(z * 4.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a < -2.090464557976709e+86) tmp = (0.5 * ((y * x) / a)) - (4.5 * (t / (a / z))); elseif (a < 2.144030707833976e+99) tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0); else tmp = ((y / a) * (x * 0.5)) - ((t / a) * (z * 4.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Less[a, -2.090464557976709e+86], N[(N[(0.5 * N[(N[(y * x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] - N[(4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Less[a, 2.144030707833976e+99], N[(N[(N[(x * y), $MachinePrecision] - N[(z * N[(9.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / a), $MachinePrecision] * N[(x * 0.5), $MachinePrecision]), $MachinePrecision] - N[(N[(t / a), $MachinePrecision] * N[(z * 4.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a < -2.090464557976709 \cdot 10^{+86}:\\
\;\;\;\;0.5 \cdot \frac{y \cdot x}{a} - 4.5 \cdot \frac{t}{\frac{a}{z}}\\
\mathbf{elif}\;a < 2.144030707833976 \cdot 10^{+99}:\\
\;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} \cdot \left(x \cdot 0.5\right) - \frac{t}{a} \cdot \left(z \cdot 4.5\right)\\
\end{array}
\end{array}
herbie shell --seed 2023308
(FPCore (x y z t a)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, I"
:precision binary64
:herbie-target
(if (< a -2.090464557976709e+86) (- (* 0.5 (/ (* y x) a)) (* 4.5 (/ t (/ a z)))) (if (< a 2.144030707833976e+99) (/ (- (* x y) (* z (* 9.0 t))) (* a 2.0)) (- (* (/ y a) (* x 0.5)) (* (/ t a) (* z 4.5)))))
(/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))