
(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}
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* x y) (- INFINITY)) (fma x (/ y a) (- (/ z (/ a t)))) (/ (- (* x y) (* z t)) a)))
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -((double) INFINITY)) {
tmp = fma(x, (y / a), -(z / (a / t)));
} else {
tmp = ((x * y) - (z * t)) / a;
}
return tmp;
}
z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= Float64(-Inf)) tmp = fma(x, Float64(y / a), Float64(-Float64(z / Float64(a / t)))); else tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a); end return tmp end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], (-Infinity)], N[(x * N[(y / a), $MachinePrecision] + (-N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision])), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(x, \frac{y}{a}, -\frac{z}{\frac{a}{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\
\end{array}
\end{array}
if (*.f64 x y) < -inf.0Initial program 64.7%
div-sub64.7%
*-un-lft-identity64.7%
times-frac96.6%
fma-neg96.6%
associate-/l*96.3%
Applied egg-rr96.3%
if -inf.0 < (*.f64 x y) Initial program 96.5%
Final simplification96.5%
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 (* y (/ x a))))
(if (<= (* x y) -2e+195)
t_1
(if (<= (* x y) -100.0)
(/ (* x y) a)
(if (<= (* x y) 5e-100)
(/ (* z (- t)) a)
(if (<= (* x y) 5e+14)
t_1
(if (<= (* x y) 5e+127) (* t (/ (- z) a)) (* x (/ y a)))))))))assert(z < t);
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (x / a);
double tmp;
if ((x * y) <= -2e+195) {
tmp = t_1;
} else if ((x * y) <= -100.0) {
tmp = (x * y) / a;
} else if ((x * y) <= 5e-100) {
tmp = (z * -t) / a;
} else if ((x * y) <= 5e+14) {
tmp = t_1;
} else if ((x * y) <= 5e+127) {
tmp = t * (-z / a);
} else {
tmp = x * (y / a);
}
return tmp;
}
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 = y * (x / a)
if ((x * y) <= (-2d+195)) then
tmp = t_1
else if ((x * y) <= (-100.0d0)) then
tmp = (x * y) / a
else if ((x * y) <= 5d-100) then
tmp = (z * -t) / a
else if ((x * y) <= 5d+14) then
tmp = t_1
else if ((x * y) <= 5d+127) then
tmp = t * (-z / a)
else
tmp = x * (y / a)
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * (x / a);
double tmp;
if ((x * y) <= -2e+195) {
tmp = t_1;
} else if ((x * y) <= -100.0) {
tmp = (x * y) / a;
} else if ((x * y) <= 5e-100) {
tmp = (z * -t) / a;
} else if ((x * y) <= 5e+14) {
tmp = t_1;
} else if ((x * y) <= 5e+127) {
tmp = t * (-z / a);
} else {
tmp = x * (y / a);
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): t_1 = y * (x / a) tmp = 0 if (x * y) <= -2e+195: tmp = t_1 elif (x * y) <= -100.0: tmp = (x * y) / a elif (x * y) <= 5e-100: tmp = (z * -t) / a elif (x * y) <= 5e+14: tmp = t_1 elif (x * y) <= 5e+127: tmp = t * (-z / a) else: tmp = x * (y / a) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a) t_1 = Float64(y * Float64(x / a)) tmp = 0.0 if (Float64(x * y) <= -2e+195) tmp = t_1; elseif (Float64(x * y) <= -100.0) tmp = Float64(Float64(x * y) / a); elseif (Float64(x * y) <= 5e-100) tmp = Float64(Float64(z * Float64(-t)) / a); elseif (Float64(x * y) <= 5e+14) tmp = t_1; elseif (Float64(x * y) <= 5e+127) tmp = Float64(t * Float64(Float64(-z) / a)); else tmp = Float64(x * Float64(y / a)); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = y * (x / a);
tmp = 0.0;
if ((x * y) <= -2e+195)
tmp = t_1;
elseif ((x * y) <= -100.0)
tmp = (x * y) / a;
elseif ((x * y) <= 5e-100)
tmp = (z * -t) / a;
elseif ((x * y) <= 5e+14)
tmp = t_1;
elseif ((x * y) <= 5e+127)
tmp = t * (-z / a);
else
tmp = x * (y / a);
end
tmp_2 = tmp;
end
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[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+195], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -100.0], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e-100], N[(N[(z * (-t)), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+14], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e+127], N[(t * N[((-z) / a), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := y \cdot \frac{x}{a}\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+195}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -100:\\
\;\;\;\;\frac{x \cdot y}{a}\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-100}:\\
\;\;\;\;\frac{z \cdot \left(-t\right)}{a}\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+14}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+127}:\\
\;\;\;\;t \cdot \frac{-z}{a}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{a}\\
\end{array}
\end{array}
if (*.f64 x y) < -1.99999999999999995e195 or 5.0000000000000001e-100 < (*.f64 x y) < 5e14Initial program 83.1%
Taylor expanded in x around inf 74.8%
associate-*r/85.6%
Simplified85.6%
if -1.99999999999999995e195 < (*.f64 x y) < -100Initial program 99.8%
Taylor expanded in x around inf 86.1%
if -100 < (*.f64 x y) < 5.0000000000000001e-100Initial program 96.9%
Taylor expanded in x around 0 84.8%
associate-*r/84.8%
associate-*r*84.8%
neg-mul-184.8%
Simplified84.8%
if 5e14 < (*.f64 x y) < 5.0000000000000004e127Initial program 99.7%
Taylor expanded in x around 0 67.5%
mul-1-neg67.5%
*-commutative67.5%
associate-*l/67.8%
*-commutative67.8%
distribute-lft-neg-in67.8%
Simplified67.8%
if 5.0000000000000004e127 < (*.f64 x y) Initial program 88.3%
Taylor expanded in x around inf 79.7%
associate-/l*91.3%
Simplified91.3%
associate-/r/91.3%
Applied egg-rr91.3%
Final simplification85.0%
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) -5e+265) (- (/ x (/ a y)) (* z (/ t a))) (/ (- (* x y) (* z t)) a)))
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -5e+265) {
tmp = (x / (a / y)) - (z * (t / a));
} else {
tmp = ((x * y) - (z * t)) / a;
}
return tmp;
}
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) <= (-5d+265)) then
tmp = (x / (a / y)) - (z * (t / a))
else
tmp = ((x * y) - (z * t)) / a
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -5e+265) {
tmp = (x / (a / y)) - (z * (t / a));
} else {
tmp = ((x * y) - (z * t)) / a;
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if (x * y) <= -5e+265: tmp = (x / (a / y)) - (z * (t / a)) else: tmp = ((x * y) - (z * t)) / a return tmp
z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= -5e+265) tmp = Float64(Float64(x / Float64(a / y)) - Float64(z * Float64(t / a))); else tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x * y) <= -5e+265)
tmp = (x / (a / y)) - (z * (t / a));
else
tmp = ((x * y) - (z * t)) / a;
end
tmp_2 = tmp;
end
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], -5e+265], N[(N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision] - N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+265}:\\
\;\;\;\;\frac{x}{\frac{a}{y}} - z \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\
\end{array}
\end{array}
if (*.f64 x y) < -5.0000000000000002e265Initial program 69.2%
div-sub69.2%
associate-/l*96.9%
associate-/l*96.7%
Applied egg-rr96.7%
clear-num96.7%
associate-/r/96.7%
clear-num96.7%
Applied egg-rr96.7%
if -5.0000000000000002e265 < (*.f64 x y) Initial program 96.5%
Final simplification96.5%
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 (<= y -8.2e-91)
(/ y (/ a x))
(if (<= y 3.4e-35)
t_1
(if (<= y 1.55e+82)
(/ x (/ a y))
(if (<= y 2.3e+96) t_1 (* y (/ x a))))))))assert(z < t);
double code(double x, double y, double z, double t, double a) {
double t_1 = t * (-z / a);
double tmp;
if (y <= -8.2e-91) {
tmp = y / (a / x);
} else if (y <= 3.4e-35) {
tmp = t_1;
} else if (y <= 1.55e+82) {
tmp = x / (a / y);
} else if (y <= 2.3e+96) {
tmp = t_1;
} else {
tmp = y * (x / a);
}
return tmp;
}
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 (y <= (-8.2d-91)) then
tmp = y / (a / x)
else if (y <= 3.4d-35) then
tmp = t_1
else if (y <= 1.55d+82) then
tmp = x / (a / y)
else if (y <= 2.3d+96) then
tmp = t_1
else
tmp = y * (x / a)
end if
code = tmp
end function
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 (y <= -8.2e-91) {
tmp = y / (a / x);
} else if (y <= 3.4e-35) {
tmp = t_1;
} else if (y <= 1.55e+82) {
tmp = x / (a / y);
} else if (y <= 2.3e+96) {
tmp = t_1;
} else {
tmp = y * (x / a);
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): t_1 = t * (-z / a) tmp = 0 if y <= -8.2e-91: tmp = y / (a / x) elif y <= 3.4e-35: tmp = t_1 elif y <= 1.55e+82: tmp = x / (a / y) elif y <= 2.3e+96: tmp = t_1 else: tmp = y * (x / a) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a) t_1 = Float64(t * Float64(Float64(-z) / a)) tmp = 0.0 if (y <= -8.2e-91) tmp = Float64(y / Float64(a / x)); elseif (y <= 3.4e-35) tmp = t_1; elseif (y <= 1.55e+82) tmp = Float64(x / Float64(a / y)); elseif (y <= 2.3e+96) tmp = t_1; else tmp = Float64(y * Float64(x / a)); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = t * (-z / a);
tmp = 0.0;
if (y <= -8.2e-91)
tmp = y / (a / x);
elseif (y <= 3.4e-35)
tmp = t_1;
elseif (y <= 1.55e+82)
tmp = x / (a / y);
elseif (y <= 2.3e+96)
tmp = t_1;
else
tmp = y * (x / a);
end
tmp_2 = tmp;
end
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[y, -8.2e-91], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.4e-35], t$95$1, If[LessEqual[y, 1.55e+82], N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.3e+96], t$95$1, N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := t \cdot \frac{-z}{a}\\
\mathbf{if}\;y \leq -8.2 \cdot 10^{-91}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{-35}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{+82}:\\
\;\;\;\;\frac{x}{\frac{a}{y}}\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{+96}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{a}\\
\end{array}
\end{array}
if y < -8.20000000000000048e-91Initial program 91.1%
Taylor expanded in x around inf 57.1%
associate-/l*58.9%
Simplified58.9%
if -8.20000000000000048e-91 < y < 3.4000000000000003e-35 or 1.55000000000000016e82 < y < 2.30000000000000015e96Initial program 95.8%
Taylor expanded in x around 0 74.2%
mul-1-neg74.2%
*-commutative74.2%
associate-*l/71.1%
*-commutative71.1%
distribute-lft-neg-in71.1%
Simplified71.1%
if 3.4000000000000003e-35 < y < 1.55000000000000016e82Initial program 99.8%
Taylor expanded in x around inf 81.9%
associate-*r/82.0%
Simplified82.0%
*-commutative82.0%
associate-/r/81.9%
Applied egg-rr81.9%
if 2.30000000000000015e96 < y Initial program 85.9%
Taylor expanded in x around inf 69.4%
associate-*r/78.8%
Simplified78.8%
Final simplification69.6%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* x y) (- INFINITY)) (* y (/ x a)) (/ (- (* x y) (* z t)) a)))
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -((double) INFINITY)) {
tmp = y * (x / a);
} else {
tmp = ((x * y) - (z * t)) / a;
}
return tmp;
}
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -Double.POSITIVE_INFINITY) {
tmp = y * (x / a);
} else {
tmp = ((x * y) - (z * t)) / a;
}
return tmp;
}
[z, t] = sort([z, t]) 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
z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= Float64(-Inf)) tmp = Float64(y * Float64(x / a)); else tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x * y) <= -Inf)
tmp = y * (x / a);
else
tmp = ((x * y) - (z * t)) / a;
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], (-Infinity)], N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\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 64.7%
Taylor expanded in x around inf 64.7%
associate-*r/96.3%
Simplified96.3%
if -inf.0 < (*.f64 x y) Initial program 96.5%
Final simplification96.5%
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(z < t);
double code(double x, double y, double z, double t, double a) {
return y * (x / a);
}
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 z < t;
public static double code(double x, double y, double z, double t, double a) {
return y * (x / a);
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): return y * (x / a)
z, t = sort([z, t]) function code(x, y, z, t, a) return Float64(y * Float64(x / a)) end
z, t = num2cell(sort([z, t])){:}
function tmp = code(x, y, z, t, a)
tmp = y * (x / a);
end
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}
[z, t] = \mathsf{sort}([z, t])\\
\\
y \cdot \frac{x}{a}
\end{array}
Initial program 93.2%
Taylor expanded in x around inf 52.9%
associate-*r/54.1%
Simplified54.1%
Final simplification54.1%
(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 2023279
(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))