
(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}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* x y) (* z t))))
(if (<= t_1 (- INFINITY))
(fma x (/ y a) (/ (- z) (/ a t)))
(if (<= t_1 1e+289) (/ t_1 a) (- (/ x (/ a y)) (/ z (/ a 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 <= -((double) INFINITY)) {
tmp = fma(x, (y / a), (-z / (a / t)));
} else if (t_1 <= 1e+289) {
tmp = t_1 / a;
} else {
tmp = (x / (a / y)) - (z / (a / t));
}
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)) tmp = fma(x, Float64(y / a), Float64(Float64(-z) / Float64(a / t))); elseif (t_1 <= 1e+289) tmp = Float64(t_1 / a); else tmp = Float64(Float64(x / Float64(a / y)) - Float64(z / Float64(a / t))); 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[LessEqual[t$95$1, (-Infinity)], N[(x * N[(y / a), $MachinePrecision] + N[((-z) / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+289], N[(t$95$1 / a), $MachinePrecision], N[(N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision] - N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y - z \cdot t\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(x, \frac{y}{a}, \frac{-z}{\frac{a}{t}}\right)\\
\mathbf{elif}\;t_1 \leq 10^{+289}:\\
\;\;\;\;\frac{t_1}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{a}{y}} - \frac{z}{\frac{a}{t}}\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0Initial program 58.9%
div-sub56.0%
*-un-lft-identity56.0%
times-frac83.3%
fma-neg86.2%
associate-/l*99.9%
Applied egg-rr99.9%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 1.0000000000000001e289Initial program 99.2%
if 1.0000000000000001e289 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 65.1%
div-sub62.1%
associate-/l*82.2%
associate-/l*93.8%
Applied egg-rr93.8%
Final simplification98.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* x y) (* z t))))
(if (or (<= t_1 -2e+275) (not (<= t_1 1e+289)))
(- (/ 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 <= -2e+275) || !(t_1 <= 1e+289)) {
tmp = (x / (a / y)) - (z / (a / t));
} 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 <= (-2d+275)) .or. (.not. (t_1 <= 1d+289))) then
tmp = (x / (a / y)) - (z / (a / t))
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 <= -2e+275) || !(t_1 <= 1e+289)) {
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 <= -2e+275) or not (t_1 <= 1e+289): 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 <= -2e+275) || !(t_1 <= 1e+289)) 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 <= -2e+275) || ~((t_1 <= 1e+289))) 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, -2e+275], N[Not[LessEqual[t$95$1, 1e+289]], $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 -2 \cdot 10^{+275} \lor \neg \left(t_1 \leq 10^{+289}\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)) < -1.99999999999999992e275 or 1.0000000000000001e289 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 66.9%
div-sub64.3%
associate-/l*85.0%
associate-/l*96.0%
Applied egg-rr96.0%
if -1.99999999999999992e275 < (-.f64 (*.f64 x y) (*.f64 z t)) < 1.0000000000000001e289Initial program 99.1%
Final simplification98.2%
(FPCore (x y z t a)
:precision binary64
(if (<= (* x y) -2e+275)
(/ x (/ a y))
(if (<= (* x y) 1e+211)
(/ (- (* x y) (* z t)) a)
(* x (/ -1.0 (/ (- a) y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -2e+275) {
tmp = x / (a / y);
} else if ((x * y) <= 1e+211) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = x * (-1.0 / (-a / y));
}
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) <= (-2d+275)) then
tmp = x / (a / y)
else if ((x * y) <= 1d+211) then
tmp = ((x * y) - (z * t)) / a
else
tmp = x * ((-1.0d0) / (-a / y))
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) <= -2e+275) {
tmp = x / (a / y);
} else if ((x * y) <= 1e+211) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = x * (-1.0 / (-a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x * y) <= -2e+275: tmp = x / (a / y) elif (x * y) <= 1e+211: tmp = ((x * y) - (z * t)) / a else: tmp = x * (-1.0 / (-a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= -2e+275) tmp = Float64(x / Float64(a / y)); elseif (Float64(x * y) <= 1e+211) tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a); else tmp = Float64(x * Float64(-1.0 / Float64(Float64(-a) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x * y) <= -2e+275) tmp = x / (a / y); elseif ((x * y) <= 1e+211) tmp = ((x * y) - (z * t)) / a; else tmp = x * (-1.0 / (-a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], -2e+275], N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+211], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(x * N[(-1.0 / N[((-a) / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+275}:\\
\;\;\;\;\frac{x}{\frac{a}{y}}\\
\mathbf{elif}\;x \cdot y \leq 10^{+211}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\frac{-a}{y}}\\
\end{array}
\end{array}
if (*.f64 x y) < -1.99999999999999992e275Initial program 54.9%
Taylor expanded in x around inf 54.9%
associate-*r/92.0%
Simplified92.0%
*-commutative92.0%
associate-/r/92.1%
Applied egg-rr92.1%
if -1.99999999999999992e275 < (*.f64 x y) < 9.9999999999999996e210Initial program 96.0%
if 9.9999999999999996e210 < (*.f64 x y) Initial program 70.4%
Taylor expanded in x around inf 74.3%
*-commutative74.3%
associate-/l*99.6%
frac-2neg99.6%
div-inv99.7%
Applied egg-rr99.7%
Final simplification96.0%
(FPCore (x y z t a) :precision binary64 (if (<= (* x y) -4e-7) (/ y (/ a x)) (if (<= (* x y) 1.5e+33) (- (/ (* z t) a)) (* x (/ -1.0 (/ (- a) y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -4e-7) {
tmp = y / (a / x);
} else if ((x * y) <= 1.5e+33) {
tmp = -((z * t) / a);
} else {
tmp = x * (-1.0 / (-a / y));
}
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) <= (-4d-7)) then
tmp = y / (a / x)
else if ((x * y) <= 1.5d+33) then
tmp = -((z * t) / a)
else
tmp = x * ((-1.0d0) / (-a / y))
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) <= -4e-7) {
tmp = y / (a / x);
} else if ((x * y) <= 1.5e+33) {
tmp = -((z * t) / a);
} else {
tmp = x * (-1.0 / (-a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x * y) <= -4e-7: tmp = y / (a / x) elif (x * y) <= 1.5e+33: tmp = -((z * t) / a) else: tmp = x * (-1.0 / (-a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= -4e-7) tmp = Float64(y / Float64(a / x)); elseif (Float64(x * y) <= 1.5e+33) tmp = Float64(-Float64(Float64(z * t) / a)); else tmp = Float64(x * Float64(-1.0 / Float64(Float64(-a) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x * y) <= -4e-7) tmp = y / (a / x); elseif ((x * y) <= 1.5e+33) tmp = -((z * t) / a); else tmp = x * (-1.0 / (-a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], -4e-7], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.5e+33], (-N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), N[(x * N[(-1.0 / N[((-a) / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -4 \cdot 10^{-7}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\mathbf{elif}\;x \cdot y \leq 1.5 \cdot 10^{+33}:\\
\;\;\;\;-\frac{z \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\frac{-a}{y}}\\
\end{array}
\end{array}
if (*.f64 x y) < -3.9999999999999998e-7Initial program 79.6%
Taylor expanded in x around inf 64.1%
associate-/l*75.4%
Simplified75.4%
if -3.9999999999999998e-7 < (*.f64 x y) < 1.49999999999999992e33Initial program 96.8%
Taylor expanded in x around 0 77.4%
associate-*r/77.4%
associate-*r*77.4%
neg-mul-177.4%
Simplified77.4%
if 1.49999999999999992e33 < (*.f64 x y) Initial program 83.5%
Taylor expanded in x around inf 68.4%
*-commutative68.4%
associate-/l*72.1%
frac-2neg72.1%
div-inv71.7%
Applied egg-rr71.7%
Final simplification75.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6.4e+176)
(* z (/ (- t) a))
(if (<= z -8.2e+80)
(/ y (/ a x))
(if (or (<= z -4.4e-13) (not (<= z 1.25e-38)))
(* t (- (/ z a)))
(* x (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.4e+176) {
tmp = z * (-t / a);
} else if (z <= -8.2e+80) {
tmp = y / (a / x);
} else if ((z <= -4.4e-13) || !(z <= 1.25e-38)) {
tmp = t * -(z / a);
} else {
tmp = x * (y / 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 (z <= (-6.4d+176)) then
tmp = z * (-t / a)
else if (z <= (-8.2d+80)) then
tmp = y / (a / x)
else if ((z <= (-4.4d-13)) .or. (.not. (z <= 1.25d-38))) then
tmp = t * -(z / a)
else
tmp = x * (y / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.4e+176) {
tmp = z * (-t / a);
} else if (z <= -8.2e+80) {
tmp = y / (a / x);
} else if ((z <= -4.4e-13) || !(z <= 1.25e-38)) {
tmp = t * -(z / a);
} else {
tmp = x * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.4e+176: tmp = z * (-t / a) elif z <= -8.2e+80: tmp = y / (a / x) elif (z <= -4.4e-13) or not (z <= 1.25e-38): tmp = t * -(z / a) else: tmp = x * (y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.4e+176) tmp = Float64(z * Float64(Float64(-t) / a)); elseif (z <= -8.2e+80) tmp = Float64(y / Float64(a / x)); elseif ((z <= -4.4e-13) || !(z <= 1.25e-38)) tmp = Float64(t * Float64(-Float64(z / a))); else tmp = Float64(x * Float64(y / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6.4e+176) tmp = z * (-t / a); elseif (z <= -8.2e+80) tmp = y / (a / x); elseif ((z <= -4.4e-13) || ~((z <= 1.25e-38))) tmp = t * -(z / a); else tmp = x * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.4e+176], N[(z * N[((-t) / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -8.2e+80], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -4.4e-13], N[Not[LessEqual[z, 1.25e-38]], $MachinePrecision]], N[(t * (-N[(z / a), $MachinePrecision])), $MachinePrecision], N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.4 \cdot 10^{+176}:\\
\;\;\;\;z \cdot \frac{-t}{a}\\
\mathbf{elif}\;z \leq -8.2 \cdot 10^{+80}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\mathbf{elif}\;z \leq -4.4 \cdot 10^{-13} \lor \neg \left(z \leq 1.25 \cdot 10^{-38}\right):\\
\;\;\;\;t \cdot \left(-\frac{z}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -6.3999999999999996e176Initial program 85.5%
div-sub81.8%
*-un-lft-identity81.8%
times-frac78.5%
fma-neg82.2%
associate-/l*92.6%
Applied egg-rr92.6%
fma-udef88.9%
frac-times91.1%
*-commutative91.1%
*-un-lft-identity91.1%
associate-*r/91.2%
associate-*r/91.1%
distribute-neg-frac91.1%
frac-add59.8%
Applied egg-rr59.8%
distribute-rgt-neg-out59.8%
sub-neg59.8%
div-sub45.0%
times-frac48.9%
*-inverses56.3%
associate-*l/56.3%
*-rgt-identity56.3%
associate-*l/56.3%
*-commutative56.3%
*-commutative56.3%
*-commutative56.3%
times-frac91.2%
Simplified91.2%
Taylor expanded in y around 0 82.6%
mul-1-neg82.6%
associate-*l/89.2%
distribute-rgt-neg-in89.2%
Simplified89.2%
if -6.3999999999999996e176 < z < -8.20000000000000003e80Initial program 94.2%
Taylor expanded in x around inf 58.4%
associate-/l*58.2%
Simplified58.2%
if -8.20000000000000003e80 < z < -4.39999999999999993e-13 or 1.25000000000000008e-38 < z Initial program 88.5%
Taylor expanded in x around 0 56.9%
mul-1-neg56.9%
*-commutative56.9%
associate-*l/59.9%
*-commutative59.9%
distribute-lft-neg-in59.9%
Simplified59.9%
if -4.39999999999999993e-13 < z < 1.25000000000000008e-38Initial program 90.4%
Taylor expanded in x around inf 59.4%
associate-/l*65.8%
associate-/r/61.1%
Applied egg-rr61.1%
Final simplification63.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (- (/ z a)))))
(if (<= y -4.4e-120)
(* x (/ y a))
(if (<= y 2.65e-11)
t_1
(if (<= y 6.2e+56)
(/ (* x y) a)
(if (<= y 7e+96) t_1 (* y (/ x a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * -(z / a);
double tmp;
if (y <= -4.4e-120) {
tmp = x * (y / a);
} else if (y <= 2.65e-11) {
tmp = t_1;
} else if (y <= 6.2e+56) {
tmp = (x * y) / a;
} else if (y <= 7e+96) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = t * -(z / a)
if (y <= (-4.4d-120)) then
tmp = x * (y / a)
else if (y <= 2.65d-11) then
tmp = t_1
else if (y <= 6.2d+56) then
tmp = (x * y) / a
else if (y <= 7d+96) then
tmp = t_1
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 t_1 = t * -(z / a);
double tmp;
if (y <= -4.4e-120) {
tmp = x * (y / a);
} else if (y <= 2.65e-11) {
tmp = t_1;
} else if (y <= 6.2e+56) {
tmp = (x * y) / a;
} else if (y <= 7e+96) {
tmp = t_1;
} else {
tmp = y * (x / a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t * -(z / a) tmp = 0 if y <= -4.4e-120: tmp = x * (y / a) elif y <= 2.65e-11: tmp = t_1 elif y <= 6.2e+56: tmp = (x * y) / a elif y <= 7e+96: tmp = t_1 else: tmp = y * (x / a) return tmp
function code(x, y, z, t, a) t_1 = Float64(t * Float64(-Float64(z / a))) tmp = 0.0 if (y <= -4.4e-120) tmp = Float64(x * Float64(y / a)); elseif (y <= 2.65e-11) tmp = t_1; elseif (y <= 6.2e+56) tmp = Float64(Float64(x * y) / a); elseif (y <= 7e+96) tmp = t_1; else tmp = Float64(y * Float64(x / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t * -(z / a); tmp = 0.0; if (y <= -4.4e-120) tmp = x * (y / a); elseif (y <= 2.65e-11) tmp = t_1; elseif (y <= 6.2e+56) tmp = (x * y) / a; elseif (y <= 7e+96) tmp = t_1; else tmp = y * (x / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * (-N[(z / a), $MachinePrecision])), $MachinePrecision]}, If[LessEqual[y, -4.4e-120], N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.65e-11], t$95$1, If[LessEqual[y, 6.2e+56], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[y, 7e+96], t$95$1, N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(-\frac{z}{a}\right)\\
\mathbf{if}\;y \leq -4.4 \cdot 10^{-120}:\\
\;\;\;\;x \cdot \frac{y}{a}\\
\mathbf{elif}\;y \leq 2.65 \cdot 10^{-11}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{+56}:\\
\;\;\;\;\frac{x \cdot y}{a}\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+96}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{a}\\
\end{array}
\end{array}
if y < -4.40000000000000025e-120Initial program 86.9%
Taylor expanded in x around inf 50.5%
associate-/l*56.9%
associate-/r/55.4%
Applied egg-rr55.4%
if -4.40000000000000025e-120 < y < 2.6499999999999999e-11 or 6.20000000000000009e56 < y < 6.9999999999999998e96Initial program 95.9%
Taylor expanded in x around 0 74.6%
mul-1-neg74.6%
*-commutative74.6%
associate-*l/70.7%
*-commutative70.7%
distribute-lft-neg-in70.7%
Simplified70.7%
if 2.6499999999999999e-11 < y < 6.20000000000000009e56Initial program 92.9%
Taylor expanded in x around inf 64.4%
if 6.9999999999999998e96 < y Initial program 78.6%
Taylor expanded in x around inf 64.0%
associate-*r/78.0%
Simplified78.0%
Final simplification65.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2e+176)
(* z (/ (- t) a))
(if (<= z -2.5e+80)
(/ y (/ a x))
(if (<= z -1.95e-12)
(/ (- t) (/ a z))
(if (<= z 1.8e-44) (* x (/ y a)) (* t (- (/ z a))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e+176) {
tmp = z * (-t / a);
} else if (z <= -2.5e+80) {
tmp = y / (a / x);
} else if (z <= -1.95e-12) {
tmp = -t / (a / z);
} else if (z <= 1.8e-44) {
tmp = x * (y / a);
} else {
tmp = 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) :: tmp
if (z <= (-2d+176)) then
tmp = z * (-t / a)
else if (z <= (-2.5d+80)) then
tmp = y / (a / x)
else if (z <= (-1.95d-12)) then
tmp = -t / (a / z)
else if (z <= 1.8d-44) then
tmp = x * (y / a)
else
tmp = t * -(z / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e+176) {
tmp = z * (-t / a);
} else if (z <= -2.5e+80) {
tmp = y / (a / x);
} else if (z <= -1.95e-12) {
tmp = -t / (a / z);
} else if (z <= 1.8e-44) {
tmp = x * (y / a);
} else {
tmp = t * -(z / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2e+176: tmp = z * (-t / a) elif z <= -2.5e+80: tmp = y / (a / x) elif z <= -1.95e-12: tmp = -t / (a / z) elif z <= 1.8e-44: tmp = x * (y / a) else: tmp = t * -(z / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2e+176) tmp = Float64(z * Float64(Float64(-t) / a)); elseif (z <= -2.5e+80) tmp = Float64(y / Float64(a / x)); elseif (z <= -1.95e-12) tmp = Float64(Float64(-t) / Float64(a / z)); elseif (z <= 1.8e-44) tmp = Float64(x * Float64(y / a)); else tmp = Float64(t * Float64(-Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2e+176) tmp = z * (-t / a); elseif (z <= -2.5e+80) tmp = y / (a / x); elseif (z <= -1.95e-12) tmp = -t / (a / z); elseif (z <= 1.8e-44) tmp = x * (y / a); else tmp = t * -(z / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2e+176], N[(z * N[((-t) / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.5e+80], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.95e-12], N[((-t) / N[(a / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.8e-44], N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision], N[(t * (-N[(z / a), $MachinePrecision])), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+176}:\\
\;\;\;\;z \cdot \frac{-t}{a}\\
\mathbf{elif}\;z \leq -2.5 \cdot 10^{+80}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\mathbf{elif}\;z \leq -1.95 \cdot 10^{-12}:\\
\;\;\;\;\frac{-t}{\frac{a}{z}}\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-44}:\\
\;\;\;\;x \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-\frac{z}{a}\right)\\
\end{array}
\end{array}
if z < -2e176Initial program 85.5%
div-sub81.8%
*-un-lft-identity81.8%
times-frac78.5%
fma-neg82.2%
associate-/l*92.6%
Applied egg-rr92.6%
fma-udef88.9%
frac-times91.1%
*-commutative91.1%
*-un-lft-identity91.1%
associate-*r/91.2%
associate-*r/91.1%
distribute-neg-frac91.1%
frac-add59.8%
Applied egg-rr59.8%
distribute-rgt-neg-out59.8%
sub-neg59.8%
div-sub45.0%
times-frac48.9%
*-inverses56.3%
associate-*l/56.3%
*-rgt-identity56.3%
associate-*l/56.3%
*-commutative56.3%
*-commutative56.3%
*-commutative56.3%
times-frac91.2%
Simplified91.2%
Taylor expanded in y around 0 82.6%
mul-1-neg82.6%
associate-*l/89.2%
distribute-rgt-neg-in89.2%
Simplified89.2%
if -2e176 < z < -2.4999999999999998e80Initial program 94.2%
Taylor expanded in x around inf 58.4%
associate-/l*58.2%
Simplified58.2%
if -2.4999999999999998e80 < z < -1.94999999999999997e-12Initial program 95.0%
Taylor expanded in x around 0 76.4%
mul-1-neg76.4%
associate-/l*76.5%
distribute-neg-frac76.5%
Simplified76.5%
if -1.94999999999999997e-12 < z < 1.7999999999999999e-44Initial program 90.2%
Taylor expanded in x around inf 59.5%
associate-/l*66.0%
associate-/r/61.3%
Applied egg-rr61.3%
if 1.7999999999999999e-44 < z Initial program 86.9%
Taylor expanded in x around 0 51.1%
mul-1-neg51.1%
*-commutative51.1%
associate-*l/54.9%
*-commutative54.9%
distribute-lft-neg-in54.9%
Simplified54.9%
Final simplification63.5%
(FPCore (x y z t a) :precision binary64 (if (<= (* x y) -4e-7) (/ y (/ a x)) (if (<= (* x y) 1.5e+33) (- (/ (* z t) a)) (/ x (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -4e-7) {
tmp = y / (a / x);
} else if ((x * y) <= 1.5e+33) {
tmp = -((z * t) / a);
} else {
tmp = x / (a / y);
}
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) <= (-4d-7)) then
tmp = y / (a / x)
else if ((x * y) <= 1.5d+33) then
tmp = -((z * t) / a)
else
tmp = x / (a / y)
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) <= -4e-7) {
tmp = y / (a / x);
} else if ((x * y) <= 1.5e+33) {
tmp = -((z * t) / a);
} else {
tmp = x / (a / y);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x * y) <= -4e-7: tmp = y / (a / x) elif (x * y) <= 1.5e+33: tmp = -((z * t) / a) else: tmp = x / (a / y) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= -4e-7) tmp = Float64(y / Float64(a / x)); elseif (Float64(x * y) <= 1.5e+33) tmp = Float64(-Float64(Float64(z * t) / a)); else tmp = Float64(x / Float64(a / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x * y) <= -4e-7) tmp = y / (a / x); elseif ((x * y) <= 1.5e+33) tmp = -((z * t) / a); else tmp = x / (a / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], -4e-7], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.5e+33], (-N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -4 \cdot 10^{-7}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\mathbf{elif}\;x \cdot y \leq 1.5 \cdot 10^{+33}:\\
\;\;\;\;-\frac{z \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{a}{y}}\\
\end{array}
\end{array}
if (*.f64 x y) < -3.9999999999999998e-7Initial program 79.6%
Taylor expanded in x around inf 64.1%
associate-/l*75.4%
Simplified75.4%
if -3.9999999999999998e-7 < (*.f64 x y) < 1.49999999999999992e33Initial program 96.8%
Taylor expanded in x around 0 77.4%
associate-*r/77.4%
associate-*r*77.4%
neg-mul-177.4%
Simplified77.4%
if 1.49999999999999992e33 < (*.f64 x y) Initial program 83.5%
Taylor expanded in x around inf 68.4%
associate-*r/78.1%
Simplified78.1%
*-commutative78.1%
associate-/r/72.1%
Applied egg-rr72.1%
Final simplification75.7%
(FPCore (x y z t a) :precision binary64 (if (<= y -7e-306) (* x (/ y a)) (* y (/ x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -7e-306) {
tmp = x * (y / 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 <= (-7d-306)) then
tmp = x * (y / 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 <= -7e-306) {
tmp = x * (y / a);
} else {
tmp = y * (x / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -7e-306: tmp = x * (y / a) else: tmp = y * (x / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -7e-306) tmp = Float64(x * Float64(y / 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 <= -7e-306) tmp = x * (y / a); else tmp = y * (x / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -7e-306], N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{-306}:\\
\;\;\;\;x \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{a}\\
\end{array}
\end{array}
if y < -7.00000000000000035e-306Initial program 89.4%
Taylor expanded in x around inf 47.6%
associate-/l*50.2%
associate-/r/49.9%
Applied egg-rr49.9%
if -7.00000000000000035e-306 < y Initial program 89.4%
Taylor expanded in x around inf 43.7%
associate-*r/50.2%
Simplified50.2%
Final simplification50.1%
(FPCore (x y z t a) :precision binary64 (if (<= y 1.06e-291) (* x (/ y a)) (/ y (/ a x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 1.06e-291) {
tmp = x * (y / a);
} 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) :: tmp
if (y <= 1.06d-291) then
tmp = x * (y / a)
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 tmp;
if (y <= 1.06e-291) {
tmp = x * (y / a);
} else {
tmp = y / (a / x);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= 1.06e-291: tmp = x * (y / a) else: tmp = y / (a / x) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= 1.06e-291) tmp = Float64(x * Float64(y / a)); else tmp = Float64(y / Float64(a / x)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= 1.06e-291) tmp = x * (y / a); else tmp = y / (a / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, 1.06e-291], N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.06 \cdot 10^{-291}:\\
\;\;\;\;x \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\end{array}
\end{array}
if y < 1.05999999999999992e-291Initial program 89.5%
Taylor expanded in x around inf 47.3%
associate-/l*49.8%
associate-/r/49.6%
Applied egg-rr49.6%
if 1.05999999999999992e-291 < y Initial program 89.3%
Taylor expanded in x around inf 44.0%
associate-/l*50.7%
Simplified50.7%
Final simplification50.1%
(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 89.4%
Taylor expanded in x around inf 45.8%
associate-*r/50.2%
Simplified50.2%
Final simplification50.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 2023274
(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))