
(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 13 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, y, z, t, and a 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 (- INFINITY)) (not (<= t_1 2e+303)))
(* x (- (/ y a) (* t (/ (/ z x) a))))
(/ t_1 a))))assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) - (z * t);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 2e+303)) {
tmp = x * ((y / a) - (t * ((z / x) / a)));
} else {
tmp = t_1 / a;
}
return tmp;
}
assert x < y && y < z && z < t && t < a;
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 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 2e+303)) {
tmp = x * ((y / a) - (t * ((z / x) / a)));
} else {
tmp = t_1 / a;
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): t_1 = (x * y) - (z * t) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 2e+303): tmp = x * ((y / a) - (t * ((z / x) / a))) else: tmp = t_1 / a return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) - Float64(z * t)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 2e+303)) tmp = Float64(x * Float64(Float64(y / a) - Float64(t * Float64(Float64(z / x) / a)))); else tmp = Float64(t_1 / a); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = (x * y) - (z * t);
tmp = 0.0;
if ((t_1 <= -Inf) || ~((t_1 <= 2e+303)))
tmp = x * ((y / a) - (t * ((z / x) / a)));
else
tmp = t_1 / a;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a 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, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+303]], $MachinePrecision]], N[(x * N[(N[(y / a), $MachinePrecision] - N[(t * N[(N[(z / x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 / a), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := x \cdot y - z \cdot t\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+303}\right):\\
\;\;\;\;x \cdot \left(\frac{y}{a} - t \cdot \frac{\frac{z}{x}}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{a}\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0 or 2e303 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 68.1%
Taylor expanded in x around inf 82.7%
+-commutative82.7%
mul-1-neg82.7%
unsub-neg82.7%
associate-/l*87.6%
*-commutative87.6%
associate-/r*89.1%
Simplified89.1%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 2e303Initial program 99.6%
Final simplification97.1%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= a 9.6e+104) (/ (fma x y (* z (- t))) a) (fma y (/ x a) (* (/ t a) (- z)))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 9.6e+104) {
tmp = fma(x, y, (z * -t)) / a;
} else {
tmp = fma(y, (x / a), ((t / a) * -z));
}
return tmp;
}
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (a <= 9.6e+104) tmp = Float64(fma(x, y, Float64(z * Float64(-t))) / a); else tmp = fma(y, Float64(x / a), Float64(Float64(t / a) * Float64(-z))); end return tmp end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[a, 9.6e+104], N[(N[(x * y + N[(z * (-t)), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(y * N[(x / a), $MachinePrecision] + N[(N[(t / a), $MachinePrecision] * (-z)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 9.6 \cdot 10^{+104}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(-t\right)\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x}{a}, \frac{t}{a} \cdot \left(-z\right)\right)\\
\end{array}
\end{array}
if a < 9.6e104Initial program 95.8%
div-sub93.0%
*-commutative93.0%
div-sub95.8%
*-commutative95.8%
fma-neg96.2%
distribute-rgt-neg-out96.2%
Simplified96.2%
if 9.6e104 < a Initial program 71.6%
div-sub71.6%
*-commutative71.6%
associate-/l*83.8%
fma-neg83.8%
associate-/l*93.2%
Applied egg-rr93.2%
Final simplification95.7%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= a 4e+103) (/ (fma x y (* z (- t))) a) (- (* y (/ x a)) (* z (/ t a)))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 4e+103) {
tmp = fma(x, y, (z * -t)) / a;
} else {
tmp = (y * (x / a)) - (z * (t / a));
}
return tmp;
}
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (a <= 4e+103) tmp = Float64(fma(x, y, Float64(z * Float64(-t))) / a); else tmp = Float64(Float64(y * Float64(x / a)) - Float64(z * Float64(t / a))); end return tmp end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[a, 4e+103], N[(N[(x * y + N[(z * (-t)), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision] - N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 4 \cdot 10^{+103}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(-t\right)\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{a} - z \cdot \frac{t}{a}\\
\end{array}
\end{array}
if a < 4e103Initial program 95.8%
div-sub93.0%
*-commutative93.0%
div-sub95.8%
*-commutative95.8%
fma-neg96.2%
distribute-rgt-neg-out96.2%
Simplified96.2%
if 4e103 < a Initial program 71.6%
div-sub71.6%
*-commutative71.6%
associate-/l*83.8%
fma-neg83.8%
associate-/l*93.2%
Applied egg-rr93.2%
fma-undefine93.2%
unsub-neg93.2%
Applied egg-rr93.2%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ x a))))
(if (<= (* x y) -2e-39)
t_1
(if (<= (* x y) 1e-93)
(* (/ t a) (- z))
(if (<= (* x y) 5e-27)
(/ (* x y) a)
(if (<= (* x y) 2000000000.0) (* (/ -1.0 a) (/ z (/ 1.0 t))) t_1))))))assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (x / a);
double tmp;
if ((x * y) <= -2e-39) {
tmp = t_1;
} else if ((x * y) <= 1e-93) {
tmp = (t / a) * -z;
} else if ((x * y) <= 5e-27) {
tmp = (x * y) / a;
} else if ((x * y) <= 2000000000.0) {
tmp = (-1.0 / a) * (z / (1.0 / t));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, and a 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 = y * (x / a)
if ((x * y) <= (-2d-39)) then
tmp = t_1
else if ((x * y) <= 1d-93) then
tmp = (t / a) * -z
else if ((x * y) <= 5d-27) then
tmp = (x * y) / a
else if ((x * y) <= 2000000000.0d0) then
tmp = ((-1.0d0) / a) * (z / (1.0d0 / t))
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * (x / a);
double tmp;
if ((x * y) <= -2e-39) {
tmp = t_1;
} else if ((x * y) <= 1e-93) {
tmp = (t / a) * -z;
} else if ((x * y) <= 5e-27) {
tmp = (x * y) / a;
} else if ((x * y) <= 2000000000.0) {
tmp = (-1.0 / a) * (z / (1.0 / t));
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): t_1 = y * (x / a) tmp = 0 if (x * y) <= -2e-39: tmp = t_1 elif (x * y) <= 1e-93: tmp = (t / a) * -z elif (x * y) <= 5e-27: tmp = (x * y) / a elif (x * y) <= 2000000000.0: tmp = (-1.0 / a) * (z / (1.0 / t)) else: tmp = t_1 return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) t_1 = Float64(y * Float64(x / a)) tmp = 0.0 if (Float64(x * y) <= -2e-39) tmp = t_1; elseif (Float64(x * y) <= 1e-93) tmp = Float64(Float64(t / a) * Float64(-z)); elseif (Float64(x * y) <= 5e-27) tmp = Float64(Float64(x * y) / a); elseif (Float64(x * y) <= 2000000000.0) tmp = Float64(Float64(-1.0 / a) * Float64(z / Float64(1.0 / t))); else tmp = t_1; end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = y * (x / a);
tmp = 0.0;
if ((x * y) <= -2e-39)
tmp = t_1;
elseif ((x * y) <= 1e-93)
tmp = (t / a) * -z;
elseif ((x * y) <= 5e-27)
tmp = (x * y) / a;
elseif ((x * y) <= 2000000000.0)
tmp = (-1.0 / a) * (z / (1.0 / t));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e-39], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1e-93], N[(N[(t / a), $MachinePrecision] * (-z)), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e-27], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2000000000.0], N[(N[(-1.0 / a), $MachinePrecision] * N[(z / N[(1.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := y \cdot \frac{x}{a}\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 10^{-93}:\\
\;\;\;\;\frac{t}{a} \cdot \left(-z\right)\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-27}:\\
\;\;\;\;\frac{x \cdot y}{a}\\
\mathbf{elif}\;x \cdot y \leq 2000000000:\\
\;\;\;\;\frac{-1}{a} \cdot \frac{z}{\frac{1}{t}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -1.99999999999999986e-39 or 2e9 < (*.f64 x y) Initial program 87.8%
Taylor expanded in x around inf 71.5%
associate-*r/78.5%
Simplified78.5%
clear-num78.4%
un-div-inv79.2%
Applied egg-rr79.2%
associate-/r/71.4%
Applied egg-rr71.4%
if -1.99999999999999986e-39 < (*.f64 x y) < 9.999999999999999e-94Initial program 95.4%
Taylor expanded in x around 0 78.2%
*-commutative78.2%
associate-*r/80.9%
neg-mul-180.9%
distribute-rgt-neg-in80.9%
distribute-frac-neg80.9%
Simplified80.9%
if 9.999999999999999e-94 < (*.f64 x y) < 5.0000000000000002e-27Initial program 95.1%
Taylor expanded in y around inf 90.8%
mul-1-neg90.8%
unsub-neg90.8%
associate-/l*86.3%
Simplified86.3%
Taylor expanded in x around inf 65.3%
if 5.0000000000000002e-27 < (*.f64 x y) < 2e9Initial program 99.8%
Taylor expanded in x around 0 85.7%
mul-1-neg85.7%
associate-/l*85.9%
distribute-rgt-neg-in85.9%
distribute-neg-frac285.9%
Simplified85.9%
*-commutative85.9%
distribute-frac-neg285.9%
distribute-frac-neg85.9%
associate-/r/85.9%
Applied egg-rr85.9%
neg-mul-185.9%
div-inv85.9%
times-frac85.9%
Applied egg-rr85.9%
Final simplification75.4%
NOTE: x, y, z, t, and a 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 y) -2e-39)
t_2
(if (<= (* x y) 1e-93)
t_1
(if (<= (* x y) 5e-27)
(/ (* x y) a)
(if (<= (* x y) 2000000000.0) t_1 t_2))))))assert(x < y && y < z && z < t && t < a);
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 * y) <= -2e-39) {
tmp = t_2;
} else if ((x * y) <= 1e-93) {
tmp = t_1;
} else if ((x * y) <= 5e-27) {
tmp = (x * y) / a;
} else if ((x * y) <= 2000000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, and a 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 * y) <= (-2d-39)) then
tmp = t_2
else if ((x * y) <= 1d-93) then
tmp = t_1
else if ((x * y) <= 5d-27) then
tmp = (x * y) / a
else if ((x * y) <= 2000000000.0d0) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
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 * y) <= -2e-39) {
tmp = t_2;
} else if ((x * y) <= 1e-93) {
tmp = t_1;
} else if ((x * y) <= 5e-27) {
tmp = (x * y) / a;
} else if ((x * y) <= 2000000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): t_1 = (t / a) * -z t_2 = y * (x / a) tmp = 0 if (x * y) <= -2e-39: tmp = t_2 elif (x * y) <= 1e-93: tmp = t_1 elif (x * y) <= 5e-27: tmp = (x * y) / a elif (x * y) <= 2000000000.0: tmp = t_1 else: tmp = t_2 return tmp
x, y, z, t, a = sort([x, y, z, t, a]) 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 (Float64(x * y) <= -2e-39) tmp = t_2; elseif (Float64(x * y) <= 1e-93) tmp = t_1; elseif (Float64(x * y) <= 5e-27) tmp = Float64(Float64(x * y) / a); elseif (Float64(x * y) <= 2000000000.0) tmp = t_1; else tmp = t_2; end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = (t / a) * -z;
t_2 = y * (x / a);
tmp = 0.0;
if ((x * y) <= -2e-39)
tmp = t_2;
elseif ((x * y) <= 1e-93)
tmp = t_1;
elseif ((x * y) <= 5e-27)
tmp = (x * y) / a;
elseif ((x * y) <= 2000000000.0)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a 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[N[(x * y), $MachinePrecision], -2e-39], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 1e-93], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-27], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2000000000.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := \frac{t}{a} \cdot \left(-z\right)\\
t_2 := y \cdot \frac{x}{a}\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{-39}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 10^{-93}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-27}:\\
\;\;\;\;\frac{x \cdot y}{a}\\
\mathbf{elif}\;x \cdot y \leq 2000000000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -1.99999999999999986e-39 or 2e9 < (*.f64 x y) Initial program 87.8%
Taylor expanded in x around inf 71.5%
associate-*r/78.5%
Simplified78.5%
clear-num78.4%
un-div-inv79.2%
Applied egg-rr79.2%
associate-/r/71.4%
Applied egg-rr71.4%
if -1.99999999999999986e-39 < (*.f64 x y) < 9.999999999999999e-94 or 5.0000000000000002e-27 < (*.f64 x y) < 2e9Initial program 95.7%
Taylor expanded in x around 0 78.7%
*-commutative78.7%
associate-*r/81.1%
neg-mul-181.1%
distribute-rgt-neg-in81.1%
distribute-frac-neg81.1%
Simplified81.1%
if 9.999999999999999e-94 < (*.f64 x y) < 5.0000000000000002e-27Initial program 95.1%
Taylor expanded in y around inf 90.8%
mul-1-neg90.8%
unsub-neg90.8%
associate-/l*86.3%
Simplified86.3%
Taylor expanded in x around inf 65.3%
Final simplification75.4%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (/ (- z) a))) (t_2 (* y (/ x a))))
(if (<= (* x y) -2e-39)
t_2
(if (<= (* x y) 1e-93)
t_1
(if (<= (* x y) 5e-27)
(/ (* x y) a)
(if (<= (* x y) 2000000000.0) t_1 t_2))))))assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = t * (-z / a);
double t_2 = y * (x / a);
double tmp;
if ((x * y) <= -2e-39) {
tmp = t_2;
} else if ((x * y) <= 1e-93) {
tmp = t_1;
} else if ((x * y) <= 5e-27) {
tmp = (x * y) / a;
} else if ((x * y) <= 2000000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, and a 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 * (-z / a)
t_2 = y * (x / a)
if ((x * y) <= (-2d-39)) then
tmp = t_2
else if ((x * y) <= 1d-93) then
tmp = t_1
else if ((x * y) <= 5d-27) then
tmp = (x * y) / a
else if ((x * y) <= 2000000000.0d0) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t * (-z / a);
double t_2 = y * (x / a);
double tmp;
if ((x * y) <= -2e-39) {
tmp = t_2;
} else if ((x * y) <= 1e-93) {
tmp = t_1;
} else if ((x * y) <= 5e-27) {
tmp = (x * y) / a;
} else if ((x * y) <= 2000000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): t_1 = t * (-z / a) t_2 = y * (x / a) tmp = 0 if (x * y) <= -2e-39: tmp = t_2 elif (x * y) <= 1e-93: tmp = t_1 elif (x * y) <= 5e-27: tmp = (x * y) / a elif (x * y) <= 2000000000.0: tmp = t_1 else: tmp = t_2 return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) t_1 = Float64(t * Float64(Float64(-z) / a)) t_2 = Float64(y * Float64(x / a)) tmp = 0.0 if (Float64(x * y) <= -2e-39) tmp = t_2; elseif (Float64(x * y) <= 1e-93) tmp = t_1; elseif (Float64(x * y) <= 5e-27) tmp = Float64(Float64(x * y) / a); elseif (Float64(x * y) <= 2000000000.0) tmp = t_1; else tmp = t_2; end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = t * (-z / a);
t_2 = y * (x / a);
tmp = 0.0;
if ((x * y) <= -2e-39)
tmp = t_2;
elseif ((x * y) <= 1e-93)
tmp = t_1;
elseif ((x * y) <= 5e-27)
tmp = (x * y) / a;
elseif ((x * y) <= 2000000000.0)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[((-z) / a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e-39], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 1e-93], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-27], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2000000000.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := t \cdot \frac{-z}{a}\\
t_2 := y \cdot \frac{x}{a}\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{-39}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 10^{-93}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-27}:\\
\;\;\;\;\frac{x \cdot y}{a}\\
\mathbf{elif}\;x \cdot y \leq 2000000000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -1.99999999999999986e-39 or 2e9 < (*.f64 x y) Initial program 87.8%
Taylor expanded in x around inf 71.5%
associate-*r/78.5%
Simplified78.5%
clear-num78.4%
un-div-inv79.2%
Applied egg-rr79.2%
associate-/r/71.4%
Applied egg-rr71.4%
if -1.99999999999999986e-39 < (*.f64 x y) < 9.999999999999999e-94 or 5.0000000000000002e-27 < (*.f64 x y) < 2e9Initial program 95.7%
Taylor expanded in x around 0 78.7%
mul-1-neg78.7%
associate-/l*77.2%
distribute-rgt-neg-in77.2%
distribute-neg-frac277.2%
Simplified77.2%
if 9.999999999999999e-94 < (*.f64 x y) < 5.0000000000000002e-27Initial program 95.1%
Taylor expanded in y around inf 90.8%
mul-1-neg90.8%
unsub-neg90.8%
associate-/l*86.3%
Simplified86.3%
Taylor expanded in x around inf 65.3%
Final simplification73.6%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* x y) -2e+147) (* x (/ (- y (/ (* z t) x)) a)) (if (<= (* x y) 5e+179) (/ (- (* x y) (* z t)) a) (* y (/ x a)))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -2e+147) {
tmp = x * ((y - ((z * t) / x)) / a);
} else if ((x * y) <= 5e+179) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = y * (x / a);
}
return tmp;
}
NOTE: x, y, z, t, and a 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) <= (-2d+147)) then
tmp = x * ((y - ((z * t) / x)) / a)
else if ((x * y) <= 5d+179) then
tmp = ((x * y) - (z * t)) / a
else
tmp = y * (x / a)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -2e+147) {
tmp = x * ((y - ((z * t) / x)) / a);
} else if ((x * y) <= 5e+179) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = y * (x / a);
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if (x * y) <= -2e+147: tmp = x * ((y - ((z * t) / x)) / a) elif (x * y) <= 5e+179: tmp = ((x * y) - (z * t)) / a else: tmp = y * (x / a) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= -2e+147) tmp = Float64(x * Float64(Float64(y - Float64(Float64(z * t) / x)) / a)); elseif (Float64(x * y) <= 5e+179) tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a); else tmp = Float64(y * Float64(x / a)); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x * y) <= -2e+147)
tmp = x * ((y - ((z * t) / x)) / a);
elseif ((x * y) <= 5e+179)
tmp = ((x * y) - (z * t)) / a;
else
tmp = y * (x / a);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], -2e+147], N[(x * N[(N[(y - N[(N[(z * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+179], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+147}:\\
\;\;\;\;x \cdot \frac{y - \frac{z \cdot t}{x}}{a}\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+179}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{a}\\
\end{array}
\end{array}
if (*.f64 x y) < -2e147Initial program 69.4%
Taylor expanded in x around inf 92.7%
+-commutative92.7%
mul-1-neg92.7%
unsub-neg92.7%
associate-/l*96.3%
Simplified96.3%
Taylor expanded in a around 0 96.3%
if -2e147 < (*.f64 x y) < 5e179Initial program 96.9%
if 5e179 < (*.f64 x y) Initial program 78.3%
Taylor expanded in x around inf 82.2%
associate-*r/93.0%
Simplified93.0%
clear-num92.8%
un-div-inv95.9%
Applied egg-rr95.9%
associate-/r/96.3%
Applied egg-rr96.3%
Final simplification96.7%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* x y) (- INFINITY)) (* x (/ y a)) (if (<= (* x y) 5e+179) (/ (- (* x y) (* z t)) a) (* y (/ x a)))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -((double) INFINITY)) {
tmp = x * (y / a);
} else if ((x * y) <= 5e+179) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = y * (x / a);
}
return tmp;
}
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -Double.POSITIVE_INFINITY) {
tmp = x * (y / a);
} else if ((x * y) <= 5e+179) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = y * (x / a);
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if (x * y) <= -math.inf: tmp = x * (y / a) elif (x * y) <= 5e+179: tmp = ((x * y) - (z * t)) / a else: tmp = y * (x / a) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= Float64(-Inf)) tmp = Float64(x * Float64(y / a)); elseif (Float64(x * y) <= 5e+179) tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a); else tmp = Float64(y * Float64(x / a)); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x * y) <= -Inf)
tmp = x * (y / a);
elseif ((x * y) <= 5e+179)
tmp = ((x * y) - (z * t)) / a;
else
tmp = y * (x / a);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], (-Infinity)], N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+179], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -\infty:\\
\;\;\;\;x \cdot \frac{y}{a}\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+179}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{a}\\
\end{array}
\end{array}
if (*.f64 x y) < -inf.0Initial program 49.6%
Taylor expanded in x around inf 55.5%
associate-*r/93.9%
Simplified93.9%
if -inf.0 < (*.f64 x y) < 5e179Initial program 97.0%
if 5e179 < (*.f64 x y) Initial program 78.3%
Taylor expanded in x around inf 82.2%
associate-*r/93.0%
Simplified93.0%
clear-num92.8%
un-div-inv95.9%
Applied egg-rr95.9%
associate-/r/96.3%
Applied egg-rr96.3%
Final simplification96.7%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= a 3.8e+103) (/ (- (* x y) (* z t)) a) (- (* y (/ x a)) (* z (/ t a)))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 3.8e+103) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = (y * (x / a)) - (z * (t / a));
}
return tmp;
}
NOTE: x, y, z, t, and a 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 <= 3.8d+103) then
tmp = ((x * y) - (z * t)) / a
else
tmp = (y * (x / a)) - (z * (t / a))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 3.8e+103) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = (y * (x / a)) - (z * (t / a));
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if a <= 3.8e+103: tmp = ((x * y) - (z * t)) / a else: tmp = (y * (x / a)) - (z * (t / a)) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (a <= 3.8e+103) tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a); else tmp = Float64(Float64(y * Float64(x / a)) - Float64(z * Float64(t / a))); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (a <= 3.8e+103)
tmp = ((x * y) - (z * t)) / a;
else
tmp = (y * (x / a)) - (z * (t / a));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[a, 3.8e+103], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision] - N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.8 \cdot 10^{+103}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{a} - z \cdot \frac{t}{a}\\
\end{array}
\end{array}
if a < 3.7999999999999997e103Initial program 95.8%
if 3.7999999999999997e103 < a Initial program 71.6%
div-sub71.6%
*-commutative71.6%
associate-/l*83.8%
fma-neg83.8%
associate-/l*93.2%
Applied egg-rr93.2%
fma-undefine93.2%
unsub-neg93.2%
Applied egg-rr93.2%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= x -9.5e+237) (* y (/ x a)) (/ (* x y) a)))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -9.5e+237) {
tmp = y * (x / a);
} else {
tmp = (x * y) / a;
}
return tmp;
}
NOTE: x, y, z, t, and a 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 <= (-9.5d+237)) then
tmp = y * (x / a)
else
tmp = (x * y) / a
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -9.5e+237) {
tmp = y * (x / a);
} else {
tmp = (x * y) / a;
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if x <= -9.5e+237: tmp = y * (x / a) else: tmp = (x * y) / a return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (x <= -9.5e+237) tmp = Float64(y * Float64(x / a)); else tmp = Float64(Float64(x * y) / a); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (x <= -9.5e+237)
tmp = y * (x / a);
else
tmp = (x * y) / a;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[x, -9.5e+237], N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{+237}:\\
\;\;\;\;y \cdot \frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{a}\\
\end{array}
\end{array}
if x < -9.50000000000000061e237Initial program 56.8%
Taylor expanded in x around inf 67.9%
associate-*r/88.7%
Simplified88.7%
clear-num88.5%
un-div-inv88.5%
Applied egg-rr88.5%
associate-/r/88.9%
Applied egg-rr88.9%
if -9.50000000000000061e237 < x Initial program 93.3%
Taylor expanded in y around inf 87.9%
mul-1-neg87.9%
unsub-neg87.9%
associate-/l*83.6%
Simplified83.6%
Taylor expanded in x around inf 50.9%
Final simplification52.2%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= x -2.3e+238) (* y (/ x a)) (/ (* x y) a)))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -2.3e+238) {
tmp = y * (x / a);
} else {
tmp = (x * y) / a;
}
return tmp;
}
NOTE: x, y, z, t, and a 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.3d+238)) then
tmp = y * (x / a)
else
tmp = (x * y) / a
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -2.3e+238) {
tmp = y * (x / a);
} else {
tmp = (x * y) / a;
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if x <= -2.3e+238: tmp = y * (x / a) else: tmp = (x * y) / a return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (x <= -2.3e+238) tmp = Float64(y * Float64(x / a)); else tmp = Float64(Float64(x * y) / a); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (x <= -2.3e+238)
tmp = y * (x / a);
else
tmp = (x * y) / a;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[x, -2.3e+238], N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.3 \cdot 10^{+238}:\\
\;\;\;\;y \cdot \frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{a}\\
\end{array}
\end{array}
if x < -2.30000000000000003e238Initial program 56.8%
Taylor expanded in x around inf 67.9%
associate-*r/88.7%
Simplified88.7%
clear-num88.5%
un-div-inv88.5%
Applied egg-rr88.5%
associate-/r/88.9%
Applied egg-rr88.9%
if -2.30000000000000003e238 < x Initial program 93.3%
Taylor expanded in x around inf 50.9%
Final simplification52.2%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* y (/ x a)))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
return y * (x / a);
}
NOTE: x, y, z, t, and a 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 && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
return y * (x / a);
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): return y * (x / a)
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) return Float64(y * Float64(x / a)) end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp = code(x, y, z, t, a)
tmp = y * (x / a);
end
NOTE: x, y, z, t, and a 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, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
y \cdot \frac{x}{a}
\end{array}
Initial program 92.0%
Taylor expanded in x around inf 51.5%
associate-*r/54.4%
Simplified54.4%
clear-num54.3%
un-div-inv54.7%
Applied egg-rr54.7%
associate-/r/50.2%
Applied egg-rr50.2%
Final simplification50.2%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* x (/ y a)))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
return x * (y / a);
}
NOTE: x, y, z, t, and a 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 && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
return x * (y / a);
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): return x * (y / a)
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) return Float64(x * Float64(y / a)) end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp = code(x, y, z, t, a)
tmp = x * (y / a);
end
NOTE: x, y, z, t, and a 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, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
x \cdot \frac{y}{a}
\end{array}
Initial program 92.0%
Taylor expanded in x around inf 51.5%
associate-*r/54.4%
Simplified54.4%
(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 2024103
(FPCore (x y z t a)
:name "Data.Colour.Matrix:inverse from colour-2.3.3, B"
:precision binary64
:alt
(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))