
(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 8 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 -5e+294)
(* (- (* x (/ y z)) t) (/ z a))
(if (<= t_1 2.5e+305) (/ 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 <= -5e+294) {
tmp = ((x * (y / z)) - t) * (z / a);
} else if (t_1 <= 2.5e+305) {
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 <= (-5d+294)) then
tmp = ((x * (y / z)) - t) * (z / a)
else if (t_1 <= 2.5d+305) 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 <= -5e+294) {
tmp = ((x * (y / z)) - t) * (z / a);
} else if (t_1 <= 2.5e+305) {
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 <= -5e+294: tmp = ((x * (y / z)) - t) * (z / a) elif t_1 <= 2.5e+305: 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 <= -5e+294) tmp = Float64(Float64(Float64(x * Float64(y / z)) - t) * Float64(z / a)); elseif (t_1 <= 2.5e+305) 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 <= -5e+294) tmp = ((x * (y / z)) - t) * (z / a); elseif (t_1 <= 2.5e+305) 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, -5e+294], N[(N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] * N[(z / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2.5e+305], 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 -5 \cdot 10^{+294}:\\
\;\;\;\;\left(x \cdot \frac{y}{z} - t\right) \cdot \frac{z}{a}\\
\mathbf{elif}\;t\_1 \leq 2.5 \cdot 10^{+305}:\\
\;\;\;\;\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.9999999999999999e294Initial program 76.9%
Taylor expanded in z around inf 92.8%
+-commutative92.8%
mul-1-neg92.8%
unsub-neg92.8%
*-commutative92.8%
associate-/l*92.8%
*-commutative92.8%
Simplified92.8%
Taylor expanded in z around inf 92.8%
+-commutative92.8%
mul-1-neg92.8%
sub-neg92.8%
times-frac92.7%
associate-*l/95.2%
associate-/l*92.9%
div-sub95.3%
associate-/l*76.9%
*-commutative76.9%
associate-/l*95.2%
associate-/l*97.5%
Simplified97.5%
if -4.9999999999999999e294 < (-.f64 (*.f64 x y) (*.f64 z t)) < 2.50000000000000004e305Initial program 97.8%
if 2.50000000000000004e305 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 64.2%
Taylor expanded in t around inf 75.5%
+-commutative75.5%
mul-1-neg75.5%
unsub-neg75.5%
times-frac83.1%
Simplified83.1%
Taylor expanded in t around inf 75.5%
associate-/l*83.3%
associate-/l/87.3%
+-commutative87.3%
mul-1-neg87.3%
sub-neg87.3%
associate-*r/87.3%
div-sub99.8%
Simplified99.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* x y) a)))
(if (<= (* x y) -4e-132)
t_1
(if (<= (* x y) 4e-95)
(* t (/ (- z) a))
(if (or (<= (* x y) 2e-48) (not (<= (* x y) 5e-11)))
t_1
(/ (* t (- z)) a))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) / a;
double tmp;
if ((x * y) <= -4e-132) {
tmp = t_1;
} else if ((x * y) <= 4e-95) {
tmp = t * (-z / a);
} else if (((x * y) <= 2e-48) || !((x * y) <= 5e-11)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (x * y) / a
if ((x * y) <= (-4d-132)) then
tmp = t_1
else if ((x * y) <= 4d-95) then
tmp = t * (-z / a)
else if (((x * y) <= 2d-48) .or. (.not. ((x * y) <= 5d-11))) then
tmp = t_1
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 t_1 = (x * y) / a;
double tmp;
if ((x * y) <= -4e-132) {
tmp = t_1;
} else if ((x * y) <= 4e-95) {
tmp = t * (-z / a);
} else if (((x * y) <= 2e-48) || !((x * y) <= 5e-11)) {
tmp = t_1;
} else {
tmp = (t * -z) / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x * y) / a tmp = 0 if (x * y) <= -4e-132: tmp = t_1 elif (x * y) <= 4e-95: tmp = t * (-z / a) elif ((x * y) <= 2e-48) or not ((x * y) <= 5e-11): tmp = t_1 else: tmp = (t * -z) / a return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) / a) tmp = 0.0 if (Float64(x * y) <= -4e-132) tmp = t_1; elseif (Float64(x * y) <= 4e-95) tmp = Float64(t * Float64(Float64(-z) / a)); elseif ((Float64(x * y) <= 2e-48) || !(Float64(x * y) <= 5e-11)) tmp = t_1; else tmp = Float64(Float64(t * Float64(-z)) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x * y) / a; tmp = 0.0; if ((x * y) <= -4e-132) tmp = t_1; elseif ((x * y) <= 4e-95) tmp = t * (-z / a); elseif (((x * y) <= 2e-48) || ~(((x * y) <= 5e-11))) tmp = t_1; else tmp = (t * -z) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -4e-132], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 4e-95], N[(t * N[((-z) / a), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(x * y), $MachinePrecision], 2e-48], N[Not[LessEqual[N[(x * y), $MachinePrecision], 5e-11]], $MachinePrecision]], t$95$1, N[(N[(t * (-z)), $MachinePrecision] / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot y}{a}\\
\mathbf{if}\;x \cdot y \leq -4 \cdot 10^{-132}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{-95}:\\
\;\;\;\;t \cdot \frac{-z}{a}\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-48} \lor \neg \left(x \cdot y \leq 5 \cdot 10^{-11}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \left(-z\right)}{a}\\
\end{array}
\end{array}
if (*.f64 x y) < -3.9999999999999999e-132 or 3.99999999999999996e-95 < (*.f64 x y) < 1.9999999999999999e-48 or 5.00000000000000018e-11 < (*.f64 x y) Initial program 92.4%
Taylor expanded in x around inf 73.6%
if -3.9999999999999999e-132 < (*.f64 x y) < 3.99999999999999996e-95Initial program 87.5%
Taylor expanded in x around 0 77.4%
mul-1-neg77.4%
associate-/l*80.1%
distribute-rgt-neg-in80.1%
distribute-neg-frac280.1%
Simplified80.1%
if 1.9999999999999999e-48 < (*.f64 x y) < 5.00000000000000018e-11Initial program 99.9%
Taylor expanded in x around 0 82.4%
associate-*r*82.4%
mul-1-neg82.4%
Simplified82.4%
Final simplification75.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* x y) (* z t))))
(if (or (<= t_1 -5e+294) (not (<= t_1 2.5e+305)))
(* t (/ (- (* x (/ y t)) z) a))
(/ 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 <= -5e+294) || !(t_1 <= 2.5e+305)) {
tmp = t * (((x * (y / t)) - z) / a);
} 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 <= (-5d+294)) .or. (.not. (t_1 <= 2.5d+305))) then
tmp = t * (((x * (y / t)) - z) / a)
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 <= -5e+294) || !(t_1 <= 2.5e+305)) {
tmp = t * (((x * (y / t)) - z) / a);
} 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 <= -5e+294) or not (t_1 <= 2.5e+305): tmp = t * (((x * (y / t)) - z) / a) 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 <= -5e+294) || !(t_1 <= 2.5e+305)) tmp = Float64(t * Float64(Float64(Float64(x * Float64(y / t)) - z) / a)); 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 <= -5e+294) || ~((t_1 <= 2.5e+305))) tmp = t * (((x * (y / t)) - z) / a); 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, -5e+294], N[Not[LessEqual[t$95$1, 2.5e+305]], $MachinePrecision]], N[(t * N[(N[(N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] / a), $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 -5 \cdot 10^{+294} \lor \neg \left(t\_1 \leq 2.5 \cdot 10^{+305}\right):\\
\;\;\;\;t \cdot \frac{x \cdot \frac{y}{t} - z}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{a}\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -4.9999999999999999e294 or 2.50000000000000004e305 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 72.2%
Taylor expanded in t around inf 84.9%
+-commutative84.9%
mul-1-neg84.9%
unsub-neg84.9%
times-frac87.6%
Simplified87.6%
Taylor expanded in t around inf 84.9%
associate-/l*89.2%
associate-/l/92.2%
+-commutative92.2%
mul-1-neg92.2%
sub-neg92.2%
associate-*r/89.3%
div-sub97.0%
Simplified97.0%
if -4.9999999999999999e294 < (-.f64 (*.f64 x y) (*.f64 z t)) < 2.50000000000000004e305Initial program 97.8%
Final simplification97.6%
(FPCore (x y z t a)
:precision binary64
(if (or (<= t -5.6e-28)
(and (not (<= t 2.35e-7)) (or (<= t 3.3e+25) (not (<= t 9e+142)))))
(* t (/ (- z) a))
(/ (* x y) a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.6e-28) || (!(t <= 2.35e-7) && ((t <= 3.3e+25) || !(t <= 9e+142)))) {
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 ((t <= (-5.6d-28)) .or. (.not. (t <= 2.35d-7)) .and. (t <= 3.3d+25) .or. (.not. (t <= 9d+142))) 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 ((t <= -5.6e-28) || (!(t <= 2.35e-7) && ((t <= 3.3e+25) || !(t <= 9e+142)))) {
tmp = t * (-z / a);
} else {
tmp = (x * y) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5.6e-28) or (not (t <= 2.35e-7) and ((t <= 3.3e+25) or not (t <= 9e+142))): tmp = t * (-z / a) else: tmp = (x * y) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5.6e-28) || (!(t <= 2.35e-7) && ((t <= 3.3e+25) || !(t <= 9e+142)))) tmp = Float64(t * Float64(Float64(-z) / a)); else tmp = Float64(Float64(x * y) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -5.6e-28) || (~((t <= 2.35e-7)) && ((t <= 3.3e+25) || ~((t <= 9e+142))))) tmp = t * (-z / a); else tmp = (x * y) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5.6e-28], And[N[Not[LessEqual[t, 2.35e-7]], $MachinePrecision], Or[LessEqual[t, 3.3e+25], N[Not[LessEqual[t, 9e+142]], $MachinePrecision]]]], N[(t * N[((-z) / a), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.6 \cdot 10^{-28} \lor \neg \left(t \leq 2.35 \cdot 10^{-7}\right) \land \left(t \leq 3.3 \cdot 10^{+25} \lor \neg \left(t \leq 9 \cdot 10^{+142}\right)\right):\\
\;\;\;\;t \cdot \frac{-z}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{a}\\
\end{array}
\end{array}
if t < -5.5999999999999996e-28 or 2.35e-7 < t < 3.3000000000000001e25 or 8.9999999999999998e142 < t Initial program 84.9%
Taylor expanded in x around 0 59.0%
mul-1-neg59.0%
associate-/l*67.8%
distribute-rgt-neg-in67.8%
distribute-neg-frac267.8%
Simplified67.8%
if -5.5999999999999996e-28 < t < 2.35e-7 or 3.3000000000000001e25 < t < 8.9999999999999998e142Initial program 95.9%
Taylor expanded in x around inf 70.9%
Final simplification69.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* x y) a)) (t_2 (* t (/ (- z) a))))
(if (<= t -3.9e-25)
t_2
(if (<= t 1e-6)
t_1
(if (<= t 7e+25) (* z (/ t (- a))) (if (<= t 9e+143) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) / a;
double t_2 = t * (-z / a);
double tmp;
if (t <= -3.9e-25) {
tmp = t_2;
} else if (t <= 1e-6) {
tmp = t_1;
} else if (t <= 7e+25) {
tmp = z * (t / -a);
} else if (t <= 9e+143) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = (x * y) / a
t_2 = t * (-z / a)
if (t <= (-3.9d-25)) then
tmp = t_2
else if (t <= 1d-6) then
tmp = t_1
else if (t <= 7d+25) then
tmp = z * (t / -a)
else if (t <= 9d+143) then
tmp = t_1
else
tmp = t_2
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) / a;
double t_2 = t * (-z / a);
double tmp;
if (t <= -3.9e-25) {
tmp = t_2;
} else if (t <= 1e-6) {
tmp = t_1;
} else if (t <= 7e+25) {
tmp = z * (t / -a);
} else if (t <= 9e+143) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x * y) / a t_2 = t * (-z / a) tmp = 0 if t <= -3.9e-25: tmp = t_2 elif t <= 1e-6: tmp = t_1 elif t <= 7e+25: tmp = z * (t / -a) elif t <= 9e+143: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) / a) t_2 = Float64(t * Float64(Float64(-z) / a)) tmp = 0.0 if (t <= -3.9e-25) tmp = t_2; elseif (t <= 1e-6) tmp = t_1; elseif (t <= 7e+25) tmp = Float64(z * Float64(t / Float64(-a))); elseif (t <= 9e+143) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x * y) / a; t_2 = t * (-z / a); tmp = 0.0; if (t <= -3.9e-25) tmp = t_2; elseif (t <= 1e-6) tmp = t_1; elseif (t <= 7e+25) tmp = z * (t / -a); elseif (t <= 9e+143) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[((-z) / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.9e-25], t$95$2, If[LessEqual[t, 1e-6], t$95$1, If[LessEqual[t, 7e+25], N[(z * N[(t / (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9e+143], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot y}{a}\\
t_2 := t \cdot \frac{-z}{a}\\
\mathbf{if}\;t \leq -3.9 \cdot 10^{-25}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 10^{-6}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7 \cdot 10^{+25}:\\
\;\;\;\;z \cdot \frac{t}{-a}\\
\mathbf{elif}\;t \leq 9 \cdot 10^{+143}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -3.9e-25 or 8.9999999999999993e143 < t Initial program 83.9%
Taylor expanded in x around 0 58.5%
mul-1-neg58.5%
associate-/l*68.4%
distribute-rgt-neg-in68.4%
distribute-neg-frac268.4%
Simplified68.4%
if -3.9e-25 < t < 9.99999999999999955e-7 or 6.99999999999999999e25 < t < 8.9999999999999993e143Initial program 96.0%
Taylor expanded in x around inf 71.1%
if 9.99999999999999955e-7 < t < 6.99999999999999999e25Initial program 91.9%
Taylor expanded in x around 0 67.8%
*-commutative67.8%
associate-*r/67.9%
neg-mul-167.9%
distribute-rgt-neg-in67.9%
distribute-frac-neg67.9%
Simplified67.9%
Final simplification69.9%
(FPCore (x y z t a) :precision binary64 (if (<= (* z t) 5e+276) (/ (- (* x y) (* z t)) a) (* t (/ (- z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z * t) <= 5e+276) {
tmp = ((x * y) - (z * t)) / 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 * t) <= 5d+276) then
tmp = ((x * y) - (z * t)) / 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 * t) <= 5e+276) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = t * (-z / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z * t) <= 5e+276: tmp = ((x * y) - (z * t)) / a else: tmp = t * (-z / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(z * t) <= 5e+276) tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / 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 * t) <= 5e+276) tmp = ((x * y) - (z * t)) / a; else tmp = t * (-z / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(z * t), $MachinePrecision], 5e+276], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(t * N[((-z) / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq 5 \cdot 10^{+276}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{-z}{a}\\
\end{array}
\end{array}
if (*.f64 z t) < 5.00000000000000001e276Initial program 94.5%
if 5.00000000000000001e276 < (*.f64 z t) Initial program 61.8%
Taylor expanded in x around 0 65.8%
mul-1-neg65.8%
associate-/l*95.9%
distribute-rgt-neg-in95.9%
distribute-neg-frac295.9%
Simplified95.9%
Final simplification94.6%
(FPCore (x y z t a) :precision binary64 (if (<= t 1.05e-58) (/ (* x y) a) (* x (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.05e-58) {
tmp = (x * y) / 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 (t <= 1.05d-58) then
tmp = (x * y) / 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 (t <= 1.05e-58) {
tmp = (x * y) / a;
} else {
tmp = x * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 1.05e-58: tmp = (x * y) / a else: tmp = x * (y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 1.05e-58) tmp = Float64(Float64(x * y) / 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 (t <= 1.05e-58) tmp = (x * y) / a; else tmp = x * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 1.05e-58], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision], N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.05 \cdot 10^{-58}:\\
\;\;\;\;\frac{x \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < 1.04999999999999994e-58Initial program 93.5%
Taylor expanded in x around inf 64.3%
if 1.04999999999999994e-58 < t Initial program 85.7%
Taylor expanded in x around inf 37.7%
associate-*r/42.3%
Simplified42.3%
(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 56.6%
associate-*r/55.8%
Simplified55.8%
(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 2024111
(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))