
(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: 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))) (t_2 (fma (/ y a) x (* (/ (- z) a) t)))) (if (<= t_1 -6e+286) t_2 (if (<= t_1 1e+240) (/ t_1 a) t_2))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * x) - (t * z);
double t_2 = fma((y / a), x, ((-z / a) * t));
double tmp;
if (t_1 <= -6e+286) {
tmp = t_2;
} else if (t_1 <= 1e+240) {
tmp = t_1 / a;
} else {
tmp = t_2;
}
return tmp;
}
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) t_1 = Float64(Float64(y * x) - Float64(t * z)) t_2 = fma(Float64(y / a), x, Float64(Float64(Float64(-z) / a) * t)) tmp = 0.0 if (t_1 <= -6e+286) tmp = t_2; elseif (t_1 <= 1e+240) tmp = Float64(t_1 / a); else tmp = t_2; 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]}, Block[{t$95$2 = N[(N[(y / a), $MachinePrecision] * x + N[(N[((-z) / a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -6e+286], t$95$2, If[LessEqual[t$95$1, 1e+240], N[(t$95$1 / a), $MachinePrecision], t$95$2]]]]
\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\\
t_2 := \mathsf{fma}\left(\frac{y}{a}, x, \frac{-z}{a} \cdot t\right)\\
\mathbf{if}\;t\_1 \leq -6 \cdot 10^{+286}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+240}:\\
\;\;\;\;\frac{t\_1}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -5.9999999999999998e286 or 1.00000000000000001e240 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 76.5%
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-/.f6497.3
Applied rewrites97.3%
if -5.9999999999999998e286 < (-.f64 (*.f64 x y) (*.f64 z t)) < 1.00000000000000001e240Initial program 99.7%
Final simplification99.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 (let* ((t_1 (- (* y x) (* t z)))) (if (<= t_1 2e+286) (/ t_1 a) (fma (- z) (/ t 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 t_1 = (y * x) - (t * z);
double tmp;
if (t_1 <= 2e+286) {
tmp = t_1 / a;
} else {
tmp = fma(-z, (t / a), ((x / a) * y));
}
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 <= 2e+286) tmp = Float64(t_1 / a); else tmp = fma(Float64(-z), Float64(t / a), Float64(Float64(x / a) * y)); 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, 2e+286], N[(t$95$1 / a), $MachinePrecision], N[((-z) * N[(t / a), $MachinePrecision] + N[(N[(x / a), $MachinePrecision] * y), $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 2 \cdot 10^{+286}:\\
\;\;\;\;\frac{t\_1}{a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-z, \frac{t}{a}, \frac{x}{a} \cdot y\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < 2.00000000000000007e286Initial program 97.1%
if 2.00000000000000007e286 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 69.8%
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-/.f6485.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6485.9
Applied rewrites85.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6497.4
Applied rewrites97.4%
Final simplification97.1%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* t z) -1e+296) (* (* (/ -1.0 a) t) z) (if (<= (* t z) 1e+140) (/ (- (* y x) (* t z)) a) (* (/ (- z) a) t))))
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) <= -1e+296) {
tmp = ((-1.0 / a) * t) * z;
} else if ((t * z) <= 1e+140) {
tmp = ((y * x) - (t * z)) / a;
} else {
tmp = (-z / a) * t;
}
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) <= (-1d+296)) then
tmp = (((-1.0d0) / a) * t) * z
else if ((t * z) <= 1d+140) then
tmp = ((y * x) - (t * z)) / a
else
tmp = (-z / a) * t
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) <= -1e+296) {
tmp = ((-1.0 / a) * t) * z;
} else if ((t * z) <= 1e+140) {
tmp = ((y * x) - (t * z)) / a;
} else {
tmp = (-z / a) * t;
}
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) <= -1e+296: tmp = ((-1.0 / a) * t) * z elif (t * z) <= 1e+140: tmp = ((y * x) - (t * z)) / a else: tmp = (-z / a) * t 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) <= -1e+296) tmp = Float64(Float64(Float64(-1.0 / a) * t) * z); elseif (Float64(t * z) <= 1e+140) tmp = Float64(Float64(Float64(y * x) - Float64(t * z)) / a); else tmp = Float64(Float64(Float64(-z) / a) * t); 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) <= -1e+296)
tmp = ((-1.0 / a) * t) * z;
elseif ((t * z) <= 1e+140)
tmp = ((y * x) - (t * z)) / a;
else
tmp = (-z / a) * t;
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], -1e+296], N[(N[(N[(-1.0 / a), $MachinePrecision] * t), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[N[(t * z), $MachinePrecision], 1e+140], N[(N[(N[(y * x), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[((-z) / a), $MachinePrecision] * t), $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 -1 \cdot 10^{+296}:\\
\;\;\;\;\left(\frac{-1}{a} \cdot t\right) \cdot z\\
\mathbf{elif}\;t \cdot z \leq 10^{+140}:\\
\;\;\;\;\frac{y \cdot x - t \cdot z}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-z}{a} \cdot t\\
\end{array}
\end{array}
if (*.f64 z t) < -9.99999999999999981e295Initial program 65.4%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f647.0
Applied rewrites7.0%
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.6
Applied rewrites95.6%
Applied rewrites95.7%
if -9.99999999999999981e295 < (*.f64 z t) < 1.00000000000000006e140Initial program 96.9%
if 1.00000000000000006e140 < (*.f64 z t) Initial program 83.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-/.f6498.9
Applied rewrites98.9%
Final simplification97.1%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* t z) -4e+53) (* (/ (- z) a) t) (if (<= (* t z) 2e-17) (/ (* y x) a) (/ (- t) (/ a z)))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t * z) <= -4e+53) {
tmp = (-z / a) * t;
} else if ((t * z) <= 2e-17) {
tmp = (y * x) / a;
} else {
tmp = -t / (a / z);
}
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) <= (-4d+53)) then
tmp = (-z / a) * t
else if ((t * z) <= 2d-17) then
tmp = (y * x) / a
else
tmp = -t / (a / z)
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) <= -4e+53) {
tmp = (-z / a) * t;
} else if ((t * z) <= 2e-17) {
tmp = (y * x) / a;
} else {
tmp = -t / (a / z);
}
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) <= -4e+53: tmp = (-z / a) * t elif (t * z) <= 2e-17: tmp = (y * x) / a else: tmp = -t / (a / z) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(t * z) <= -4e+53) tmp = Float64(Float64(Float64(-z) / a) * t); elseif (Float64(t * z) <= 2e-17) tmp = Float64(Float64(y * x) / a); else tmp = Float64(Float64(-t) / Float64(a / z)); 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) <= -4e+53)
tmp = (-z / a) * t;
elseif ((t * z) <= 2e-17)
tmp = (y * x) / a;
else
tmp = -t / (a / z);
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], -4e+53], N[(N[((-z) / a), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[N[(t * z), $MachinePrecision], 2e-17], N[(N[(y * x), $MachinePrecision] / a), $MachinePrecision], N[((-t) / N[(a / z), $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 -4 \cdot 10^{+53}:\\
\;\;\;\;\frac{-z}{a} \cdot t\\
\mathbf{elif}\;t \cdot z \leq 2 \cdot 10^{-17}:\\
\;\;\;\;\frac{y \cdot x}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-t}{\frac{a}{z}}\\
\end{array}
\end{array}
if (*.f64 z t) < -4e53Initial program 83.8%
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-/.f6480.6
Applied rewrites80.6%
if -4e53 < (*.f64 z t) < 2.00000000000000014e-17Initial program 97.3%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f6481.4
Applied rewrites81.4%
if 2.00000000000000014e-17 < (*.f64 z t) Initial program 93.2%
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.4
Applied rewrites79.4%
Applied rewrites80.8%
Final simplification81.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))) (if (<= (* t z) -4e+53) t_1 (if (<= (* t z) 2e-17) (/ (* y x) 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 = (-z / a) * t;
double tmp;
if ((t * z) <= -4e+53) {
tmp = t_1;
} else if ((t * z) <= 2e-17) {
tmp = (y * x) / a;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (-z / a) * t
if ((t * z) <= (-4d+53)) then
tmp = t_1
else if ((t * z) <= 2d-17) then
tmp = (y * x) / a
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (-z / a) * t;
double tmp;
if ((t * z) <= -4e+53) {
tmp = t_1;
} else if ((t * z) <= 2e-17) {
tmp = (y * x) / a;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): t_1 = (-z / a) * t tmp = 0 if (t * z) <= -4e+53: tmp = t_1 elif (t * z) <= 2e-17: tmp = (y * x) / 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 = Float64(Float64(Float64(-z) / a) * t) tmp = 0.0 if (Float64(t * z) <= -4e+53) tmp = t_1; elseif (Float64(t * z) <= 2e-17) tmp = Float64(Float64(y * x) / a); else tmp = t_1; end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = (-z / a) * t;
tmp = 0.0;
if ((t * z) <= -4e+53)
tmp = t_1;
elseif ((t * z) <= 2e-17)
tmp = (y * x) / a;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[((-z) / a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[N[(t * z), $MachinePrecision], -4e+53], t$95$1, If[LessEqual[N[(t * z), $MachinePrecision], 2e-17], N[(N[(y * x), $MachinePrecision] / 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 := \frac{-z}{a} \cdot t\\
\mathbf{if}\;t \cdot z \leq -4 \cdot 10^{+53}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \cdot z \leq 2 \cdot 10^{-17}:\\
\;\;\;\;\frac{y \cdot x}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 z t) < -4e53 or 2.00000000000000014e-17 < (*.f64 z t) Initial program 88.7%
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-/.f6480.0
Applied rewrites80.0%
if -4e53 < (*.f64 z t) < 2.00000000000000014e-17Initial program 97.3%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f6481.4
Applied rewrites81.4%
Final simplification80.6%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (/ (* y x) a))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
return (y * x) / a;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (y * x) / a
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
return (y * x) / a;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): return (y * x) / a
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) return Float64(Float64(y * x) / a) end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp = code(x, y, z, t, a)
tmp = (y * x) / a;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(N[(y * x), $MachinePrecision] / a), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\frac{y \cdot x}{a}
\end{array}
Initial program 92.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f6448.5
Applied rewrites48.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 2024249
(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))