
(FPCore (x y z t a) :precision binary64 (/ (- (* x y) (* z t)) a))
double code(double x, double y, double z, double t, double a) {
return ((x * y) - (z * t)) / a;
}
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 * t)) / a
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) - (z * t)) / a;
}
def code(x, y, z, t, a): return ((x * y) - (z * t)) / a
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) - Float64(z * t)) / a) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) - (z * t)) / a; end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y - z \cdot t}{a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (- (* x y) (* z t)) a))
double code(double x, double y, double z, double t, double a) {
return ((x * y) - (z * t)) / a;
}
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 * t)) / a
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) - (z * t)) / a;
}
def code(x, y, z, t, a): return ((x * y) - (z * t)) / a
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) - Float64(z * t)) / a) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) - (z * t)) / a; end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y - z \cdot t}{a}
\end{array}
NOTE: x and y should be sorted in increasing order before calling this function.
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) (* z t))))
(if (<= t_1 -5e+261)
(- (/ x (/ a y)) (/ z (/ a t)))
(if (<= t_1 4e+305)
(/ (fma (- t) z (* x y)) a)
(fma y (/ x a) (/ (- z) (/ a t)))))))assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) - (z * t);
double tmp;
if (t_1 <= -5e+261) {
tmp = (x / (a / y)) - (z / (a / t));
} else if (t_1 <= 4e+305) {
tmp = fma(-t, z, (x * y)) / a;
} else {
tmp = fma(y, (x / a), (-z / (a / t)));
}
return tmp;
}
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) - Float64(z * t)) tmp = 0.0 if (t_1 <= -5e+261) tmp = Float64(Float64(x / Float64(a / y)) - Float64(z / Float64(a / t))); elseif (t_1 <= 4e+305) tmp = Float64(fma(Float64(-t), z, Float64(x * y)) / a); else tmp = fma(y, Float64(x / a), Float64(Float64(-z) / Float64(a / t))); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function.
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[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+261], N[(N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision] - N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+305], N[(N[((-t) * z + N[(x * y), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(y * N[(x / a), $MachinePrecision] + N[((-z) / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := x \cdot y - z \cdot t\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+261}:\\
\;\;\;\;\frac{x}{\frac{a}{y}} - \frac{z}{\frac{a}{t}}\\
\mathbf{elif}\;t_1 \leq 4 \cdot 10^{+305}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-t, z, x \cdot y\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x}{a}, \frac{-z}{\frac{a}{t}}\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -5.0000000000000001e261Initial program 67.6%
div-sub65.3%
associate-/l*86.6%
associate-/l*95.1%
Applied egg-rr95.1%
if -5.0000000000000001e261 < (-.f64 (*.f64 x y) (*.f64 z t)) < 3.9999999999999998e305Initial program 98.5%
cancel-sign-sub-inv98.5%
*-commutative98.5%
+-commutative98.5%
distribute-rgt-neg-out98.5%
distribute-lft-neg-in98.5%
fma-def98.6%
Applied egg-rr98.6%
if 3.9999999999999998e305 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 69.5%
div-sub66.2%
*-commutative66.2%
*-un-lft-identity66.2%
times-frac81.6%
fma-neg81.6%
associate-/l*93.4%
Applied egg-rr93.4%
Final simplification97.4%
NOTE: x and y should be sorted in increasing order before calling this function.
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) (* z t))))
(if (or (<= t_1 -5e+261) (not (<= t_1 4e+305)))
(- (/ x (/ a y)) (/ z (/ a t)))
(/ (fma (- t) z (* x y)) a))))assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) - (z * t);
double tmp;
if ((t_1 <= -5e+261) || !(t_1 <= 4e+305)) {
tmp = (x / (a / y)) - (z / (a / t));
} else {
tmp = fma(-t, z, (x * y)) / a;
}
return tmp;
}
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) - Float64(z * t)) tmp = 0.0 if ((t_1 <= -5e+261) || !(t_1 <= 4e+305)) tmp = Float64(Float64(x / Float64(a / y)) - Float64(z / Float64(a / t))); else tmp = Float64(fma(Float64(-t), z, Float64(x * y)) / a); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function.
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[(z * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e+261], N[Not[LessEqual[t$95$1, 4e+305]], $MachinePrecision]], N[(N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision] - N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-t) * z + N[(x * y), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := x \cdot y - z \cdot t\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+261} \lor \neg \left(t_1 \leq 4 \cdot 10^{+305}\right):\\
\;\;\;\;\frac{x}{\frac{a}{y}} - \frac{z}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-t, z, x \cdot y\right)}{a}\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -5.0000000000000001e261 or 3.9999999999999998e305 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 68.4%
div-sub65.7%
associate-/l*84.5%
associate-/l*94.4%
Applied egg-rr94.4%
if -5.0000000000000001e261 < (-.f64 (*.f64 x y) (*.f64 z t)) < 3.9999999999999998e305Initial program 98.5%
cancel-sign-sub-inv98.5%
*-commutative98.5%
+-commutative98.5%
distribute-rgt-neg-out98.5%
distribute-lft-neg-in98.5%
fma-def98.6%
Applied egg-rr98.6%
Final simplification97.4%
NOTE: x and y should be sorted in increasing order before calling this function.
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) (* z t))))
(if (or (<= t_1 -5e+261) (not (<= t_1 4e+305)))
(- (/ x (/ a y)) (/ z (/ a t)))
(/ t_1 a))))assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) - (z * t);
double tmp;
if ((t_1 <= -5e+261) || !(t_1 <= 4e+305)) {
tmp = (x / (a / y)) - (z / (a / t));
} else {
tmp = t_1 / a;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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) - (z * t)
if ((t_1 <= (-5d+261)) .or. (.not. (t_1 <= 4d+305))) then
tmp = (x / (a / y)) - (z / (a / t))
else
tmp = t_1 / a
end if
code = tmp
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) - (z * t);
double tmp;
if ((t_1 <= -5e+261) || !(t_1 <= 4e+305)) {
tmp = (x / (a / y)) - (z / (a / t));
} else {
tmp = t_1 / a;
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): t_1 = (x * y) - (z * t) tmp = 0 if (t_1 <= -5e+261) or not (t_1 <= 4e+305): tmp = (x / (a / y)) - (z / (a / t)) else: tmp = t_1 / a return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) - Float64(z * t)) tmp = 0.0 if ((t_1 <= -5e+261) || !(t_1 <= 4e+305)) tmp = Float64(Float64(x / Float64(a / y)) - Float64(z / Float64(a / t))); else tmp = Float64(t_1 / a); end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = (x * y) - (z * t);
tmp = 0.0;
if ((t_1 <= -5e+261) || ~((t_1 <= 4e+305)))
tmp = (x / (a / y)) - (z / (a / t));
else
tmp = t_1 / a;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
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[(z * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e+261], N[Not[LessEqual[t$95$1, 4e+305]], $MachinePrecision]], N[(N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision] - N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 / a), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := x \cdot y - z \cdot t\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+261} \lor \neg \left(t_1 \leq 4 \cdot 10^{+305}\right):\\
\;\;\;\;\frac{x}{\frac{a}{y}} - \frac{z}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1}{a}\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -5.0000000000000001e261 or 3.9999999999999998e305 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 68.4%
div-sub65.7%
associate-/l*84.5%
associate-/l*94.4%
Applied egg-rr94.4%
if -5.0000000000000001e261 < (-.f64 (*.f64 x y) (*.f64 z t)) < 3.9999999999999998e305Initial program 98.5%
Final simplification97.3%
NOTE: x and y should be sorted in increasing order before calling this function.
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 (* (/ t a) (- z))) (t_2 (* y (/ x a))))
(if (<= x -1.25e+162)
(/ y (/ a x))
(if (<= x -6e+151)
t_1
(if (<= x -1.55e+34)
t_2
(if (<= x -9e-159) t_1 (if (<= x 2.9e+25) (/ (- t) (/ a z)) t_2)))))))assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double t_1 = (t / a) * -z;
double t_2 = y * (x / a);
double tmp;
if (x <= -1.25e+162) {
tmp = y / (a / x);
} else if (x <= -6e+151) {
tmp = t_1;
} else if (x <= -1.55e+34) {
tmp = t_2;
} else if (x <= -9e-159) {
tmp = t_1;
} else if (x <= 2.9e+25) {
tmp = -t / (a / z);
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 = (t / a) * -z
t_2 = y * (x / a)
if (x <= (-1.25d+162)) then
tmp = y / (a / x)
else if (x <= (-6d+151)) then
tmp = t_1
else if (x <= (-1.55d+34)) then
tmp = t_2
else if (x <= (-9d-159)) then
tmp = t_1
else if (x <= 2.9d+25) then
tmp = -t / (a / z)
else
tmp = t_2
end if
code = tmp
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (t / a) * -z;
double t_2 = y * (x / a);
double tmp;
if (x <= -1.25e+162) {
tmp = y / (a / x);
} else if (x <= -6e+151) {
tmp = t_1;
} else if (x <= -1.55e+34) {
tmp = t_2;
} else if (x <= -9e-159) {
tmp = t_1;
} else if (x <= 2.9e+25) {
tmp = -t / (a / z);
} else {
tmp = t_2;
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): t_1 = (t / a) * -z t_2 = y * (x / a) tmp = 0 if x <= -1.25e+162: tmp = y / (a / x) elif x <= -6e+151: tmp = t_1 elif x <= -1.55e+34: tmp = t_2 elif x <= -9e-159: tmp = t_1 elif x <= 2.9e+25: tmp = -t / (a / z) else: tmp = t_2 return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) t_1 = Float64(Float64(t / a) * Float64(-z)) t_2 = Float64(y * Float64(x / a)) tmp = 0.0 if (x <= -1.25e+162) tmp = Float64(y / Float64(a / x)); elseif (x <= -6e+151) tmp = t_1; elseif (x <= -1.55e+34) tmp = t_2; elseif (x <= -9e-159) tmp = t_1; elseif (x <= 2.9e+25) tmp = Float64(Float64(-t) / Float64(a / z)); else tmp = t_2; end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = (t / a) * -z;
t_2 = y * (x / a);
tmp = 0.0;
if (x <= -1.25e+162)
tmp = y / (a / x);
elseif (x <= -6e+151)
tmp = t_1;
elseif (x <= -1.55e+34)
tmp = t_2;
elseif (x <= -9e-159)
tmp = t_1;
elseif (x <= 2.9e+25)
tmp = -t / (a / z);
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
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[(t / a), $MachinePrecision] * (-z)), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.25e+162], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -6e+151], t$95$1, If[LessEqual[x, -1.55e+34], t$95$2, If[LessEqual[x, -9e-159], t$95$1, If[LessEqual[x, 2.9e+25], N[((-t) / N[(a / z), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := \frac{t}{a} \cdot \left(-z\right)\\
t_2 := y \cdot \frac{x}{a}\\
\mathbf{if}\;x \leq -1.25 \cdot 10^{+162}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\mathbf{elif}\;x \leq -6 \cdot 10^{+151}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.55 \cdot 10^{+34}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -9 \cdot 10^{-159}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{+25}:\\
\;\;\;\;\frac{-t}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -1.2499999999999999e162Initial program 75.5%
Taylor expanded in x around inf 67.7%
associate-/l*79.0%
Simplified79.0%
if -1.2499999999999999e162 < x < -5.9999999999999998e151 or -1.54999999999999989e34 < x < -8.99999999999999977e-159Initial program 96.8%
Taylor expanded in x around 0 72.0%
mul-1-neg72.0%
associate-/l*74.1%
distribute-neg-frac74.1%
Simplified74.1%
frac-2neg74.1%
associate-/r/69.7%
frac-2neg69.7%
Applied egg-rr69.7%
if -5.9999999999999998e151 < x < -1.54999999999999989e34 or 2.8999999999999999e25 < x Initial program 87.1%
Taylor expanded in x around inf 58.9%
associate-*r/70.2%
Simplified70.2%
if -8.99999999999999977e-159 < x < 2.8999999999999999e25Initial program 94.3%
Taylor expanded in x around 0 78.0%
mul-1-neg78.0%
associate-/l*72.7%
distribute-neg-frac72.7%
Simplified72.7%
Final simplification72.4%
NOTE: x and y should be sorted in increasing order before calling this function.
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 (- t)) a)))
(if (<= x -1.8e+162)
(/ y (/ a x))
(if (<= x -3.85e+146)
t_1
(if (<= x -3.5e+34)
(* y (/ x a))
(if (<= x 3.3e+25) t_1 (* y (* x (/ 1.0 a)))))))))assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double t_1 = (z * -t) / a;
double tmp;
if (x <= -1.8e+162) {
tmp = y / (a / x);
} else if (x <= -3.85e+146) {
tmp = t_1;
} else if (x <= -3.5e+34) {
tmp = y * (x / a);
} else if (x <= 3.3e+25) {
tmp = t_1;
} else {
tmp = y * (x * (1.0 / a));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 * -t) / a
if (x <= (-1.8d+162)) then
tmp = y / (a / x)
else if (x <= (-3.85d+146)) then
tmp = t_1
else if (x <= (-3.5d+34)) then
tmp = y * (x / a)
else if (x <= 3.3d+25) then
tmp = t_1
else
tmp = y * (x * (1.0d0 / a))
end if
code = tmp
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z * -t) / a;
double tmp;
if (x <= -1.8e+162) {
tmp = y / (a / x);
} else if (x <= -3.85e+146) {
tmp = t_1;
} else if (x <= -3.5e+34) {
tmp = y * (x / a);
} else if (x <= 3.3e+25) {
tmp = t_1;
} else {
tmp = y * (x * (1.0 / a));
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): t_1 = (z * -t) / a tmp = 0 if x <= -1.8e+162: tmp = y / (a / x) elif x <= -3.85e+146: tmp = t_1 elif x <= -3.5e+34: tmp = y * (x / a) elif x <= 3.3e+25: tmp = t_1 else: tmp = y * (x * (1.0 / a)) return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) t_1 = Float64(Float64(z * Float64(-t)) / a) tmp = 0.0 if (x <= -1.8e+162) tmp = Float64(y / Float64(a / x)); elseif (x <= -3.85e+146) tmp = t_1; elseif (x <= -3.5e+34) tmp = Float64(y * Float64(x / a)); elseif (x <= 3.3e+25) tmp = t_1; else tmp = Float64(y * Float64(x * Float64(1.0 / a))); end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = (z * -t) / a;
tmp = 0.0;
if (x <= -1.8e+162)
tmp = y / (a / x);
elseif (x <= -3.85e+146)
tmp = t_1;
elseif (x <= -3.5e+34)
tmp = y * (x / a);
elseif (x <= 3.3e+25)
tmp = t_1;
else
tmp = y * (x * (1.0 / a));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
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 * (-t)), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[x, -1.8e+162], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.85e+146], t$95$1, If[LessEqual[x, -3.5e+34], N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.3e+25], t$95$1, N[(y * N[(x * N[(1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := \frac{z \cdot \left(-t\right)}{a}\\
\mathbf{if}\;x \leq -1.8 \cdot 10^{+162}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\mathbf{elif}\;x \leq -3.85 \cdot 10^{+146}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -3.5 \cdot 10^{+34}:\\
\;\;\;\;y \cdot \frac{x}{a}\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{+25}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x \cdot \frac{1}{a}\right)\\
\end{array}
\end{array}
if x < -1.79999999999999997e162Initial program 75.5%
Taylor expanded in x around inf 67.7%
associate-/l*79.0%
Simplified79.0%
if -1.79999999999999997e162 < x < -3.8500000000000001e146 or -3.49999999999999998e34 < x < 3.3000000000000001e25Initial program 94.5%
Taylor expanded in x around 0 75.4%
associate-*r/75.4%
associate-*r*75.4%
neg-mul-175.4%
Simplified75.4%
if -3.8500000000000001e146 < x < -3.49999999999999998e34Initial program 82.9%
Taylor expanded in x around inf 60.2%
associate-*r/71.2%
Simplified71.2%
if 3.3000000000000001e25 < x Initial program 89.4%
Taylor expanded in x around inf 59.7%
associate-*r/70.0%
Simplified70.0%
*-commutative70.0%
associate-/r/64.8%
Applied egg-rr64.8%
*-un-lft-identity64.8%
div-inv64.9%
frac-times59.7%
associate-/r/59.7%
/-rgt-identity59.7%
associate-*r*70.0%
Applied egg-rr70.0%
Final simplification74.5%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= x -2.1e+34)
(/ y (/ a x))
(if (or (<= x -9e-8) (and (not (<= x -9.5e-50)) (<= x 3.6e+40)))
(* (- t) (/ z a))
(* y (/ x a)))))assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -2.1e+34) {
tmp = y / (a / x);
} else if ((x <= -9e-8) || (!(x <= -9.5e-50) && (x <= 3.6e+40))) {
tmp = -t * (z / a);
} else {
tmp = y * (x / a);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 <= (-2.1d+34)) then
tmp = y / (a / x)
else if ((x <= (-9d-8)) .or. (.not. (x <= (-9.5d-50))) .and. (x <= 3.6d+40)) then
tmp = -t * (z / a)
else
tmp = y * (x / a)
end if
code = tmp
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -2.1e+34) {
tmp = y / (a / x);
} else if ((x <= -9e-8) || (!(x <= -9.5e-50) && (x <= 3.6e+40))) {
tmp = -t * (z / a);
} else {
tmp = y * (x / a);
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if x <= -2.1e+34: tmp = y / (a / x) elif (x <= -9e-8) or (not (x <= -9.5e-50) and (x <= 3.6e+40)): tmp = -t * (z / a) else: tmp = y * (x / a) return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (x <= -2.1e+34) tmp = Float64(y / Float64(a / x)); elseif ((x <= -9e-8) || (!(x <= -9.5e-50) && (x <= 3.6e+40))) tmp = Float64(Float64(-t) * Float64(z / a)); else tmp = Float64(y * Float64(x / a)); end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (x <= -2.1e+34)
tmp = y / (a / x);
elseif ((x <= -9e-8) || (~((x <= -9.5e-50)) && (x <= 3.6e+40)))
tmp = -t * (z / a);
else
tmp = y * (x / a);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[x, -2.1e+34], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -9e-8], And[N[Not[LessEqual[x, -9.5e-50]], $MachinePrecision], LessEqual[x, 3.6e+40]]], N[((-t) * N[(z / a), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.1 \cdot 10^{+34}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\mathbf{elif}\;x \leq -9 \cdot 10^{-8} \lor \neg \left(x \leq -9.5 \cdot 10^{-50}\right) \land x \leq 3.6 \cdot 10^{+40}:\\
\;\;\;\;\left(-t\right) \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{a}\\
\end{array}
\end{array}
if x < -2.10000000000000017e34Initial program 78.0%
Taylor expanded in x around inf 63.4%
associate-/l*73.7%
Simplified73.7%
if -2.10000000000000017e34 < x < -8.99999999999999986e-8 or -9.4999999999999993e-50 < x < 3.59999999999999996e40Initial program 95.7%
Taylor expanded in x around 0 77.9%
mul-1-neg77.9%
*-commutative77.9%
associate-*l/72.9%
*-commutative72.9%
distribute-lft-neg-in72.9%
Simplified72.9%
if -8.99999999999999986e-8 < x < -9.4999999999999993e-50 or 3.59999999999999996e40 < x Initial program 87.7%
Taylor expanded in x around inf 63.5%
associate-*r/73.8%
Simplified73.8%
Final simplification73.3%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= x -1.8e+162)
(/ y (/ a x))
(if (<= x -6e+151)
(* (/ t a) (- z))
(if (or (<= x -3.6e+35) (not (<= x 3.5e+38)))
(* y (/ x a))
(* (- t) (/ z a))))))assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.8e+162) {
tmp = y / (a / x);
} else if (x <= -6e+151) {
tmp = (t / a) * -z;
} else if ((x <= -3.6e+35) || !(x <= 3.5e+38)) {
tmp = y * (x / a);
} else {
tmp = -t * (z / a);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 <= (-1.8d+162)) then
tmp = y / (a / x)
else if (x <= (-6d+151)) then
tmp = (t / a) * -z
else if ((x <= (-3.6d+35)) .or. (.not. (x <= 3.5d+38))) then
tmp = y * (x / a)
else
tmp = -t * (z / a)
end if
code = tmp
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.8e+162) {
tmp = y / (a / x);
} else if (x <= -6e+151) {
tmp = (t / a) * -z;
} else if ((x <= -3.6e+35) || !(x <= 3.5e+38)) {
tmp = y * (x / a);
} else {
tmp = -t * (z / a);
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if x <= -1.8e+162: tmp = y / (a / x) elif x <= -6e+151: tmp = (t / a) * -z elif (x <= -3.6e+35) or not (x <= 3.5e+38): tmp = y * (x / a) else: tmp = -t * (z / a) return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (x <= -1.8e+162) tmp = Float64(y / Float64(a / x)); elseif (x <= -6e+151) tmp = Float64(Float64(t / a) * Float64(-z)); elseif ((x <= -3.6e+35) || !(x <= 3.5e+38)) tmp = Float64(y * Float64(x / a)); else tmp = Float64(Float64(-t) * Float64(z / a)); end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (x <= -1.8e+162)
tmp = y / (a / x);
elseif (x <= -6e+151)
tmp = (t / a) * -z;
elseif ((x <= -3.6e+35) || ~((x <= 3.5e+38)))
tmp = y * (x / a);
else
tmp = -t * (z / a);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.8e+162], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -6e+151], N[(N[(t / a), $MachinePrecision] * (-z)), $MachinePrecision], If[Or[LessEqual[x, -3.6e+35], N[Not[LessEqual[x, 3.5e+38]], $MachinePrecision]], N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision], N[((-t) * N[(z / a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.8 \cdot 10^{+162}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\mathbf{elif}\;x \leq -6 \cdot 10^{+151}:\\
\;\;\;\;\frac{t}{a} \cdot \left(-z\right)\\
\mathbf{elif}\;x \leq -3.6 \cdot 10^{+35} \lor \neg \left(x \leq 3.5 \cdot 10^{+38}\right):\\
\;\;\;\;y \cdot \frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;\left(-t\right) \cdot \frac{z}{a}\\
\end{array}
\end{array}
if x < -1.79999999999999997e162Initial program 75.5%
Taylor expanded in x around inf 67.7%
associate-/l*79.0%
Simplified79.0%
if -1.79999999999999997e162 < x < -5.9999999999999998e151Initial program 100.0%
Taylor expanded in x around 0 50.3%
mul-1-neg50.3%
associate-/l*50.3%
distribute-neg-frac50.3%
Simplified50.3%
frac-2neg50.3%
associate-/r/28.0%
frac-2neg28.0%
Applied egg-rr28.0%
if -5.9999999999999998e151 < x < -3.6e35 or 3.50000000000000002e38 < x Initial program 86.2%
Taylor expanded in x around inf 61.6%
associate-*r/73.7%
Simplified73.7%
if -3.6e35 < x < 3.50000000000000002e38Initial program 95.2%
Taylor expanded in x around 0 76.7%
mul-1-neg76.7%
*-commutative76.7%
associate-*l/72.5%
*-commutative72.5%
distribute-lft-neg-in72.5%
Simplified72.5%
Final simplification73.5%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= x -1.25e+162)
(/ y (/ a x))
(if (or (<= x -8e+145) (and (not (<= x -8.6e+36)) (<= x 3.8e+25)))
(/ (* z (- t)) a)
(* y (/ x a)))))assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.25e+162) {
tmp = y / (a / x);
} else if ((x <= -8e+145) || (!(x <= -8.6e+36) && (x <= 3.8e+25))) {
tmp = (z * -t) / a;
} else {
tmp = y * (x / a);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 <= (-1.25d+162)) then
tmp = y / (a / x)
else if ((x <= (-8d+145)) .or. (.not. (x <= (-8.6d+36))) .and. (x <= 3.8d+25)) then
tmp = (z * -t) / a
else
tmp = y * (x / a)
end if
code = tmp
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.25e+162) {
tmp = y / (a / x);
} else if ((x <= -8e+145) || (!(x <= -8.6e+36) && (x <= 3.8e+25))) {
tmp = (z * -t) / a;
} else {
tmp = y * (x / a);
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if x <= -1.25e+162: tmp = y / (a / x) elif (x <= -8e+145) or (not (x <= -8.6e+36) and (x <= 3.8e+25)): tmp = (z * -t) / a else: tmp = y * (x / a) return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (x <= -1.25e+162) tmp = Float64(y / Float64(a / x)); elseif ((x <= -8e+145) || (!(x <= -8.6e+36) && (x <= 3.8e+25))) tmp = Float64(Float64(z * Float64(-t)) / a); else tmp = Float64(y * Float64(x / a)); end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (x <= -1.25e+162)
tmp = y / (a / x);
elseif ((x <= -8e+145) || (~((x <= -8.6e+36)) && (x <= 3.8e+25)))
tmp = (z * -t) / a;
else
tmp = y * (x / a);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.25e+162], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -8e+145], And[N[Not[LessEqual[x, -8.6e+36]], $MachinePrecision], LessEqual[x, 3.8e+25]]], N[(N[(z * (-t)), $MachinePrecision] / a), $MachinePrecision], N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{+162}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\mathbf{elif}\;x \leq -8 \cdot 10^{+145} \lor \neg \left(x \leq -8.6 \cdot 10^{+36}\right) \land x \leq 3.8 \cdot 10^{+25}:\\
\;\;\;\;\frac{z \cdot \left(-t\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{a}\\
\end{array}
\end{array}
if x < -1.2499999999999999e162Initial program 75.5%
Taylor expanded in x around inf 67.7%
associate-/l*79.0%
Simplified79.0%
if -1.2499999999999999e162 < x < -7.9999999999999999e145 or -8.6000000000000001e36 < x < 3.8e25Initial program 93.9%
Taylor expanded in x around 0 74.4%
associate-*r/74.4%
associate-*r*74.4%
neg-mul-174.4%
Simplified74.4%
if -7.9999999999999999e145 < x < -8.6000000000000001e36 or 3.8e25 < x Initial program 88.9%
Taylor expanded in x around inf 60.0%
associate-*r/69.5%
Simplified69.5%
Final simplification73.7%
NOTE: x and y should be sorted in increasing order before calling this function. 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) (- INFINITY)) (* y (* x (/ 1.0 a))) (/ (- (* x y) (* z t)) a)))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -((double) INFINITY)) {
tmp = y * (x * (1.0 / a));
} else {
tmp = ((x * y) - (z * t)) / a;
}
return tmp;
}
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -Double.POSITIVE_INFINITY) {
tmp = y * (x * (1.0 / a));
} else {
tmp = ((x * y) - (z * t)) / a;
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if (x * y) <= -math.inf: tmp = y * (x * (1.0 / a)) else: tmp = ((x * y) - (z * t)) / a return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= Float64(-Inf)) tmp = Float64(y * Float64(x * Float64(1.0 / a))); else tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a); end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x * y) <= -Inf)
tmp = y * (x * (1.0 / a));
else
tmp = ((x * y) - (z * t)) / a;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. 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], (-Infinity)], N[(y * N[(x * N[(1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -\infty:\\
\;\;\;\;y \cdot \left(x \cdot \frac{1}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\
\end{array}
\end{array}
if (*.f64 x y) < -inf.0Initial program 55.9%
Taylor expanded in x around inf 55.9%
associate-*r/99.8%
Simplified99.8%
*-commutative99.8%
associate-/r/99.6%
Applied egg-rr99.6%
*-un-lft-identity99.6%
div-inv99.6%
frac-times55.9%
associate-/r/55.9%
/-rgt-identity55.9%
associate-*r*99.8%
Applied egg-rr99.8%
if -inf.0 < (*.f64 x y) Initial program 92.9%
Final simplification93.4%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= a 1.25e-68) (* x (/ y a)) (/ (* x y) a)))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 1.25e-68) {
tmp = x * (y / a);
} else {
tmp = (x * y) / a;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 (a <= 1.25d-68) then
tmp = x * (y / a)
else
tmp = (x * y) / a
end if
code = tmp
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 1.25e-68) {
tmp = x * (y / a);
} else {
tmp = (x * y) / a;
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if a <= 1.25e-68: tmp = x * (y / a) else: tmp = (x * y) / a return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (a <= 1.25e-68) tmp = Float64(x * Float64(y / a)); else tmp = Float64(Float64(x * y) / a); end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (a <= 1.25e-68)
tmp = x * (y / a);
else
tmp = (x * y) / a;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[a, 1.25e-68], N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.25 \cdot 10^{-68}:\\
\;\;\;\;x \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{a}\\
\end{array}
\end{array}
if a < 1.24999999999999993e-68Initial program 87.0%
Taylor expanded in x around inf 42.2%
associate-/l*48.4%
associate-/r/50.2%
Applied egg-rr50.2%
if 1.24999999999999993e-68 < a Initial program 96.3%
Taylor expanded in x around inf 56.7%
Final simplification52.1%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* y (/ x a)))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
return y * (x / a);
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 = y * (x / a)
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
return y * (x / a);
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): return y * (x / a)
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) return Float64(y * Float64(x / a)) end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp = code(x, y, z, t, a)
tmp = y * (x / a);
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
y \cdot \frac{x}{a}
\end{array}
Initial program 89.8%
Taylor expanded in x around inf 46.6%
associate-*r/49.6%
Simplified49.6%
Final simplification49.6%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* x (/ y a)))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
return x * (y / a);
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 = x * (y / a)
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
return x * (y / a);
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): return x * (y / a)
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) return Float64(x * Float64(y / a)) end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp = code(x, y, z, t, a)
tmp = x * (y / a);
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
x \cdot \frac{y}{a}
\end{array}
Initial program 89.8%
Taylor expanded in x around inf 46.6%
associate-/l*49.8%
associate-/r/50.7%
Applied egg-rr50.7%
Final simplification50.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* (/ y a) x) (* (/ t a) z))))
(if (< z -2.468684968699548e+170)
t_1
(if (< z 6.309831121978371e-71) (/ (- (* x y) (* z t)) a) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((y / a) * x) - ((t / a) * z);
double tmp;
if (z < -2.468684968699548e+170) {
tmp = t_1;
} else if (z < 6.309831121978371e-71) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_1 = ((y / a) * x) - ((t / a) * z)
if (z < (-2.468684968699548d+170)) then
tmp = t_1
else if (z < 6.309831121978371d-71) then
tmp = ((x * y) - (z * t)) / a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((y / a) * x) - ((t / a) * z);
double tmp;
if (z < -2.468684968699548e+170) {
tmp = t_1;
} else if (z < 6.309831121978371e-71) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((y / a) * x) - ((t / a) * z) tmp = 0 if z < -2.468684968699548e+170: tmp = t_1 elif z < 6.309831121978371e-71: tmp = ((x * y) - (z * t)) / a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(y / a) * x) - Float64(Float64(t / a) * z)) tmp = 0.0 if (z < -2.468684968699548e+170) tmp = t_1; elseif (z < 6.309831121978371e-71) tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((y / a) * x) - ((t / a) * z); tmp = 0.0; if (z < -2.468684968699548e+170) tmp = t_1; elseif (z < 6.309831121978371e-71) tmp = ((x * y) - (z * t)) / a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y / a), $MachinePrecision] * x), $MachinePrecision] - N[(N[(t / a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -2.468684968699548e+170], t$95$1, If[Less[z, 6.309831121978371e-71], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{a} \cdot x - \frac{t}{a} \cdot z\\
\mathbf{if}\;z < -2.468684968699548 \cdot 10^{+170}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z < 6.309831121978371 \cdot 10^{-71}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
herbie shell --seed 2023263
(FPCore (x y z t a)
:name "Data.Colour.Matrix:inverse from colour-2.3.3, B"
:precision binary64
:herbie-target
(if (< z -2.468684968699548e+170) (- (* (/ y a) x) (* (/ t a) z)) (if (< z 6.309831121978371e-71) (/ (- (* x y) (* z t)) a) (- (* (/ y a) x) (* (/ t a) z))))
(/ (- (* x y) (* z t)) a))