
(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, 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) (* t z))))
(if (<= t_1 (- INFINITY))
(fma (/ x a) y (* (/ (- z) a) t))
(if (<= t_1 2e+196) (/ t_1 a) (fma (/ x a) y (/ (- 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 t_1 = (y * x) - (t * z);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = fma((x / a), y, ((-z / a) * t));
} else if (t_1 <= 2e+196) {
tmp = t_1 / a;
} else {
tmp = fma((x / a), y, (-t / (a / z)));
}
return tmp;
}
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) t_1 = Float64(Float64(y * x) - Float64(t * z)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = fma(Float64(x / a), y, Float64(Float64(Float64(-z) / a) * t)); elseif (t_1 <= 2e+196) tmp = Float64(t_1 / a); else tmp = fma(Float64(x / a), y, Float64(Float64(-t) / Float64(a / 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_] := Block[{t$95$1 = N[(N[(y * x), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(x / a), $MachinePrecision] * y + N[(N[((-z) / a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+196], N[(t$95$1 / a), $MachinePrecision], N[(N[(x / a), $MachinePrecision] * y + N[((-t) / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := y \cdot x - t \cdot z\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{a}, y, \frac{-z}{a} \cdot t\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+196}:\\
\;\;\;\;\frac{t\_1}{a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{a}, y, \frac{-t}{\frac{a}{z}}\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0Initial program 75.7%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
sub-negN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64100.0
Applied rewrites100.0%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 1.9999999999999999e196Initial program 98.1%
if 1.9999999999999999e196 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 70.7%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
sub-negN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6493.3
Applied rewrites93.3%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6493.3
Applied rewrites93.3%
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
(let* ((t_1 (* (/ (- z) a) t)) (t_2 (- (* y x) (* t z))))
(if (<= t_2 (- INFINITY))
(fma (/ x a) y t_1)
(if (<= t_2 1e+305) (/ t_2 a) (fma (/ y a) x 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 = (-z / a) * t;
double t_2 = (y * x) - (t * z);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = fma((x / a), y, t_1);
} else if (t_2 <= 1e+305) {
tmp = t_2 / a;
} else {
tmp = fma((y / a), x, 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(Float64(Float64(-z) / a) * t) t_2 = Float64(Float64(y * x) - Float64(t * z)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = fma(Float64(x / a), y, t_1); elseif (t_2 <= 1e+305) tmp = Float64(t_2 / a); else tmp = fma(Float64(y / a), x, t_1); 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_] := Block[{t$95$1 = N[(N[((-z) / a), $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * x), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(x / a), $MachinePrecision] * y + t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 1e+305], N[(t$95$2 / a), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * x + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := \frac{-z}{a} \cdot t\\
t_2 := y \cdot x - t \cdot z\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{a}, y, t\_1\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+305}:\\
\;\;\;\;\frac{t\_2}{a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, x, t\_1\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0Initial program 75.7%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
sub-negN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64100.0
Applied rewrites100.0%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 9.9999999999999994e304Initial program 98.3%
if 9.9999999999999994e304 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 44.3%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
sub-negN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6490.4
Applied rewrites90.4%
Final simplification97.5%
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 (fma (/ x a) y (* (/ (- z) a) t))) (t_2 (- (* y x) (* t z)))) (if (<= t_2 (- INFINITY)) t_1 (if (<= t_2 2e+249) (/ t_2 a) 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 = fma((x / a), y, ((-z / a) * t));
double t_2 = (y * x) - (t * z);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= 2e+249) {
tmp = t_2 / a;
} 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 = fma(Float64(x / a), y, Float64(Float64(Float64(-z) / a) * t)) t_2 = Float64(Float64(y * x) - Float64(t * z)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= 2e+249) tmp = Float64(t_2 / a); else tmp = t_1; 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_] := Block[{t$95$1 = N[(N[(x / a), $MachinePrecision] * y + N[(N[((-z) / a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * x), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, 2e+249], N[(t$95$2 / a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{x}{a}, y, \frac{-z}{a} \cdot t\right)\\
t_2 := y \cdot x - t \cdot z\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+249}:\\
\;\;\;\;\frac{t\_2}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0 or 1.9999999999999998e249 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 66.1%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
sub-negN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6495.5
Applied rewrites95.5%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 1.9999999999999998e249Initial program 98.2%
Final simplification97.5%
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 (<= (* t z) -2e+287)
(* (/ (- t) a) z)
(if (<= (* t z) 5e+256)
(/ (- (* y x) (* t z)) a)
(fma (- 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 ((t * z) <= -2e+287) {
tmp = (-t / a) * z;
} else if ((t * z) <= 5e+256) {
tmp = ((y * x) - (t * z)) / a;
} else {
tmp = fma(-z, (t / a), ((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(t * z) <= -2e+287) tmp = Float64(Float64(Float64(-t) / a) * z); elseif (Float64(t * z) <= 5e+256) tmp = Float64(Float64(Float64(y * x) - Float64(t * z)) / a); else tmp = fma(Float64(-z), Float64(t / a), Float64(Float64(y * x) / 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[N[(t * z), $MachinePrecision], -2e+287], N[(N[((-t) / a), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[N[(t * z), $MachinePrecision], 5e+256], N[(N[(N[(y * x), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[((-z) * N[(t / a), $MachinePrecision] + N[(N[(y * x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;t \cdot z \leq -2 \cdot 10^{+287}:\\
\;\;\;\;\frac{-t}{a} \cdot z\\
\mathbf{elif}\;t \cdot z \leq 5 \cdot 10^{+256}:\\
\;\;\;\;\frac{y \cdot x - t \cdot z}{a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-z, \frac{t}{a}, \frac{y \cdot x}{a}\right)\\
\end{array}
\end{array}
if (*.f64 z t) < -2.0000000000000002e287Initial program 49.3%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f6410.5
Applied rewrites10.5%
Taylor expanded in t around inf
associate-*l/N/A
associate-*l*N/A
lower-*.f64N/A
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6495.8
Applied rewrites95.8%
if -2.0000000000000002e287 < (*.f64 z t) < 5.00000000000000015e256Initial program 95.8%
if 5.00000000000000015e256 < (*.f64 z t) Initial program 72.6%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-/.f6499.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.9
Applied rewrites99.9%
Final simplification96.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 (<= (* y x) -2e-49)
(* (/ y a) x)
(if (<= (* y x) 1e-109)
(* (/ (- t) a) z)
(if (<= (* y x) 1e+159) (/ (* y x) a) (/ y (/ a x))))))assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y * x) <= -2e-49) {
tmp = (y / a) * x;
} else if ((y * x) <= 1e-109) {
tmp = (-t / a) * z;
} else if ((y * x) <= 1e+159) {
tmp = (y * x) / a;
} else {
tmp = y / (a / x);
}
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 ((y * x) <= (-2d-49)) then
tmp = (y / a) * x
else if ((y * x) <= 1d-109) then
tmp = (-t / a) * z
else if ((y * x) <= 1d+159) then
tmp = (y * x) / a
else
tmp = y / (a / x)
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 ((y * x) <= -2e-49) {
tmp = (y / a) * x;
} else if ((y * x) <= 1e-109) {
tmp = (-t / a) * z;
} else if ((y * x) <= 1e+159) {
tmp = (y * x) / a;
} else {
tmp = y / (a / x);
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if (y * x) <= -2e-49: tmp = (y / a) * x elif (y * x) <= 1e-109: tmp = (-t / a) * z elif (y * x) <= 1e+159: tmp = (y * x) / a else: tmp = y / (a / x) 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(y * x) <= -2e-49) tmp = Float64(Float64(y / a) * x); elseif (Float64(y * x) <= 1e-109) tmp = Float64(Float64(Float64(-t) / a) * z); elseif (Float64(y * x) <= 1e+159) tmp = Float64(Float64(y * x) / a); else tmp = Float64(y / Float64(a / x)); 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 ((y * x) <= -2e-49)
tmp = (y / a) * x;
elseif ((y * x) <= 1e-109)
tmp = (-t / a) * z;
elseif ((y * x) <= 1e+159)
tmp = (y * x) / a;
else
tmp = y / (a / x);
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[(y * x), $MachinePrecision], -2e-49], N[(N[(y / a), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[N[(y * x), $MachinePrecision], 1e-109], N[(N[((-t) / a), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[N[(y * x), $MachinePrecision], 1e+159], N[(N[(y * x), $MachinePrecision] / a), $MachinePrecision], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;y \cdot x \leq -2 \cdot 10^{-49}:\\
\;\;\;\;\frac{y}{a} \cdot x\\
\mathbf{elif}\;y \cdot x \leq 10^{-109}:\\
\;\;\;\;\frac{-t}{a} \cdot z\\
\mathbf{elif}\;y \cdot x \leq 10^{+159}:\\
\;\;\;\;\frac{y \cdot x}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\end{array}
\end{array}
if (*.f64 x y) < -1.99999999999999987e-49Initial program 92.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f6476.7
Applied rewrites76.7%
Taylor expanded in t around 0
associate-*l/N/A
lower-*.f64N/A
lower-/.f6477.0
Applied rewrites77.0%
Taylor expanded in t around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f6472.1
Applied rewrites72.1%
if -1.99999999999999987e-49 < (*.f64 x y) < 9.9999999999999999e-110Initial program 89.9%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f6424.2
Applied rewrites24.2%
Taylor expanded in t around inf
associate-*l/N/A
associate-*l*N/A
lower-*.f64N/A
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6481.3
Applied rewrites81.3%
if 9.9999999999999999e-110 < (*.f64 x y) < 9.9999999999999993e158Initial program 96.1%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f6464.9
Applied rewrites64.9%
if 9.9999999999999993e158 < (*.f64 x y) Initial program 77.3%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f6481.5
Applied rewrites81.5%
Taylor expanded in t around 0
associate-*l/N/A
lower-*.f64N/A
lower-/.f6489.5
Applied rewrites89.5%
Applied rewrites89.5%
Final simplification77.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 (<= (* y x) -2e-49)
(* (/ y a) x)
(if (<= (* y x) 1e-109)
(* (/ (- t) a) z)
(if (<= (* y x) 1e+159) (/ (* y x) a) (* (/ x a) y)))))assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y * x) <= -2e-49) {
tmp = (y / a) * x;
} else if ((y * x) <= 1e-109) {
tmp = (-t / a) * z;
} else if ((y * x) <= 1e+159) {
tmp = (y * x) / a;
} else {
tmp = (x / a) * y;
}
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 ((y * x) <= (-2d-49)) then
tmp = (y / a) * x
else if ((y * x) <= 1d-109) then
tmp = (-t / a) * z
else if ((y * x) <= 1d+159) then
tmp = (y * x) / a
else
tmp = (x / a) * y
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 ((y * x) <= -2e-49) {
tmp = (y / a) * x;
} else if ((y * x) <= 1e-109) {
tmp = (-t / a) * z;
} else if ((y * x) <= 1e+159) {
tmp = (y * x) / a;
} else {
tmp = (x / a) * y;
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if (y * x) <= -2e-49: tmp = (y / a) * x elif (y * x) <= 1e-109: tmp = (-t / a) * z elif (y * x) <= 1e+159: tmp = (y * x) / a else: tmp = (x / a) * y 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(y * x) <= -2e-49) tmp = Float64(Float64(y / a) * x); elseif (Float64(y * x) <= 1e-109) tmp = Float64(Float64(Float64(-t) / a) * z); elseif (Float64(y * x) <= 1e+159) tmp = Float64(Float64(y * x) / a); else tmp = Float64(Float64(x / a) * y); 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 ((y * x) <= -2e-49)
tmp = (y / a) * x;
elseif ((y * x) <= 1e-109)
tmp = (-t / a) * z;
elseif ((y * x) <= 1e+159)
tmp = (y * x) / a;
else
tmp = (x / a) * y;
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[(y * x), $MachinePrecision], -2e-49], N[(N[(y / a), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[N[(y * x), $MachinePrecision], 1e-109], N[(N[((-t) / a), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[N[(y * x), $MachinePrecision], 1e+159], N[(N[(y * x), $MachinePrecision] / a), $MachinePrecision], N[(N[(x / a), $MachinePrecision] * y), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;y \cdot x \leq -2 \cdot 10^{-49}:\\
\;\;\;\;\frac{y}{a} \cdot x\\
\mathbf{elif}\;y \cdot x \leq 10^{-109}:\\
\;\;\;\;\frac{-t}{a} \cdot z\\
\mathbf{elif}\;y \cdot x \leq 10^{+159}:\\
\;\;\;\;\frac{y \cdot x}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a} \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.99999999999999987e-49Initial program 92.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f6476.7
Applied rewrites76.7%
Taylor expanded in t around 0
associate-*l/N/A
lower-*.f64N/A
lower-/.f6477.0
Applied rewrites77.0%
Taylor expanded in t around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f6472.1
Applied rewrites72.1%
if -1.99999999999999987e-49 < (*.f64 x y) < 9.9999999999999999e-110Initial program 89.9%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f6424.2
Applied rewrites24.2%
Taylor expanded in t around inf
associate-*l/N/A
associate-*l*N/A
lower-*.f64N/A
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6481.3
Applied rewrites81.3%
if 9.9999999999999999e-110 < (*.f64 x y) < 9.9999999999999993e158Initial program 96.1%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f6464.9
Applied rewrites64.9%
if 9.9999999999999993e158 < (*.f64 x y) Initial program 77.3%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f6481.5
Applied rewrites81.5%
Taylor expanded in t around 0
associate-*l/N/A
lower-*.f64N/A
lower-/.f6489.5
Applied rewrites89.5%
Final simplification77.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 (<= (* y x) -2e-49)
(* (/ y a) x)
(if (<= (* y x) 1e-109)
(* (/ (- z) a) t)
(if (<= (* y x) 1e+159) (/ (* y x) a) (* (/ x a) y)))))assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y * x) <= -2e-49) {
tmp = (y / a) * x;
} else if ((y * x) <= 1e-109) {
tmp = (-z / a) * t;
} else if ((y * x) <= 1e+159) {
tmp = (y * x) / a;
} else {
tmp = (x / a) * y;
}
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 ((y * x) <= (-2d-49)) then
tmp = (y / a) * x
else if ((y * x) <= 1d-109) then
tmp = (-z / a) * t
else if ((y * x) <= 1d+159) then
tmp = (y * x) / a
else
tmp = (x / a) * y
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 ((y * x) <= -2e-49) {
tmp = (y / a) * x;
} else if ((y * x) <= 1e-109) {
tmp = (-z / a) * t;
} else if ((y * x) <= 1e+159) {
tmp = (y * x) / a;
} else {
tmp = (x / a) * y;
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if (y * x) <= -2e-49: tmp = (y / a) * x elif (y * x) <= 1e-109: tmp = (-z / a) * t elif (y * x) <= 1e+159: tmp = (y * x) / a else: tmp = (x / a) * y 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(y * x) <= -2e-49) tmp = Float64(Float64(y / a) * x); elseif (Float64(y * x) <= 1e-109) tmp = Float64(Float64(Float64(-z) / a) * t); elseif (Float64(y * x) <= 1e+159) tmp = Float64(Float64(y * x) / a); else tmp = Float64(Float64(x / a) * y); 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 ((y * x) <= -2e-49)
tmp = (y / a) * x;
elseif ((y * x) <= 1e-109)
tmp = (-z / a) * t;
elseif ((y * x) <= 1e+159)
tmp = (y * x) / a;
else
tmp = (x / a) * y;
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[(y * x), $MachinePrecision], -2e-49], N[(N[(y / a), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[N[(y * x), $MachinePrecision], 1e-109], N[(N[((-z) / a), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[N[(y * x), $MachinePrecision], 1e+159], N[(N[(y * x), $MachinePrecision] / a), $MachinePrecision], N[(N[(x / a), $MachinePrecision] * y), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;y \cdot x \leq -2 \cdot 10^{-49}:\\
\;\;\;\;\frac{y}{a} \cdot x\\
\mathbf{elif}\;y \cdot x \leq 10^{-109}:\\
\;\;\;\;\frac{-z}{a} \cdot t\\
\mathbf{elif}\;y \cdot x \leq 10^{+159}:\\
\;\;\;\;\frac{y \cdot x}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a} \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.99999999999999987e-49Initial program 92.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f6476.7
Applied rewrites76.7%
Taylor expanded in t around 0
associate-*l/N/A
lower-*.f64N/A
lower-/.f6477.0
Applied rewrites77.0%
Taylor expanded in t around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f6472.1
Applied rewrites72.1%
if -1.99999999999999987e-49 < (*.f64 x y) < 9.9999999999999999e-110Initial program 89.9%
Taylor expanded in t around inf
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f6479.1
Applied rewrites79.1%
if 9.9999999999999999e-110 < (*.f64 x y) < 9.9999999999999993e158Initial program 96.1%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f6464.9
Applied rewrites64.9%
if 9.9999999999999993e158 < (*.f64 x y) Initial program 77.3%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f6481.5
Applied rewrites81.5%
Taylor expanded in t around 0
associate-*l/N/A
lower-*.f64N/A
lower-/.f6489.5
Applied rewrites89.5%
Final simplification76.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 (if (<= (* t z) -2e+287) (* (/ (- t) a) z) (/ 1.0 (/ a (fma (- t) z (* y x))))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t * z) <= -2e+287) {
tmp = (-t / a) * z;
} else {
tmp = 1.0 / (a / fma(-t, z, (y * x)));
}
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(t * z) <= -2e+287) tmp = Float64(Float64(Float64(-t) / a) * z); else tmp = Float64(1.0 / Float64(a / fma(Float64(-t), z, Float64(y * x)))); 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[N[(t * z), $MachinePrecision], -2e+287], N[(N[((-t) / a), $MachinePrecision] * z), $MachinePrecision], N[(1.0 / N[(a / N[((-t) * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;t \cdot z \leq -2 \cdot 10^{+287}:\\
\;\;\;\;\frac{-t}{a} \cdot z\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{a}{\mathsf{fma}\left(-t, z, y \cdot x\right)}}\\
\end{array}
\end{array}
if (*.f64 z t) < -2.0000000000000002e287Initial program 49.3%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f6410.5
Applied rewrites10.5%
Taylor expanded in t around inf
associate-*l/N/A
associate-*l*N/A
lower-*.f64N/A
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6495.8
Applied rewrites95.8%
if -2.0000000000000002e287 < (*.f64 z t) Initial program 93.7%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6493.0
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f6493.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6493.9
Applied rewrites93.9%
Final simplification94.0%
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 (<= (/ (- (* y x) (* t z)) a) 1e+286) (/ (* y x) a) (* (/ y a) x)))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((((y * x) - (t * z)) / a) <= 1e+286) {
tmp = (y * x) / a;
} else {
tmp = (y / a) * x;
}
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 ((((y * x) - (t * z)) / a) <= 1d+286) then
tmp = (y * x) / a
else
tmp = (y / a) * x
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 ((((y * x) - (t * z)) / a) <= 1e+286) {
tmp = (y * x) / a;
} else {
tmp = (y / a) * x;
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if (((y * x) - (t * z)) / a) <= 1e+286: tmp = (y * x) / a else: tmp = (y / a) * x 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(Float64(Float64(y * x) - Float64(t * z)) / a) <= 1e+286) tmp = Float64(Float64(y * x) / a); else tmp = Float64(Float64(y / a) * x); 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 ((((y * x) - (t * z)) / a) <= 1e+286)
tmp = (y * x) / a;
else
tmp = (y / a) * x;
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[(N[(N[(y * x), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], 1e+286], N[(N[(y * x), $MachinePrecision] / a), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{y \cdot x - t \cdot z}{a} \leq 10^{+286}:\\
\;\;\;\;\frac{y \cdot x}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} \cdot x\\
\end{array}
\end{array}
if (/.f64 (-.f64 (*.f64 x y) (*.f64 z t)) a) < 1.00000000000000003e286Initial program 93.2%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f6456.4
Applied rewrites56.4%
if 1.00000000000000003e286 < (/.f64 (-.f64 (*.f64 x y) (*.f64 z t)) a) Initial program 72.1%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f6454.1
Applied rewrites54.1%
Taylor expanded in t around 0
associate-*l/N/A
lower-*.f64N/A
lower-/.f6466.5
Applied rewrites66.5%
Taylor expanded in t around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f6462.4
Applied rewrites62.4%
Final simplification57.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 (if (<= (* t z) -2e+287) (* (/ (- t) a) z) (/ (- (* y x) (* t z)) 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 ((t * z) <= -2e+287) {
tmp = (-t / a) * z;
} else {
tmp = ((y * x) - (t * z)) / 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 ((t * z) <= (-2d+287)) then
tmp = (-t / a) * z
else
tmp = ((y * x) - (t * z)) / 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 ((t * z) <= -2e+287) {
tmp = (-t / a) * z;
} else {
tmp = ((y * x) - (t * z)) / a;
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if (t * z) <= -2e+287: tmp = (-t / a) * z else: tmp = ((y * x) - (t * z)) / 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(t * z) <= -2e+287) tmp = Float64(Float64(Float64(-t) / a) * z); else tmp = Float64(Float64(Float64(y * x) - Float64(t * z)) / 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 ((t * z) <= -2e+287)
tmp = (-t / a) * z;
else
tmp = ((y * x) - (t * z)) / 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[(t * z), $MachinePrecision], -2e+287], N[(N[((-t) / a), $MachinePrecision] * z), $MachinePrecision], N[(N[(N[(y * x), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;t \cdot z \leq -2 \cdot 10^{+287}:\\
\;\;\;\;\frac{-t}{a} \cdot z\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x - t \cdot z}{a}\\
\end{array}
\end{array}
if (*.f64 z t) < -2.0000000000000002e287Initial program 49.3%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f6410.5
Applied rewrites10.5%
Taylor expanded in t around inf
associate-*l/N/A
associate-*l*N/A
lower-*.f64N/A
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6495.8
Applied rewrites95.8%
if -2.0000000000000002e287 < (*.f64 z t) Initial program 93.7%
Final simplification93.9%
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 a) x))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
return (y / a) * x;
}
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 / a) * x
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 / a) * x;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): return (y / a) * x
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) return Float64(Float64(y / a) * x) end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp = code(x, y, z, t, a)
tmp = (y / a) * x;
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[(N[(y / a), $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\frac{y}{a} \cdot x
\end{array}
Initial program 89.6%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f6456.0
Applied rewrites56.0%
Taylor expanded in t around 0
associate-*l/N/A
lower-*.f64N/A
lower-/.f6456.3
Applied rewrites56.3%
Taylor expanded in t around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f6455.1
Applied rewrites55.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 (* (/ x a) y))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
return (x / a) * y;
}
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 / a) * y
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 / a) * y;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): return (x / a) * y
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) return Float64(Float64(x / a) * y) end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp = code(x, y, z, t, a)
tmp = (x / a) * y;
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[(N[(x / a), $MachinePrecision] * y), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\frac{x}{a} \cdot y
\end{array}
Initial program 89.6%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f6456.0
Applied rewrites56.0%
Taylor expanded in t around 0
associate-*l/N/A
lower-*.f64N/A
lower-/.f6456.3
Applied rewrites56.3%
(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 2024243
(FPCore (x y z t a)
:name "Data.Colour.Matrix:inverse from colour-2.3.3, B"
:precision binary64
:alt
(! :herbie-platform default (if (< z -246868496869954800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (* (/ y a) x) (* (/ t a) z)) (if (< z 6309831121978371/100000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (- (* x y) (* z t)) a) (- (* (/ y a) x) (* (/ t a) z)))))
(/ (- (* x y) (* z t)) a))