
(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 7 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))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 2e+287)))
(fma -1.0 (/ t (/ a z)) (/ y (/ a x)))
(/ 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 <= -((double) INFINITY)) || !(t_1 <= 2e+287)) {
tmp = fma(-1.0, (t / (a / z)), (y / (a / x)));
} 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 <= Float64(-Inf)) || !(t_1 <= 2e+287)) tmp = fma(-1.0, Float64(t / Float64(a / z)), Float64(y / Float64(a / x))); else tmp = Float64(t_1 / a); end return 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, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+287]], $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}
\\
\begin{array}{l}
t_1 := x \cdot y - z \cdot t\\
\mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 2 \cdot 10^{+287}\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)) < -inf.0 or 2.0000000000000002e287 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 59.3%
Taylor expanded in x around 0 56.0%
fma-def56.0%
associate-/l*71.5%
associate-/l*89.9%
Simplified89.9%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 2.0000000000000002e287Initial program 97.7%
Final simplification95.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* x y) (* z t))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 2e+287)))
(- (/ x (/ a y)) (/ z (/ a t)))
(/ 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 <= -((double) INFINITY)) || !(t_1 <= 2e+287)) {
tmp = (x / (a / y)) - (z / (a / t));
} else {
tmp = t_1 / a;
}
return tmp;
}
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 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 2e+287)) {
tmp = (x / (a / y)) - (z / (a / t));
} 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 <= -math.inf) or not (t_1 <= 2e+287): tmp = (x / (a / y)) - (z / (a / t)) 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 <= Float64(-Inf)) || !(t_1 <= 2e+287)) tmp = Float64(Float64(x / Float64(a / y)) - Float64(z / Float64(a / t))); 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 <= -Inf) || ~((t_1 <= 2e+287))) tmp = (x / (a / y)) - (z / (a / t)); 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, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+287]], $MachinePrecision]], N[(N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision] - N[(z / N[(a / t), $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 -\infty \lor \neg \left(t_1 \leq 2 \cdot 10^{+287}\right):\\
\;\;\;\;\frac{x}{\frac{a}{y}} - \frac{z}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1}{a}\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0 or 2.0000000000000002e287 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 59.3%
div-sub56.0%
associate-/l*69.9%
associate-/l*86.7%
Applied egg-rr86.7%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 2.0000000000000002e287Initial program 97.7%
Final simplification95.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* z (- t)) a)))
(if (<= (* x y) -2e+86)
(* y (/ x a))
(if (<= (* x y) -1e+33)
t_1
(if (<= (* x y) -5e-67)
(/ (* x y) a)
(if (<= (* x y) 4000000000.0) t_1 (/ y (/ a x))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z * -t) / a;
double tmp;
if ((x * y) <= -2e+86) {
tmp = y * (x / a);
} else if ((x * y) <= -1e+33) {
tmp = t_1;
} else if ((x * y) <= -5e-67) {
tmp = (x * y) / a;
} else if ((x * y) <= 4000000000.0) {
tmp = t_1;
} else {
tmp = y / (a / x);
}
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 = (z * -t) / a
if ((x * y) <= (-2d+86)) then
tmp = y * (x / a)
else if ((x * y) <= (-1d+33)) then
tmp = t_1
else if ((x * y) <= (-5d-67)) then
tmp = (x * y) / a
else if ((x * y) <= 4000000000.0d0) then
tmp = t_1
else
tmp = y / (a / x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z * -t) / a;
double tmp;
if ((x * y) <= -2e+86) {
tmp = y * (x / a);
} else if ((x * y) <= -1e+33) {
tmp = t_1;
} else if ((x * y) <= -5e-67) {
tmp = (x * y) / a;
} else if ((x * y) <= 4000000000.0) {
tmp = t_1;
} else {
tmp = y / (a / x);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z * -t) / a tmp = 0 if (x * y) <= -2e+86: tmp = y * (x / a) elif (x * y) <= -1e+33: tmp = t_1 elif (x * y) <= -5e-67: tmp = (x * y) / a elif (x * y) <= 4000000000.0: tmp = t_1 else: tmp = y / (a / x) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z * Float64(-t)) / a) tmp = 0.0 if (Float64(x * y) <= -2e+86) tmp = Float64(y * Float64(x / a)); elseif (Float64(x * y) <= -1e+33) tmp = t_1; elseif (Float64(x * y) <= -5e-67) tmp = Float64(Float64(x * y) / a); elseif (Float64(x * y) <= 4000000000.0) tmp = t_1; else tmp = Float64(y / Float64(a / x)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z * -t) / a; tmp = 0.0; if ((x * y) <= -2e+86) tmp = y * (x / a); elseif ((x * y) <= -1e+33) tmp = t_1; elseif ((x * y) <= -5e-67) tmp = (x * y) / a; elseif ((x * y) <= 4000000000.0) tmp = t_1; else tmp = y / (a / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z * (-t)), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+86], N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1e+33], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -5e-67], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4000000000.0], t$95$1, N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot \left(-t\right)}{a}\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+86}:\\
\;\;\;\;y \cdot \frac{x}{a}\\
\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{+33}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{-67}:\\
\;\;\;\;\frac{x \cdot y}{a}\\
\mathbf{elif}\;x \cdot y \leq 4000000000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\end{array}
\end{array}
if (*.f64 x y) < -2e86Initial program 85.5%
Taylor expanded in x around inf 78.2%
associate-*r/88.2%
Simplified88.2%
if -2e86 < (*.f64 x y) < -9.9999999999999995e32 or -4.9999999999999999e-67 < (*.f64 x y) < 4e9Initial program 93.0%
Taylor expanded in x around 0 79.6%
associate-*r/79.6%
associate-*r*79.6%
neg-mul-179.6%
Simplified79.6%
if -9.9999999999999995e32 < (*.f64 x y) < -4.9999999999999999e-67Initial program 95.7%
Taylor expanded in x around inf 74.7%
if 4e9 < (*.f64 x y) Initial program 79.2%
Taylor expanded in x around inf 67.5%
associate-/l*70.1%
Simplified70.1%
Final simplification78.1%
(FPCore (x y z t a) :precision binary64 (if (<= (* z t) (- INFINITY)) (* t (/ (- z) a)) (if (<= (* z t) 2e+295) (/ (- (* x y) (* z t)) a) (* z (/ (- t) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z * t) <= -((double) INFINITY)) {
tmp = t * (-z / a);
} else if ((z * t) <= 2e+295) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = z * (-t / a);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z * t) <= -Double.POSITIVE_INFINITY) {
tmp = t * (-z / a);
} else if ((z * t) <= 2e+295) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = z * (-t / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z * t) <= -math.inf: tmp = t * (-z / a) elif (z * t) <= 2e+295: tmp = ((x * y) - (z * t)) / a else: tmp = z * (-t / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(z * t) <= Float64(-Inf)) tmp = Float64(t * Float64(Float64(-z) / a)); elseif (Float64(z * t) <= 2e+295) tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a); else tmp = Float64(z * Float64(Float64(-t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z * t) <= -Inf) tmp = t * (-z / a); elseif ((z * t) <= 2e+295) tmp = ((x * y) - (z * t)) / a; else tmp = z * (-t / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(z * t), $MachinePrecision], (-Infinity)], N[(t * N[((-z) / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 2e+295], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(z * N[((-t) / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -\infty:\\
\;\;\;\;t \cdot \frac{-z}{a}\\
\mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{+295}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{-t}{a}\\
\end{array}
\end{array}
if (*.f64 z t) < -inf.0Initial program 49.7%
Taylor expanded in x around 0 49.7%
associate-*r/49.7%
mul-1-neg49.7%
distribute-rgt-neg-out49.7%
*-commutative49.7%
associate-/l*88.2%
associate-/r/88.0%
Simplified88.0%
if -inf.0 < (*.f64 z t) < 2e295Initial program 94.1%
if 2e295 < (*.f64 z t) Initial program 56.5%
div-inv56.5%
fma-neg67.9%
*-commutative67.9%
distribute-rgt-neg-in67.9%
Applied egg-rr67.9%
Taylor expanded in x around 0 67.9%
mul-1-neg67.9%
associate-*l/94.4%
distribute-rgt-neg-in94.4%
Simplified94.4%
Final simplification93.8%
(FPCore (x y z t a) :precision binary64 (if (<= y -1.4e-97) (/ y (/ a x)) (if (<= y 1.1e-15) (- (/ t (/ a z))) (* y (/ x a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.4e-97) {
tmp = y / (a / x);
} else if (y <= 1.1e-15) {
tmp = -(t / (a / z));
} 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 (y <= (-1.4d-97)) then
tmp = y / (a / x)
else if (y <= 1.1d-15) then
tmp = -(t / (a / z))
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 (y <= -1.4e-97) {
tmp = y / (a / x);
} else if (y <= 1.1e-15) {
tmp = -(t / (a / z));
} else {
tmp = y * (x / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.4e-97: tmp = y / (a / x) elif y <= 1.1e-15: tmp = -(t / (a / z)) else: tmp = y * (x / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.4e-97) tmp = Float64(y / Float64(a / x)); elseif (y <= 1.1e-15) tmp = Float64(-Float64(t / Float64(a / z))); else tmp = Float64(y * Float64(x / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.4e-97) tmp = y / (a / x); elseif (y <= 1.1e-15) tmp = -(t / (a / z)); else tmp = y * (x / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.4e-97], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.1e-15], (-N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{-97}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{-15}:\\
\;\;\;\;-\frac{t}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{a}\\
\end{array}
\end{array}
if y < -1.4000000000000001e-97Initial program 86.9%
Taylor expanded in x around inf 49.3%
associate-/l*52.5%
Simplified52.5%
if -1.4000000000000001e-97 < y < 1.09999999999999993e-15Initial program 92.6%
div-inv92.5%
fma-neg92.5%
*-commutative92.5%
distribute-rgt-neg-in92.5%
Applied egg-rr92.5%
Taylor expanded in x around 0 69.7%
mul-1-neg69.7%
associate-/l*68.9%
Simplified68.9%
if 1.09999999999999993e-15 < y Initial program 83.6%
Taylor expanded in x around inf 70.1%
associate-*r/75.3%
Simplified75.3%
Final simplification64.7%
(FPCore (x y z t a) :precision binary64 (if (<= y -1.45e-94) (/ y (/ a x)) (if (<= y 8e-16) (* t (/ (- z) a)) (* y (/ x a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.45e-94) {
tmp = y / (a / x);
} else if (y <= 8e-16) {
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 (y <= (-1.45d-94)) then
tmp = y / (a / x)
else if (y <= 8d-16) 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 (y <= -1.45e-94) {
tmp = y / (a / x);
} else if (y <= 8e-16) {
tmp = t * (-z / a);
} else {
tmp = y * (x / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.45e-94: tmp = y / (a / x) elif y <= 8e-16: tmp = t * (-z / a) else: tmp = y * (x / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.45e-94) tmp = Float64(y / Float64(a / x)); elseif (y <= 8e-16) 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 (y <= -1.45e-94) tmp = y / (a / x); elseif (y <= 8e-16) tmp = t * (-z / a); else tmp = y * (x / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.45e-94], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8e-16], N[(t * N[((-z) / a), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{-94}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\mathbf{elif}\;y \leq 8 \cdot 10^{-16}:\\
\;\;\;\;t \cdot \frac{-z}{a}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{a}\\
\end{array}
\end{array}
if y < -1.44999999999999998e-94Initial program 86.6%
Taylor expanded in x around inf 49.2%
associate-/l*52.5%
Simplified52.5%
if -1.44999999999999998e-94 < y < 7.9999999999999998e-16Initial program 92.7%
Taylor expanded in x around 0 70.2%
associate-*r/70.2%
mul-1-neg70.2%
distribute-rgt-neg-out70.2%
*-commutative70.2%
associate-/l*68.6%
associate-/r/69.1%
Simplified69.1%
if 7.9999999999999998e-16 < y Initial program 83.6%
Taylor expanded in x around inf 70.1%
associate-*r/75.3%
Simplified75.3%
Final simplification65.0%
(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 88.5%
Taylor expanded in x around inf 49.6%
associate-*r/51.2%
Simplified51.2%
Final simplification51.2%
(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 2023173
(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))