
(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))
(- (* x (/ y a)) (/ z (/ a t)))
(if (<= t_1 4e+264) (/ t_1 a) (* t (/ (- (* x (/ y t)) z) a))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) - (z * t);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (x * (y / a)) - (z / (a / t));
} else if (t_1 <= 4e+264) {
tmp = t_1 / a;
} else {
tmp = t * (((x * (y / t)) - z) / 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) {
tmp = (x * (y / a)) - (z / (a / t));
} else if (t_1 <= 4e+264) {
tmp = t_1 / a;
} else {
tmp = t * (((x * (y / t)) - z) / a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x * y) - (z * t) tmp = 0 if t_1 <= -math.inf: tmp = (x * (y / a)) - (z / (a / t)) elif t_1 <= 4e+264: tmp = t_1 / a else: tmp = t * (((x * (y / t)) - z) / a) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) - Float64(z * t)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(x * Float64(y / a)) - Float64(z / Float64(a / t))); elseif (t_1 <= 4e+264) tmp = Float64(t_1 / a); else tmp = Float64(t * Float64(Float64(Float64(x * Float64(y / t)) - z) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x * y) - (z * t); tmp = 0.0; if (t_1 <= -Inf) tmp = (x * (y / a)) - (z / (a / t)); elseif (t_1 <= 4e+264) tmp = t_1 / a; else tmp = t * (((x * (y / t)) - z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision] - N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+264], N[(t$95$1 / a), $MachinePrecision], N[(t * N[(N[(N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y - z \cdot t\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;x \cdot \frac{y}{a} - \frac{z}{\frac{a}{t}}\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+264}:\\
\;\;\;\;\frac{t\_1}{a}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{x \cdot \frac{y}{t} - z}{a}\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0Initial program 54.0%
div-sub47.7%
associate-/l*76.8%
associate-/l*93.4%
Applied egg-rr93.4%
clear-num93.4%
un-div-inv93.5%
Applied egg-rr93.5%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 4.00000000000000018e264Initial program 98.2%
if 4.00000000000000018e264 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 76.3%
div-sub74.3%
associate-/l*80.0%
associate-/l*91.6%
Applied egg-rr91.6%
Taylor expanded in t around inf 87.6%
times-frac93.6%
associate-*l/95.9%
div-sub98.0%
Simplified98.0%
Final simplification97.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* x y) (* z t))))
(if (<= t_1 (- INFINITY))
(- (* x (/ y a)) (* z (/ t a)))
(if (<= t_1 4e+264) (/ t_1 a) (* t (/ (- (* x (/ y t)) z) a))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) - (z * t);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (x * (y / a)) - (z * (t / a));
} else if (t_1 <= 4e+264) {
tmp = t_1 / a;
} else {
tmp = t * (((x * (y / t)) - z) / 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) {
tmp = (x * (y / a)) - (z * (t / a));
} else if (t_1 <= 4e+264) {
tmp = t_1 / a;
} else {
tmp = t * (((x * (y / t)) - z) / a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x * y) - (z * t) tmp = 0 if t_1 <= -math.inf: tmp = (x * (y / a)) - (z * (t / a)) elif t_1 <= 4e+264: tmp = t_1 / a else: tmp = t * (((x * (y / t)) - z) / a) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) - Float64(z * t)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(x * Float64(y / a)) - Float64(z * Float64(t / a))); elseif (t_1 <= 4e+264) tmp = Float64(t_1 / a); else tmp = Float64(t * Float64(Float64(Float64(x * Float64(y / t)) - z) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x * y) - (z * t); tmp = 0.0; if (t_1 <= -Inf) tmp = (x * (y / a)) - (z * (t / a)); elseif (t_1 <= 4e+264) tmp = t_1 / a; else tmp = t * (((x * (y / t)) - z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision] - N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+264], N[(t$95$1 / a), $MachinePrecision], N[(t * N[(N[(N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y - z \cdot t\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;x \cdot \frac{y}{a} - z \cdot \frac{t}{a}\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+264}:\\
\;\;\;\;\frac{t\_1}{a}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{x \cdot \frac{y}{t} - z}{a}\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0Initial program 54.0%
div-sub47.7%
associate-/l*76.8%
associate-/l*93.4%
Applied egg-rr93.4%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 4.00000000000000018e264Initial program 98.2%
if 4.00000000000000018e264 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 76.3%
div-sub74.3%
associate-/l*80.0%
associate-/l*91.6%
Applied egg-rr91.6%
Taylor expanded in t around inf 87.6%
times-frac93.6%
associate-*l/95.9%
div-sub98.0%
Simplified98.0%
Final simplification97.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- (* x y) (* z t)))) (if (<= t_1 4e+264) (/ t_1 a) (* t (/ (- (* x (/ y t)) z) a)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) - (z * t);
double tmp;
if (t_1 <= 4e+264) {
tmp = t_1 / a;
} else {
tmp = t * (((x * (y / t)) - z) / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) - (z * t)
if (t_1 <= 4d+264) then
tmp = t_1 / a
else
tmp = t * (((x * (y / t)) - z) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) - (z * t);
double tmp;
if (t_1 <= 4e+264) {
tmp = t_1 / a;
} else {
tmp = t * (((x * (y / t)) - z) / a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x * y) - (z * t) tmp = 0 if t_1 <= 4e+264: tmp = t_1 / a else: tmp = t * (((x * (y / t)) - z) / a) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) - Float64(z * t)) tmp = 0.0 if (t_1 <= 4e+264) tmp = Float64(t_1 / a); else tmp = Float64(t * Float64(Float64(Float64(x * Float64(y / t)) - z) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x * y) - (z * t); tmp = 0.0; if (t_1 <= 4e+264) tmp = t_1 / a; else tmp = t * (((x * (y / t)) - z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 4e+264], N[(t$95$1 / a), $MachinePrecision], N[(t * N[(N[(N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y - z \cdot t\\
\mathbf{if}\;t\_1 \leq 4 \cdot 10^{+264}:\\
\;\;\;\;\frac{t\_1}{a}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{x \cdot \frac{y}{t} - z}{a}\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < 4.00000000000000018e264Initial program 94.8%
if 4.00000000000000018e264 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 76.3%
div-sub74.3%
associate-/l*80.0%
associate-/l*91.6%
Applied egg-rr91.6%
Taylor expanded in t around inf 87.6%
times-frac93.6%
associate-*l/95.9%
div-sub98.0%
Simplified98.0%
Final simplification95.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= (* z t) -5e-71) (not (<= (* z t) 5e+69))) (/ (- z) (/ a t)) (/ y (/ a x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((z * t) <= -5e-71) || !((z * t) <= 5e+69)) {
tmp = -z / (a / t);
} 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 (((z * t) <= (-5d-71)) .or. (.not. ((z * t) <= 5d+69))) then
tmp = -z / (a / t)
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 (((z * t) <= -5e-71) || !((z * t) <= 5e+69)) {
tmp = -z / (a / t);
} else {
tmp = y / (a / x);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((z * t) <= -5e-71) or not ((z * t) <= 5e+69): tmp = -z / (a / t) else: tmp = y / (a / x) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((Float64(z * t) <= -5e-71) || !(Float64(z * t) <= 5e+69)) tmp = Float64(Float64(-z) / Float64(a / t)); else tmp = Float64(y / Float64(a / x)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((z * t) <= -5e-71) || ~(((z * t) <= 5e+69))) tmp = -z / (a / t); else tmp = y / (a / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(z * t), $MachinePrecision], -5e-71], N[Not[LessEqual[N[(z * t), $MachinePrecision], 5e+69]], $MachinePrecision]], N[((-z) / N[(a / t), $MachinePrecision]), $MachinePrecision], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -5 \cdot 10^{-71} \lor \neg \left(z \cdot t \leq 5 \cdot 10^{+69}\right):\\
\;\;\;\;\frac{-z}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\end{array}
\end{array}
if (*.f64 z t) < -4.99999999999999998e-71 or 5.00000000000000036e69 < (*.f64 z t) Initial program 90.9%
Taylor expanded in x around 0 76.8%
*-commutative76.8%
associate-*r/78.2%
neg-mul-178.2%
distribute-rgt-neg-in78.2%
distribute-frac-neg78.2%
Simplified78.2%
distribute-frac-neg78.2%
distribute-rgt-neg-in78.2%
clear-num78.1%
div-inv78.5%
distribute-neg-frac78.5%
Applied egg-rr78.5%
if -4.99999999999999998e-71 < (*.f64 z t) < 5.00000000000000036e69Initial program 91.7%
div-sub90.9%
associate-/l*93.2%
associate-/l*91.2%
Applied egg-rr91.2%
clear-num90.9%
un-div-inv90.9%
Applied egg-rr90.9%
Taylor expanded in x around inf 73.3%
*-commutative73.3%
associate-*l/75.7%
associate-/r/76.3%
Simplified76.3%
Final simplification77.5%
(FPCore (x y z t a) :precision binary64 (if (<= (* x y) -4e+14) (/ y (/ a x)) (if (<= (* x y) 2e+74) (* t (/ z (- a))) (/ x (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -4e+14) {
tmp = y / (a / x);
} else if ((x * y) <= 2e+74) {
tmp = t * (z / -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+14)) then
tmp = y / (a / x)
else if ((x * y) <= 2d+74) then
tmp = t * (z / -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+14) {
tmp = y / (a / x);
} else if ((x * y) <= 2e+74) {
tmp = t * (z / -a);
} else {
tmp = x / (a / y);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x * y) <= -4e+14: tmp = y / (a / x) elif (x * y) <= 2e+74: tmp = t * (z / -a) else: tmp = x / (a / y) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= -4e+14) tmp = Float64(y / Float64(a / x)); elseif (Float64(x * y) <= 2e+74) tmp = Float64(t * Float64(z / Float64(-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+14) tmp = y / (a / x); elseif ((x * y) <= 2e+74) tmp = t * (z / -a); else tmp = x / (a / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], -4e+14], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+74], N[(t * N[(z / (-a)), $MachinePrecision]), $MachinePrecision], N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -4 \cdot 10^{+14}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+74}:\\
\;\;\;\;t \cdot \frac{z}{-a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{a}{y}}\\
\end{array}
\end{array}
if (*.f64 x y) < -4e14Initial program 87.4%
div-sub80.9%
associate-/l*86.8%
associate-/l*86.8%
Applied egg-rr86.8%
clear-num86.7%
un-div-inv86.7%
Applied egg-rr86.7%
Taylor expanded in x around inf 66.9%
*-commutative66.9%
associate-*l/74.4%
associate-/r/68.0%
Simplified68.0%
if -4e14 < (*.f64 x y) < 1.9999999999999999e74Initial program 93.7%
Taylor expanded in x around 0 78.4%
mul-1-neg78.4%
associate-/l*76.0%
distribute-rgt-neg-in76.0%
distribute-neg-frac276.0%
Simplified76.0%
if 1.9999999999999999e74 < (*.f64 x y) Initial program 89.7%
Taylor expanded in x around inf 71.6%
associate-*r/78.3%
Simplified78.3%
clear-num78.2%
un-div-inv78.4%
Applied egg-rr78.4%
Final simplification74.6%
(FPCore (x y z t a) :precision binary64 (if (<= (* x y) -4e+14) (/ y (/ a x)) (if (<= (* x y) 2e+74) (* z (/ t (- a))) (/ x (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -4e+14) {
tmp = y / (a / x);
} else if ((x * y) <= 2e+74) {
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+14)) then
tmp = y / (a / x)
else if ((x * y) <= 2d+74) 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+14) {
tmp = y / (a / x);
} else if ((x * y) <= 2e+74) {
tmp = z * (t / -a);
} else {
tmp = x / (a / y);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x * y) <= -4e+14: tmp = y / (a / x) elif (x * y) <= 2e+74: 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+14) tmp = Float64(y / Float64(a / x)); elseif (Float64(x * y) <= 2e+74) tmp = Float64(z * Float64(t / Float64(-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+14) tmp = y / (a / x); elseif ((x * y) <= 2e+74) 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+14], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+74], N[(z * N[(t / (-a)), $MachinePrecision]), $MachinePrecision], N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -4 \cdot 10^{+14}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+74}:\\
\;\;\;\;z \cdot \frac{t}{-a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{a}{y}}\\
\end{array}
\end{array}
if (*.f64 x y) < -4e14Initial program 87.4%
div-sub80.9%
associate-/l*86.8%
associate-/l*86.8%
Applied egg-rr86.8%
clear-num86.7%
un-div-inv86.7%
Applied egg-rr86.7%
Taylor expanded in x around inf 66.9%
*-commutative66.9%
associate-*l/74.4%
associate-/r/68.0%
Simplified68.0%
if -4e14 < (*.f64 x y) < 1.9999999999999999e74Initial program 93.7%
Taylor expanded in x around 0 78.4%
*-commutative78.4%
associate-*r/76.8%
neg-mul-176.8%
distribute-rgt-neg-in76.8%
distribute-frac-neg76.8%
Simplified76.8%
if 1.9999999999999999e74 < (*.f64 x y) Initial program 89.7%
Taylor expanded in x around inf 71.6%
associate-*r/78.3%
Simplified78.3%
clear-num78.2%
un-div-inv78.4%
Applied egg-rr78.4%
Final simplification75.0%
(FPCore (x y z t a) :precision binary64 (if (<= (* x y) (- INFINITY)) (/ x (/ a y)) (/ (- (* x y) (* z t)) a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -((double) INFINITY)) {
tmp = x / (a / y);
} else {
tmp = ((x * y) - (z * t)) / a;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -Double.POSITIVE_INFINITY) {
tmp = x / (a / y);
} else {
tmp = ((x * y) - (z * t)) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x * y) <= -math.inf: tmp = x / (a / y) else: tmp = ((x * y) - (z * t)) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= Float64(-Inf)) tmp = Float64(x / Float64(a / y)); else tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x * y) <= -Inf) tmp = x / (a / y); else tmp = ((x * y) - (z * t)) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], (-Infinity)], N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -\infty:\\
\;\;\;\;\frac{x}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\
\end{array}
\end{array}
if (*.f64 x y) < -inf.0Initial program 16.2%
Taylor expanded in x around inf 16.2%
associate-*r/74.4%
Simplified74.4%
clear-num74.6%
un-div-inv75.0%
Applied egg-rr75.0%
if -inf.0 < (*.f64 x y) Initial program 93.7%
Final simplification93.2%
(FPCore (x y z t a) :precision binary64 (if (<= x -3.8e-228) (* y (/ x a)) (* x (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -3.8e-228) {
tmp = y * (x / 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 (x <= (-3.8d-228)) then
tmp = y * (x / 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 (x <= -3.8e-228) {
tmp = y * (x / a);
} else {
tmp = x * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -3.8e-228: tmp = y * (x / a) else: tmp = x * (y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -3.8e-228) tmp = Float64(y * Float64(x / 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 (x <= -3.8e-228) tmp = y * (x / a); else tmp = x * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -3.8e-228], N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.8 \cdot 10^{-228}:\\
\;\;\;\;y \cdot \frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{a}\\
\end{array}
\end{array}
if x < -3.7999999999999999e-228Initial program 87.6%
Taylor expanded in y around inf 80.5%
Taylor expanded in t around 0 53.7%
if -3.7999999999999999e-228 < x Initial program 94.4%
Taylor expanded in x around inf 46.4%
associate-*r/48.9%
Simplified48.9%
Final simplification51.1%
(FPCore (x y z t a) :precision binary64 (if (<= x -2e-226) (* y (/ x a)) (/ x (/ a y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -2e-226) {
tmp = y * (x / 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 <= (-2d-226)) then
tmp = y * (x / 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 <= -2e-226) {
tmp = y * (x / a);
} else {
tmp = x / (a / y);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -2e-226: tmp = y * (x / a) else: tmp = x / (a / y) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -2e-226) tmp = Float64(y * Float64(x / 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 <= -2e-226) tmp = y * (x / a); else tmp = x / (a / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -2e-226], N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision], N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{-226}:\\
\;\;\;\;y \cdot \frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{a}{y}}\\
\end{array}
\end{array}
if x < -1.99999999999999984e-226Initial program 87.6%
Taylor expanded in y around inf 80.5%
Taylor expanded in t around 0 53.7%
if -1.99999999999999984e-226 < x Initial program 94.4%
Taylor expanded in x around inf 46.4%
associate-*r/48.9%
Simplified48.9%
clear-num48.7%
un-div-inv48.8%
Applied egg-rr48.8%
Final simplification51.0%
(FPCore (x y z t a) :precision binary64 (if (<= x -3.05e-226) (/ y (/ a x)) (/ x (/ a y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -3.05e-226) {
tmp = y / (a / x);
} 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 <= (-3.05d-226)) then
tmp = y / (a / x)
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 <= -3.05e-226) {
tmp = y / (a / x);
} else {
tmp = x / (a / y);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -3.05e-226: tmp = y / (a / x) else: tmp = x / (a / y) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -3.05e-226) tmp = Float64(y / Float64(a / x)); 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 <= -3.05e-226) tmp = y / (a / x); else tmp = x / (a / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -3.05e-226], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision], N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.05 \cdot 10^{-226}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{a}{y}}\\
\end{array}
\end{array}
if x < -3.0499999999999999e-226Initial program 87.6%
div-sub84.1%
associate-/l*87.2%
associate-/l*91.2%
Applied egg-rr91.2%
clear-num91.1%
un-div-inv91.1%
Applied egg-rr91.1%
Taylor expanded in x around inf 48.8%
*-commutative48.8%
associate-*l/52.0%
associate-/r/54.2%
Simplified54.2%
if -3.0499999999999999e-226 < x Initial program 94.4%
Taylor expanded in x around inf 46.4%
associate-*r/48.9%
Simplified48.9%
clear-num48.7%
un-div-inv48.8%
Applied egg-rr48.8%
Final simplification51.2%
(FPCore (x y z t a) :precision binary64 (* x (/ y a)))
double code(double x, double y, double z, double t, double a) {
return x * (y / 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 / a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x * (y / a);
}
def code(x, y, z, t, a): return x * (y / a)
function code(x, y, z, t, a) return Float64(x * Float64(y / a)) end
function tmp = code(x, y, z, t, a) tmp = x * (y / a); end
code[x_, y_, z_, t_, a_] := N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{y}{a}
\end{array}
Initial program 91.3%
Taylor expanded in x around inf 47.4%
associate-*r/50.3%
Simplified50.3%
Final simplification50.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* (/ y a) x) (* (/ t a) z))))
(if (< z -2.468684968699548e+170)
t_1
(if (< z 6.309831121978371e-71) (/ (- (* x y) (* z t)) a) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((y / a) * x) - ((t / a) * z);
double tmp;
if (z < -2.468684968699548e+170) {
tmp = t_1;
} else if (z < 6.309831121978371e-71) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = ((y / a) * x) - ((t / a) * z)
if (z < (-2.468684968699548d+170)) then
tmp = t_1
else if (z < 6.309831121978371d-71) then
tmp = ((x * y) - (z * t)) / a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((y / a) * x) - ((t / a) * z);
double tmp;
if (z < -2.468684968699548e+170) {
tmp = t_1;
} else if (z < 6.309831121978371e-71) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((y / a) * x) - ((t / a) * z) tmp = 0 if z < -2.468684968699548e+170: tmp = t_1 elif z < 6.309831121978371e-71: tmp = ((x * y) - (z * t)) / a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(y / a) * x) - Float64(Float64(t / a) * z)) tmp = 0.0 if (z < -2.468684968699548e+170) tmp = t_1; elseif (z < 6.309831121978371e-71) tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((y / a) * x) - ((t / a) * z); tmp = 0.0; if (z < -2.468684968699548e+170) tmp = t_1; elseif (z < 6.309831121978371e-71) tmp = ((x * y) - (z * t)) / a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y / a), $MachinePrecision] * x), $MachinePrecision] - N[(N[(t / a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -2.468684968699548e+170], t$95$1, If[Less[z, 6.309831121978371e-71], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{a} \cdot x - \frac{t}{a} \cdot z\\
\mathbf{if}\;z < -2.468684968699548 \cdot 10^{+170}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z < 6.309831121978371 \cdot 10^{-71}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024079
(FPCore (x y z t a)
:name "Data.Colour.Matrix:inverse from colour-2.3.3, B"
:precision binary64
:alt
(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))