
(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 6 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}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- (* x y) (* z t)) a)))
(if (<= t_1 (- INFINITY))
(- (* x (/ y a)) (* t (/ z a)))
(if (<= t_1 2e+287) t_1 (/ y (/ a (- x (/ t (/ y z)))))))))
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 <= -((double) INFINITY)) {
tmp = (x * (y / a)) - (t * (z / a));
} else if (t_1 <= 2e+287) {
tmp = t_1;
} else {
tmp = y / (a / (x - (t / (y / z))));
}
return tmp;
}
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 <= -Double.POSITIVE_INFINITY) {
tmp = (x * (y / a)) - (t * (z / a));
} else if (t_1 <= 2e+287) {
tmp = t_1;
} else {
tmp = y / (a / (x - (t / (y / z))));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((x * y) - (z * t)) / a tmp = 0 if t_1 <= -math.inf: tmp = (x * (y / a)) - (t * (z / a)) elif t_1 <= 2e+287: tmp = t_1 else: tmp = y / (a / (x - (t / (y / z)))) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(x * y) - Float64(z * t)) / a) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(x * Float64(y / a)) - Float64(t * Float64(z / a))); elseif (t_1 <= 2e+287) tmp = t_1; else tmp = Float64(y / Float64(a / Float64(x - Float64(t / Float64(y / z))))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((x * y) - (z * t)) / a; tmp = 0.0; if (t_1 <= -Inf) tmp = (x * (y / a)) - (t * (z / a)); elseif (t_1 <= 2e+287) tmp = t_1; else tmp = y / (a / (x - (t / (y / z)))); end tmp_2 = tmp; end
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, (-Infinity)], N[(N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision] - N[(t * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+287], t$95$1, N[(y / N[(a / N[(x - N[(t / N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot y - z \cdot t}{a}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;x \cdot \frac{y}{a} - t \cdot \frac{z}{a}\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+287}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{a}{x - \frac{t}{\frac{y}{z}}}}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (*.f64 x y) (*.f64 z t)) a) < -inf.0Initial program 79.7%
div-sub75.8%
associate-/l*86.9%
*-commutative86.9%
*-un-lft-identity86.9%
times-frac96.0%
Applied egg-rr96.0%
div-inv96.0%
*-commutative96.0%
clear-num96.1%
Applied egg-rr96.1%
if -inf.0 < (/.f64 (-.f64 (*.f64 x y) (*.f64 z t)) a) < 2.0000000000000002e287Initial program 98.1%
if 2.0000000000000002e287 < (/.f64 (-.f64 (*.f64 x y) (*.f64 z t)) a) Initial program 82.1%
div-sub77.9%
associate-/l*79.4%
*-commutative79.4%
*-un-lft-identity79.4%
times-frac81.2%
Applied egg-rr81.2%
associate-*r/79.4%
*-commutative79.4%
frac-sub71.3%
*-commutative71.3%
Applied egg-rr71.3%
Taylor expanded in a around 0 86.3%
associate-/l*94.1%
associate-/l*96.2%
Simplified96.2%
Final simplification97.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* x y) (* z t))))
(if (or (<= t_1 -5e+221) (not (<= t_1 5e+259)))
(- (* x (/ y a)) (* t (/ z a)))
(/ t_1 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 <= -5e+221) || !(t_1 <= 5e+259)) {
tmp = (x * (y / a)) - (t * (z / a));
} else {
tmp = t_1 / a;
}
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 = (x * y) - (z * t)
if ((t_1 <= (-5d+221)) .or. (.not. (t_1 <= 5d+259))) then
tmp = (x * (y / a)) - (t * (z / a))
else
tmp = t_1 / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) - (z * t);
double tmp;
if ((t_1 <= -5e+221) || !(t_1 <= 5e+259)) {
tmp = (x * (y / a)) - (t * (z / a));
} else {
tmp = t_1 / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x * y) - (z * t) tmp = 0 if (t_1 <= -5e+221) or not (t_1 <= 5e+259): tmp = (x * (y / a)) - (t * (z / a)) else: tmp = t_1 / a return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) - Float64(z * t)) tmp = 0.0 if ((t_1 <= -5e+221) || !(t_1 <= 5e+259)) tmp = Float64(Float64(x * Float64(y / a)) - Float64(t * Float64(z / a))); else tmp = Float64(t_1 / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x * y) - (z * t); tmp = 0.0; if ((t_1 <= -5e+221) || ~((t_1 <= 5e+259))) tmp = (x * (y / a)) - (t * (z / a)); else tmp = t_1 / a; end tmp_2 = tmp; end
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+221], N[Not[LessEqual[t$95$1, 5e+259]], $MachinePrecision]], N[(N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision] - N[(t * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y - z \cdot t\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+221} \lor \neg \left(t_1 \leq 5 \cdot 10^{+259}\right):\\
\;\;\;\;x \cdot \frac{y}{a} - t \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1}{a}\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -5.0000000000000002e221 or 5.00000000000000033e259 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 78.4%
div-sub77.3%
associate-/l*86.8%
*-commutative86.8%
*-un-lft-identity86.8%
times-frac94.2%
Applied egg-rr94.2%
div-inv94.2%
*-commutative94.2%
clear-num94.3%
Applied egg-rr94.3%
if -5.0000000000000002e221 < (-.f64 (*.f64 x y) (*.f64 z t)) < 5.00000000000000033e259Initial program 98.3%
Final simplification96.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* x y) (* z t))))
(if (<= t_1 -5e+250)
(- (/ x (/ a y)) (/ z (/ a t)))
(if (<= t_1 5e+259) (/ t_1 a) (- (* x (/ y a)) (* t (/ z 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 <= -5e+250) {
tmp = (x / (a / y)) - (z / (a / t));
} else if (t_1 <= 5e+259) {
tmp = t_1 / a;
} else {
tmp = (x * (y / a)) - (t * (z / a));
}
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 = (x * y) - (z * t)
if (t_1 <= (-5d+250)) then
tmp = (x / (a / y)) - (z / (a / t))
else if (t_1 <= 5d+259) then
tmp = t_1 / a
else
tmp = (x * (y / a)) - (t * (z / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) - (z * t);
double tmp;
if (t_1 <= -5e+250) {
tmp = (x / (a / y)) - (z / (a / t));
} else if (t_1 <= 5e+259) {
tmp = t_1 / a;
} else {
tmp = (x * (y / a)) - (t * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x * y) - (z * t) tmp = 0 if t_1 <= -5e+250: tmp = (x / (a / y)) - (z / (a / t)) elif t_1 <= 5e+259: tmp = t_1 / a else: tmp = (x * (y / a)) - (t * (z / a)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) - Float64(z * t)) tmp = 0.0 if (t_1 <= -5e+250) tmp = Float64(Float64(x / Float64(a / y)) - Float64(z / Float64(a / t))); elseif (t_1 <= 5e+259) tmp = Float64(t_1 / a); else tmp = Float64(Float64(x * Float64(y / a)) - Float64(t * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x * y) - (z * t); tmp = 0.0; if (t_1 <= -5e+250) tmp = (x / (a / y)) - (z / (a / t)); elseif (t_1 <= 5e+259) tmp = t_1 / a; else tmp = (x * (y / a)) - (t * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+250], N[(N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision] - N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+259], N[(t$95$1 / a), $MachinePrecision], N[(N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision] - N[(t * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y - z \cdot t\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+250}:\\
\;\;\;\;\frac{x}{\frac{a}{y}} - \frac{z}{\frac{a}{t}}\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+259}:\\
\;\;\;\;\frac{t_1}{a}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{a} - t \cdot \frac{z}{a}\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -5.0000000000000002e250Initial program 76.5%
div-sub76.5%
associate-/l*92.1%
*-commutative92.1%
*-un-lft-identity92.1%
times-frac97.1%
Applied egg-rr97.1%
associate-*r/92.1%
*-commutative92.1%
associate-/l*97.2%
Applied egg-rr97.2%
if -5.0000000000000002e250 < (-.f64 (*.f64 x y) (*.f64 z t)) < 5.00000000000000033e259Initial program 98.4%
if 5.00000000000000033e259 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 74.9%
div-sub72.5%
associate-/l*79.1%
*-commutative79.1%
*-un-lft-identity79.1%
times-frac90.3%
Applied egg-rr90.3%
div-inv90.4%
*-commutative90.4%
clear-num90.4%
Applied egg-rr90.4%
Final simplification96.9%
(FPCore (x y z t a) :precision binary64 (if (<= (* x y) -1e+49) (/ x (/ a y)) (if (<= (* x y) 1e+35) (* t (/ (- z) a)) (* y (/ x a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -1e+49) {
tmp = x / (a / y);
} else if ((x * y) <= 1e+35) {
tmp = t * (-z / a);
} else {
tmp = y * (x / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((x * y) <= (-1d+49)) then
tmp = x / (a / y)
else if ((x * y) <= 1d+35) then
tmp = t * (-z / a)
else
tmp = y * (x / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -1e+49) {
tmp = x / (a / y);
} else if ((x * y) <= 1e+35) {
tmp = t * (-z / a);
} else {
tmp = y * (x / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x * y) <= -1e+49: tmp = x / (a / y) elif (x * y) <= 1e+35: tmp = t * (-z / a) else: tmp = y * (x / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= -1e+49) tmp = Float64(x / Float64(a / y)); elseif (Float64(x * y) <= 1e+35) tmp = Float64(t * Float64(Float64(-z) / a)); else tmp = Float64(y * Float64(x / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x * y) <= -1e+49) tmp = x / (a / y); elseif ((x * y) <= 1e+35) tmp = t * (-z / a); else tmp = y * (x / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], -1e+49], N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+35], N[(t * N[((-z) / a), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+49}:\\
\;\;\;\;\frac{x}{\frac{a}{y}}\\
\mathbf{elif}\;x \cdot y \leq 10^{+35}:\\
\;\;\;\;t \cdot \frac{-z}{a}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{a}\\
\end{array}
\end{array}
if (*.f64 x y) < -9.99999999999999946e48Initial program 80.7%
Taylor expanded in x around inf 69.2%
associate-*l/79.6%
Simplified79.6%
clear-num79.5%
associate-*l/79.6%
*-un-lft-identity79.6%
Applied egg-rr79.6%
div-inv79.5%
add-sqr-sqrt35.6%
associate-*l*35.7%
clear-num35.7%
Applied egg-rr35.7%
associate-*r*35.6%
*-commutative35.6%
Simplified35.6%
rem-square-sqrt79.6%
associate-/r/80.9%
Applied egg-rr80.9%
if -9.99999999999999946e48 < (*.f64 x y) < 9.9999999999999997e34Initial program 93.5%
Taylor expanded in x around 0 79.1%
mul-1-neg79.1%
associate-*r/79.2%
distribute-rgt-neg-in79.2%
distribute-neg-frac79.2%
Simplified79.2%
if 9.9999999999999997e34 < (*.f64 x y) Initial program 94.3%
Taylor expanded in x around inf 85.7%
associate-*l/88.5%
Simplified88.5%
Final simplification82.0%
(FPCore (x y z t a) :precision binary64 (if (<= (* x y) (- INFINITY)) (* y (/ x a)) (/ (- (* x y) (* z t)) a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -((double) INFINITY)) {
tmp = y * (x / a);
} else {
tmp = ((x * y) - (z * t)) / a;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -Double.POSITIVE_INFINITY) {
tmp = y * (x / a);
} else {
tmp = ((x * y) - (z * t)) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x * y) <= -math.inf: tmp = y * (x / a) else: tmp = ((x * y) - (z * t)) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= Float64(-Inf)) tmp = Float64(y * Float64(x / a)); else tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x * y) <= -Inf) tmp = y * (x / a); else tmp = ((x * y) - (z * t)) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], (-Infinity)], N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -\infty:\\
\;\;\;\;y \cdot \frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\
\end{array}
\end{array}
if (*.f64 x y) < -inf.0Initial program 52.2%
Taylor expanded in x around inf 57.7%
associate-*l/94.4%
Simplified94.4%
if -inf.0 < (*.f64 x y) Initial program 94.4%
Final simplification94.4%
(FPCore (x y z t a) :precision binary64 (* y (/ x a)))
double code(double x, double y, double z, double t, double a) {
return y * (x / 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 = y * (x / a)
end function
public static double code(double x, double y, double z, double t, double a) {
return y * (x / a);
}
def code(x, y, z, t, a): return y * (x / a)
function code(x, y, z, t, a) return Float64(y * Float64(x / a)) end
function tmp = code(x, y, z, t, a) tmp = y * (x / a); end
code[x_, y_, z_, t_, a_] := N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \frac{x}{a}
\end{array}
Initial program 91.4%
Taylor expanded in x around inf 50.2%
associate-*l/52.3%
Simplified52.3%
Final simplification52.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 2023301
(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))