
(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 11 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 (or (<= t_1 -5e+274) (not (<= t_1 1e+288)))
(fma -1.0 (/ t (/ a z)) (/ y (/ a x)))
(/ 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+274) || !(t_1 <= 1e+288)) {
tmp = fma(-1.0, (t / (a / z)), (y / (a / x)));
} 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+274) || !(t_1 <= 1e+288)) tmp = fma(-1.0, Float64(t / Float64(a / z)), Float64(y / Float64(a / x))); else tmp = Float64(t_1 / 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+274], N[Not[LessEqual[t$95$1, 1e+288]], $MachinePrecision]], N[(-1.0 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision] + N[(y / N[(a / x), $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^{+274} \lor \neg \left(t_1 \leq 10^{+288}\right):\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{t}{\frac{a}{z}}, \frac{y}{\frac{a}{x}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1}{a}\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -4.9999999999999998e274 or 1e288 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 73.3%
Taylor expanded in x around 0 71.8%
fma-def71.8%
associate-/l*82.3%
associate-/l*94.3%
Simplified94.3%
if -4.9999999999999998e274 < (-.f64 (*.f64 x y) (*.f64 z t)) < 1e288Initial program 98.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
(if (<= (* x y) -2e-44)
(/ x (/ a y))
(if (<= (* x y) 2e-133)
(/ (- t) (/ a z))
(if (<= (* x y) 5e+59)
(/ (* x y) a)
(if (<= (* x y) 1e+130) (- (* (/ t a) z)) (* 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 * y) <= -2e-44) {
tmp = x / (a / y);
} else if ((x * y) <= 2e-133) {
tmp = -t / (a / z);
} else if ((x * y) <= 5e+59) {
tmp = (x * y) / a;
} else if ((x * y) <= 1e+130) {
tmp = -((t / a) * z);
} 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 * y) <= (-2d-44)) then
tmp = x / (a / y)
else if ((x * y) <= 2d-133) then
tmp = -t / (a / z)
else if ((x * y) <= 5d+59) then
tmp = (x * y) / a
else if ((x * y) <= 1d+130) then
tmp = -((t / a) * z)
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 * y) <= -2e-44) {
tmp = x / (a / y);
} else if ((x * y) <= 2e-133) {
tmp = -t / (a / z);
} else if ((x * y) <= 5e+59) {
tmp = (x * y) / a;
} else if ((x * y) <= 1e+130) {
tmp = -((t / a) * z);
} 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 * y) <= -2e-44: tmp = x / (a / y) elif (x * y) <= 2e-133: tmp = -t / (a / z) elif (x * y) <= 5e+59: tmp = (x * y) / a elif (x * y) <= 1e+130: tmp = -((t / a) * z) 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 (Float64(x * y) <= -2e-44) tmp = Float64(x / Float64(a / y)); elseif (Float64(x * y) <= 2e-133) tmp = Float64(Float64(-t) / Float64(a / z)); elseif (Float64(x * y) <= 5e+59) tmp = Float64(Float64(x * y) / a); elseif (Float64(x * y) <= 1e+130) tmp = Float64(-Float64(Float64(t / a) * z)); 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 * y) <= -2e-44)
tmp = x / (a / y);
elseif ((x * y) <= 2e-133)
tmp = -t / (a / z);
elseif ((x * y) <= 5e+59)
tmp = (x * y) / a;
elseif ((x * y) <= 1e+130)
tmp = -((t / a) * z);
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[N[(x * y), $MachinePrecision], -2e-44], N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e-133], N[((-t) / N[(a / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+59], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+130], (-N[(N[(t / a), $MachinePrecision] * z), $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 \cdot y \leq -2 \cdot 10^{-44}:\\
\;\;\;\;\frac{x}{\frac{a}{y}}\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-133}:\\
\;\;\;\;\frac{-t}{\frac{a}{z}}\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+59}:\\
\;\;\;\;\frac{x \cdot y}{a}\\
\mathbf{elif}\;x \cdot y \leq 10^{+130}:\\
\;\;\;\;-\frac{t}{a} \cdot z\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{a}\\
\end{array}
\end{array}
if (*.f64 x y) < -1.99999999999999991e-44Initial program 90.4%
Taylor expanded in x around inf 69.9%
associate-*r/74.2%
Simplified74.2%
associate-*r/69.9%
*-commutative69.9%
associate-/l*71.3%
Applied egg-rr71.3%
if -1.99999999999999991e-44 < (*.f64 x y) < 2.0000000000000001e-133Initial program 90.5%
div-inv90.4%
fma-neg90.4%
*-commutative90.4%
distribute-rgt-neg-in90.4%
Applied egg-rr90.4%
Taylor expanded in x around 0 90.4%
mul-1-neg90.4%
+-commutative90.4%
fma-def90.4%
fma-neg90.4%
Simplified90.4%
Taylor expanded in y around 0 79.2%
mul-1-neg79.2%
associate-/l*84.2%
distribute-neg-frac84.2%
Simplified84.2%
if 2.0000000000000001e-133 < (*.f64 x y) < 4.9999999999999997e59Initial program 96.8%
Taylor expanded in x around inf 65.5%
if 4.9999999999999997e59 < (*.f64 x y) < 1.0000000000000001e130Initial program 89.1%
div-inv89.3%
fma-neg89.3%
*-commutative89.3%
distribute-rgt-neg-in89.3%
Applied egg-rr89.3%
Taylor expanded in x around 0 89.3%
mul-1-neg89.3%
+-commutative89.3%
fma-def89.3%
fma-neg89.3%
Simplified89.3%
Taylor expanded in y around 0 63.6%
associate-*r/63.6%
associate-*r*63.6%
neg-mul-163.6%
*-commutative63.6%
*-rgt-identity63.6%
associate-*r/63.6%
associate-*l*74.0%
associate-*r/74.2%
*-rgt-identity74.2%
Simplified74.2%
if 1.0000000000000001e130 < (*.f64 x y) Initial program 92.0%
Taylor expanded in x around inf 82.7%
associate-*r/84.5%
Simplified84.5%
Final simplification77.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 (let* ((t_1 (/ (- (* x y) (* z t)) a))) (if (<= t_1 5e+261) t_1 (- (* y (/ x a)) (/ t (/ a z))))))
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)) / a;
double tmp;
if (t_1 <= 5e+261) {
tmp = t_1;
} else {
tmp = (y * (x / a)) - (t / (a / z));
}
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)) / a
if (t_1 <= 5d+261) then
tmp = t_1
else
tmp = (y * (x / a)) - (t / (a / z))
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)) / a;
double tmp;
if (t_1 <= 5e+261) {
tmp = t_1;
} else {
tmp = (y * (x / a)) - (t / (a / z));
}
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)) / a tmp = 0 if t_1 <= 5e+261: tmp = t_1 else: tmp = (y * (x / a)) - (t / (a / z)) return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(x * y) - Float64(z * t)) / a) tmp = 0.0 if (t_1 <= 5e+261) tmp = t_1; else tmp = Float64(Float64(y * Float64(x / a)) - Float64(t / Float64(a / z))); 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)) / a;
tmp = 0.0;
if (t_1 <= 5e+261)
tmp = t_1;
else
tmp = (y * (x / a)) - (t / (a / z));
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[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+261], t$95$1, N[(N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision] - N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x \cdot y - z \cdot t}{a}\\
\mathbf{if}\;t_1 \leq 5 \cdot 10^{+261}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{a} - \frac{t}{\frac{a}{z}}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (*.f64 x y) (*.f64 z t)) a) < 5.0000000000000001e261Initial program 95.1%
if 5.0000000000000001e261 < (/.f64 (-.f64 (*.f64 x y) (*.f64 z t)) a) Initial program 76.7%
div-inv76.6%
fma-neg80.7%
*-commutative80.7%
distribute-rgt-neg-in80.7%
Applied egg-rr80.7%
Taylor expanded in x around 0 76.6%
mul-1-neg76.6%
+-commutative76.6%
fma-def80.7%
fma-neg76.6%
Simplified76.6%
un-div-inv76.7%
div-sub76.7%
associate-*l/84.5%
associate-/r/84.4%
div-inv84.4%
clear-num84.5%
associate-/l*89.8%
Applied egg-rr89.8%
Final simplification94.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 (if (<= (* z t) (- INFINITY)) (- (* (/ t a) z)) (if (<= (* z t) 5e+279) (/ (- (* x y) (* z t)) a) (/ (- t) (/ a z)))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z * t) <= -((double) INFINITY)) {
tmp = -((t / a) * z);
} else if ((z * t) <= 5e+279) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = -t / (a / z);
}
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 ((z * t) <= -Double.POSITIVE_INFINITY) {
tmp = -((t / a) * z);
} else if ((z * t) <= 5e+279) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = -t / (a / z);
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if (z * t) <= -math.inf: tmp = -((t / a) * z) elif (z * t) <= 5e+279: tmp = ((x * y) - (z * t)) / a else: tmp = -t / (a / z) return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(z * t) <= Float64(-Inf)) tmp = Float64(-Float64(Float64(t / a) * z)); elseif (Float64(z * t) <= 5e+279) tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a); else tmp = Float64(Float64(-t) / Float64(a / z)); 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 ((z * t) <= -Inf)
tmp = -((t / a) * z);
elseif ((z * t) <= 5e+279)
tmp = ((x * y) - (z * t)) / a;
else
tmp = -t / (a / z);
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[(z * t), $MachinePrecision], (-Infinity)], (-N[(N[(t / a), $MachinePrecision] * z), $MachinePrecision]), If[LessEqual[N[(z * t), $MachinePrecision], 5e+279], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[((-t) / N[(a / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -\infty:\\
\;\;\;\;-\frac{t}{a} \cdot z\\
\mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+279}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-t}{\frac{a}{z}}\\
\end{array}
\end{array}
if (*.f64 z t) < -inf.0Initial program 63.3%
div-inv63.3%
fma-neg68.9%
*-commutative68.9%
distribute-rgt-neg-in68.9%
Applied egg-rr68.9%
Taylor expanded in x around 0 63.3%
mul-1-neg63.3%
+-commutative63.3%
fma-def68.9%
fma-neg63.3%
Simplified63.3%
Taylor expanded in y around 0 68.9%
associate-*r/68.9%
associate-*r*68.9%
neg-mul-168.9%
*-commutative68.9%
*-rgt-identity68.9%
associate-*r/68.9%
associate-*l*94.7%
associate-*r/94.7%
*-rgt-identity94.7%
Simplified94.7%
if -inf.0 < (*.f64 z t) < 5.0000000000000002e279Initial program 96.3%
if 5.0000000000000002e279 < (*.f64 z t) Initial program 52.2%
div-inv52.3%
fma-neg59.4%
*-commutative59.4%
distribute-rgt-neg-in59.4%
Applied egg-rr59.4%
Taylor expanded in x around 0 52.3%
mul-1-neg52.3%
+-commutative52.3%
fma-def59.4%
fma-neg52.3%
Simplified52.3%
Taylor expanded in y around 0 59.3%
mul-1-neg59.3%
associate-/l*92.9%
distribute-neg-frac92.9%
Simplified92.9%
Final simplification96.0%
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 (<= (* z t) -2e+146) (- (/ x (/ a y)) (/ z (/ a t))) (if (<= (* z t) 5e+279) (/ (- (* x y) (* z t)) a) (/ (- t) (/ a z)))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z * t) <= -2e+146) {
tmp = (x / (a / y)) - (z / (a / t));
} else if ((z * t) <= 5e+279) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = -t / (a / z);
}
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 ((z * t) <= (-2d+146)) then
tmp = (x / (a / y)) - (z / (a / t))
else if ((z * t) <= 5d+279) then
tmp = ((x * y) - (z * t)) / a
else
tmp = -t / (a / z)
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 ((z * t) <= -2e+146) {
tmp = (x / (a / y)) - (z / (a / t));
} else if ((z * t) <= 5e+279) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = -t / (a / z);
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if (z * t) <= -2e+146: tmp = (x / (a / y)) - (z / (a / t)) elif (z * t) <= 5e+279: tmp = ((x * y) - (z * t)) / a else: tmp = -t / (a / z) return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(z * t) <= -2e+146) tmp = Float64(Float64(x / Float64(a / y)) - Float64(z / Float64(a / t))); elseif (Float64(z * t) <= 5e+279) tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a); else tmp = Float64(Float64(-t) / Float64(a / z)); 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 ((z * t) <= -2e+146)
tmp = (x / (a / y)) - (z / (a / t));
elseif ((z * t) <= 5e+279)
tmp = ((x * y) - (z * t)) / a;
else
tmp = -t / (a / z);
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[(z * t), $MachinePrecision], -2e+146], N[(N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision] - N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 5e+279], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[((-t) / N[(a / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -2 \cdot 10^{+146}:\\
\;\;\;\;\frac{x}{\frac{a}{y}} - \frac{z}{\frac{a}{t}}\\
\mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+279}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-t}{\frac{a}{z}}\\
\end{array}
\end{array}
if (*.f64 z t) < -1.99999999999999987e146Initial program 78.4%
div-sub78.3%
associate-/l*83.8%
associate-/l*99.8%
Applied egg-rr99.8%
if -1.99999999999999987e146 < (*.f64 z t) < 5.0000000000000002e279Initial program 96.5%
if 5.0000000000000002e279 < (*.f64 z t) Initial program 52.2%
div-inv52.3%
fma-neg59.4%
*-commutative59.4%
distribute-rgt-neg-in59.4%
Applied egg-rr59.4%
Taylor expanded in x around 0 52.3%
mul-1-neg52.3%
+-commutative52.3%
fma-def59.4%
fma-neg52.3%
Simplified52.3%
Taylor expanded in y around 0 59.3%
mul-1-neg59.3%
associate-/l*92.9%
distribute-neg-frac92.9%
Simplified92.9%
Final simplification96.8%
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 (- (/ z a)))))
(if (<= z -1.4e+103)
t_1
(if (<= z -6.5e+70)
(* y (/ x a))
(if (<= z -28.0)
(- (* (/ t a) z))
(if (<= z 1.75e-131) (/ (* x y) a) t_1))))))assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double t_1 = t * -(z / a);
double tmp;
if (z <= -1.4e+103) {
tmp = t_1;
} else if (z <= -6.5e+70) {
tmp = y * (x / a);
} else if (z <= -28.0) {
tmp = -((t / a) * z);
} else if (z <= 1.75e-131) {
tmp = (x * y) / a;
} else {
tmp = t_1;
}
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 = t * -(z / a)
if (z <= (-1.4d+103)) then
tmp = t_1
else if (z <= (-6.5d+70)) then
tmp = y * (x / a)
else if (z <= (-28.0d0)) then
tmp = -((t / a) * z)
else if (z <= 1.75d-131) then
tmp = (x * y) / a
else
tmp = t_1
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 * -(z / a);
double tmp;
if (z <= -1.4e+103) {
tmp = t_1;
} else if (z <= -6.5e+70) {
tmp = y * (x / a);
} else if (z <= -28.0) {
tmp = -((t / a) * z);
} else if (z <= 1.75e-131) {
tmp = (x * y) / a;
} else {
tmp = t_1;
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): t_1 = t * -(z / a) tmp = 0 if z <= -1.4e+103: tmp = t_1 elif z <= -6.5e+70: tmp = y * (x / a) elif z <= -28.0: tmp = -((t / a) * z) elif z <= 1.75e-131: tmp = (x * y) / a else: tmp = t_1 return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) t_1 = Float64(t * Float64(-Float64(z / a))) tmp = 0.0 if (z <= -1.4e+103) tmp = t_1; elseif (z <= -6.5e+70) tmp = Float64(y * Float64(x / a)); elseif (z <= -28.0) tmp = Float64(-Float64(Float64(t / a) * z)); elseif (z <= 1.75e-131) tmp = Float64(Float64(x * y) / a); else tmp = t_1; 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 * -(z / a);
tmp = 0.0;
if (z <= -1.4e+103)
tmp = t_1;
elseif (z <= -6.5e+70)
tmp = y * (x / a);
elseif (z <= -28.0)
tmp = -((t / a) * z);
elseif (z <= 1.75e-131)
tmp = (x * y) / a;
else
tmp = t_1;
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[(t * (-N[(z / a), $MachinePrecision])), $MachinePrecision]}, If[LessEqual[z, -1.4e+103], t$95$1, If[LessEqual[z, -6.5e+70], N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -28.0], (-N[(N[(t / a), $MachinePrecision] * z), $MachinePrecision]), If[LessEqual[z, 1.75e-131], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(-\frac{z}{a}\right)\\
\mathbf{if}\;z \leq -1.4 \cdot 10^{+103}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -6.5 \cdot 10^{+70}:\\
\;\;\;\;y \cdot \frac{x}{a}\\
\mathbf{elif}\;z \leq -28:\\
\;\;\;\;-\frac{t}{a} \cdot z\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{-131}:\\
\;\;\;\;\frac{x \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.40000000000000004e103 or 1.7500000000000001e-131 < z Initial program 88.4%
Taylor expanded in x around 0 51.0%
associate-*r/51.0%
mul-1-neg51.0%
distribute-rgt-neg-out51.0%
*-commutative51.0%
associate-/l*53.5%
associate-/r/55.3%
Simplified55.3%
if -1.40000000000000004e103 < z < -6.49999999999999978e70Initial program 99.8%
Taylor expanded in x around inf 67.3%
associate-*r/67.3%
Simplified67.3%
if -6.49999999999999978e70 < z < -28Initial program 91.7%
div-inv91.6%
fma-neg91.6%
*-commutative91.6%
distribute-rgt-neg-in91.6%
Applied egg-rr91.6%
Taylor expanded in x around 0 91.6%
mul-1-neg91.6%
+-commutative91.6%
fma-def91.6%
fma-neg91.6%
Simplified91.6%
Taylor expanded in y around 0 59.5%
associate-*r/59.5%
associate-*r*59.5%
neg-mul-159.5%
*-commutative59.5%
*-rgt-identity59.5%
associate-*r/59.3%
associate-*l*67.2%
associate-*r/67.3%
*-rgt-identity67.3%
Simplified67.3%
if -28 < z < 1.7500000000000001e-131Initial program 95.6%
Taylor expanded in x around inf 74.1%
Final simplification63.2%
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 (<= y -4.2e-188) (* y (/ x a)) (if (<= y 6.8e+16) (- (* (/ t a) z)) (/ x (/ a y)))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -4.2e-188) {
tmp = y * (x / a);
} else if (y <= 6.8e+16) {
tmp = -((t / a) * z);
} else {
tmp = x / (a / y);
}
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 (y <= (-4.2d-188)) then
tmp = y * (x / a)
else if (y <= 6.8d+16) then
tmp = -((t / a) * z)
else
tmp = x / (a / y)
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 (y <= -4.2e-188) {
tmp = y * (x / a);
} else if (y <= 6.8e+16) {
tmp = -((t / a) * z);
} else {
tmp = x / (a / y);
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if y <= -4.2e-188: tmp = y * (x / a) elif y <= 6.8e+16: tmp = -((t / a) * z) else: tmp = x / (a / y) return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (y <= -4.2e-188) tmp = Float64(y * Float64(x / a)); elseif (y <= 6.8e+16) tmp = Float64(-Float64(Float64(t / a) * z)); else tmp = Float64(x / Float64(a / y)); 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 (y <= -4.2e-188)
tmp = y * (x / a);
elseif (y <= 6.8e+16)
tmp = -((t / a) * z);
else
tmp = x / (a / y);
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[y, -4.2e-188], N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.8e+16], (-N[(N[(t / a), $MachinePrecision] * z), $MachinePrecision]), N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{-188}:\\
\;\;\;\;y \cdot \frac{x}{a}\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{+16}:\\
\;\;\;\;-\frac{t}{a} \cdot z\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{a}{y}}\\
\end{array}
\end{array}
if y < -4.1999999999999998e-188Initial program 92.2%
Taylor expanded in x around inf 59.5%
associate-*r/59.6%
Simplified59.6%
if -4.1999999999999998e-188 < y < 6.8e16Initial program 93.0%
div-inv92.8%
fma-neg92.8%
*-commutative92.8%
distribute-rgt-neg-in92.8%
Applied egg-rr92.8%
Taylor expanded in x around 0 92.8%
mul-1-neg92.8%
+-commutative92.8%
fma-def92.8%
fma-neg92.8%
Simplified92.8%
Taylor expanded in y around 0 63.8%
associate-*r/63.8%
associate-*r*63.8%
neg-mul-163.8%
*-commutative63.8%
*-rgt-identity63.8%
associate-*r/63.7%
associate-*l*66.0%
associate-*r/65.9%
*-rgt-identity65.9%
Simplified65.9%
if 6.8e16 < y Initial program 89.1%
Taylor expanded in x around inf 67.4%
associate-*r/69.0%
Simplified69.0%
associate-*r/67.4%
*-commutative67.4%
associate-/l*68.4%
Applied egg-rr68.4%
Final simplification64.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 (if (<= z -2.2e-145) (* y (/ x 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 (z <= -2.2e-145) {
tmp = y * (x / 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 (z <= (-2.2d-145)) then
tmp = y * (x / 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 (z <= -2.2e-145) {
tmp = y * (x / 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 z <= -2.2e-145: tmp = y * (x / 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 (z <= -2.2e-145) tmp = Float64(y * Float64(x / a)); else tmp = Float64(x * Float64(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 (z <= -2.2e-145)
tmp = y * (x / 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[z, -2.2e-145], N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{-145}:\\
\;\;\;\;y \cdot \frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -2.19999999999999999e-145Initial program 91.6%
Taylor expanded in x around inf 45.9%
associate-*r/46.1%
Simplified46.1%
if -2.19999999999999999e-145 < z Initial program 91.6%
Taylor expanded in x around inf 63.3%
associate-*l/61.8%
Applied egg-rr61.8%
Final simplification56.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 (if (<= z -2e-142) (/ y (/ a x)) (* x (/ y a))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e-142) {
tmp = y / (a / x);
} 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 (z <= (-2d-142)) then
tmp = y / (a / x)
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 (z <= -2e-142) {
tmp = y / (a / x);
} 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 z <= -2e-142: tmp = y / (a / x) 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 (z <= -2e-142) tmp = Float64(y / Float64(a / x)); else tmp = Float64(x * Float64(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 (z <= -2e-142)
tmp = y / (a / x);
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[z, -2e-142], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-142}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -2.0000000000000001e-142Initial program 91.6%
Taylor expanded in x around inf 45.9%
associate-/l*46.8%
Simplified46.8%
if -2.0000000000000001e-142 < z Initial program 91.6%
Taylor expanded in x around inf 63.3%
associate-*l/61.8%
Applied egg-rr61.8%
Final simplification56.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 (<= z -3.3e+162) (* 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 (z <= -3.3e+162) {
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 (z <= (-3.3d+162)) 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 (z <= -3.3e+162) {
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 z <= -3.3e+162: 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 (z <= -3.3e+162) 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 (z <= -3.3e+162)
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[z, -3.3e+162], 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}\;z \leq -3.3 \cdot 10^{+162}:\\
\;\;\;\;x \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{a}\\
\end{array}
\end{array}
if z < -3.29999999999999987e162Initial program 82.4%
Taylor expanded in x around inf 21.6%
associate-*l/32.2%
Applied egg-rr32.2%
if -3.29999999999999987e162 < z Initial program 92.7%
Taylor expanded in x around inf 61.2%
Final simplification58.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 91.6%
Taylor expanded in x around inf 57.0%
associate-*r/57.5%
Simplified57.5%
Final simplification57.5%
(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 2023240
(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))