
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1): return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1) return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = (-t1 * v) / ((t1 + u) * (t1 + u)); end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1): return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1) return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = (-t1 * v) / ((t1 + u) * (t1 + u)); end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\end{array}
(FPCore (u v t1) :precision binary64 (/ (/ v (+ t1 u)) (- -1.0 (/ u t1))))
double code(double u, double v, double t1) {
return (v / (t1 + u)) / (-1.0 - (u / t1));
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = (v / (t1 + u)) / ((-1.0d0) - (u / t1))
end function
public static double code(double u, double v, double t1) {
return (v / (t1 + u)) / (-1.0 - (u / t1));
}
def code(u, v, t1): return (v / (t1 + u)) / (-1.0 - (u / t1))
function code(u, v, t1) return Float64(Float64(v / Float64(t1 + u)) / Float64(-1.0 - Float64(u / t1))) end
function tmp = code(u, v, t1) tmp = (v / (t1 + u)) / (-1.0 - (u / t1)); end
code[u_, v_, t1_] := N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] / N[(-1.0 - N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{v}{t1 + u}}{-1 - \frac{u}{t1}}
\end{array}
Initial program 67.9%
*-commutative67.9%
times-frac98.3%
neg-mul-198.3%
associate-/l*98.3%
associate-*r/98.3%
associate-/l*98.3%
associate-/l/98.3%
neg-mul-198.3%
*-lft-identity98.3%
metadata-eval98.3%
times-frac98.3%
neg-mul-198.3%
remove-double-neg98.3%
neg-mul-198.3%
sub0-neg98.3%
associate--r+98.3%
neg-sub098.3%
div-sub98.4%
distribute-frac-neg98.4%
*-inverses98.4%
metadata-eval98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (u v t1)
:precision binary64
(if (<= t1 -9.8e-107)
(/ (- v) (+ t1 u))
(if (<= t1 4e-62)
(* (/ (- t1) u) (/ v u))
(if (or (<= t1 2.35e-35) (not (<= t1 5.3e+39)))
(/ (- v) t1)
(/ (- t1) (* u (/ u v)))))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -9.8e-107) {
tmp = -v / (t1 + u);
} else if (t1 <= 4e-62) {
tmp = (-t1 / u) * (v / u);
} else if ((t1 <= 2.35e-35) || !(t1 <= 5.3e+39)) {
tmp = -v / t1;
} else {
tmp = -t1 / (u * (u / v));
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if (t1 <= (-9.8d-107)) then
tmp = -v / (t1 + u)
else if (t1 <= 4d-62) then
tmp = (-t1 / u) * (v / u)
else if ((t1 <= 2.35d-35) .or. (.not. (t1 <= 5.3d+39))) then
tmp = -v / t1
else
tmp = -t1 / (u * (u / v))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (t1 <= -9.8e-107) {
tmp = -v / (t1 + u);
} else if (t1 <= 4e-62) {
tmp = (-t1 / u) * (v / u);
} else if ((t1 <= 2.35e-35) || !(t1 <= 5.3e+39)) {
tmp = -v / t1;
} else {
tmp = -t1 / (u * (u / v));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if t1 <= -9.8e-107: tmp = -v / (t1 + u) elif t1 <= 4e-62: tmp = (-t1 / u) * (v / u) elif (t1 <= 2.35e-35) or not (t1 <= 5.3e+39): tmp = -v / t1 else: tmp = -t1 / (u * (u / v)) return tmp
function code(u, v, t1) tmp = 0.0 if (t1 <= -9.8e-107) tmp = Float64(Float64(-v) / Float64(t1 + u)); elseif (t1 <= 4e-62) tmp = Float64(Float64(Float64(-t1) / u) * Float64(v / u)); elseif ((t1 <= 2.35e-35) || !(t1 <= 5.3e+39)) tmp = Float64(Float64(-v) / t1); else tmp = Float64(Float64(-t1) / Float64(u * Float64(u / v))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (t1 <= -9.8e-107) tmp = -v / (t1 + u); elseif (t1 <= 4e-62) tmp = (-t1 / u) * (v / u); elseif ((t1 <= 2.35e-35) || ~((t1 <= 5.3e+39))) tmp = -v / t1; else tmp = -t1 / (u * (u / v)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[t1, -9.8e-107], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 4e-62], N[(N[((-t1) / u), $MachinePrecision] * N[(v / u), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t1, 2.35e-35], N[Not[LessEqual[t1, 5.3e+39]], $MachinePrecision]], N[((-v) / t1), $MachinePrecision], N[((-t1) / N[(u * N[(u / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -9.8 \cdot 10^{-107}:\\
\;\;\;\;\frac{-v}{t1 + u}\\
\mathbf{elif}\;t1 \leq 4 \cdot 10^{-62}:\\
\;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\
\mathbf{elif}\;t1 \leq 2.35 \cdot 10^{-35} \lor \neg \left(t1 \leq 5.3 \cdot 10^{+39}\right):\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{-t1}{u \cdot \frac{u}{v}}\\
\end{array}
\end{array}
if t1 < -9.79999999999999959e-107Initial program 66.5%
times-frac99.9%
Simplified99.9%
Taylor expanded in t1 around inf 76.1%
if -9.79999999999999959e-107 < t1 < 4.0000000000000002e-62Initial program 82.8%
times-frac94.6%
Simplified94.6%
Taylor expanded in t1 around 0 87.6%
Taylor expanded in t1 around 0 89.0%
associate-*r/89.0%
neg-mul-189.0%
Simplified89.0%
if 4.0000000000000002e-62 < t1 < 2.35e-35 or 5.29999999999999979e39 < t1 Initial program 49.1%
times-frac99.9%
Simplified99.9%
Taylor expanded in t1 around inf 83.0%
associate-*r/83.0%
neg-mul-183.0%
Simplified83.0%
if 2.35e-35 < t1 < 5.29999999999999979e39Initial program 86.2%
associate-/l*92.9%
Simplified92.9%
Taylor expanded in t1 around 0 86.1%
unpow286.1%
Simplified86.1%
Taylor expanded in u around 0 86.1%
unpow286.1%
associate-*r/92.6%
Simplified92.6%
Final simplification82.6%
(FPCore (u v t1)
:precision binary64
(if (<= t1 -9.7e-107)
(/ (- v) (+ t1 u))
(if (<= t1 2e-62)
(/ (- v) (* u (/ u t1)))
(if (or (<= t1 3.5e-34) (not (<= t1 1e+42)))
(/ (- v) t1)
(/ (- t1) (* u (/ u v)))))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -9.7e-107) {
tmp = -v / (t1 + u);
} else if (t1 <= 2e-62) {
tmp = -v / (u * (u / t1));
} else if ((t1 <= 3.5e-34) || !(t1 <= 1e+42)) {
tmp = -v / t1;
} else {
tmp = -t1 / (u * (u / v));
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if (t1 <= (-9.7d-107)) then
tmp = -v / (t1 + u)
else if (t1 <= 2d-62) then
tmp = -v / (u * (u / t1))
else if ((t1 <= 3.5d-34) .or. (.not. (t1 <= 1d+42))) then
tmp = -v / t1
else
tmp = -t1 / (u * (u / v))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (t1 <= -9.7e-107) {
tmp = -v / (t1 + u);
} else if (t1 <= 2e-62) {
tmp = -v / (u * (u / t1));
} else if ((t1 <= 3.5e-34) || !(t1 <= 1e+42)) {
tmp = -v / t1;
} else {
tmp = -t1 / (u * (u / v));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if t1 <= -9.7e-107: tmp = -v / (t1 + u) elif t1 <= 2e-62: tmp = -v / (u * (u / t1)) elif (t1 <= 3.5e-34) or not (t1 <= 1e+42): tmp = -v / t1 else: tmp = -t1 / (u * (u / v)) return tmp
function code(u, v, t1) tmp = 0.0 if (t1 <= -9.7e-107) tmp = Float64(Float64(-v) / Float64(t1 + u)); elseif (t1 <= 2e-62) tmp = Float64(Float64(-v) / Float64(u * Float64(u / t1))); elseif ((t1 <= 3.5e-34) || !(t1 <= 1e+42)) tmp = Float64(Float64(-v) / t1); else tmp = Float64(Float64(-t1) / Float64(u * Float64(u / v))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (t1 <= -9.7e-107) tmp = -v / (t1 + u); elseif (t1 <= 2e-62) tmp = -v / (u * (u / t1)); elseif ((t1 <= 3.5e-34) || ~((t1 <= 1e+42))) tmp = -v / t1; else tmp = -t1 / (u * (u / v)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[t1, -9.7e-107], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 2e-62], N[((-v) / N[(u * N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t1, 3.5e-34], N[Not[LessEqual[t1, 1e+42]], $MachinePrecision]], N[((-v) / t1), $MachinePrecision], N[((-t1) / N[(u * N[(u / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -9.7 \cdot 10^{-107}:\\
\;\;\;\;\frac{-v}{t1 + u}\\
\mathbf{elif}\;t1 \leq 2 \cdot 10^{-62}:\\
\;\;\;\;\frac{-v}{u \cdot \frac{u}{t1}}\\
\mathbf{elif}\;t1 \leq 3.5 \cdot 10^{-34} \lor \neg \left(t1 \leq 10^{+42}\right):\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{-t1}{u \cdot \frac{u}{v}}\\
\end{array}
\end{array}
if t1 < -9.6999999999999997e-107Initial program 66.5%
times-frac99.9%
Simplified99.9%
Taylor expanded in t1 around inf 76.1%
if -9.6999999999999997e-107 < t1 < 2.0000000000000001e-62Initial program 82.8%
*-commutative82.8%
times-frac94.6%
neg-mul-194.6%
associate-/l*94.6%
associate-*r/94.7%
associate-/l*94.7%
associate-/l/94.7%
neg-mul-194.7%
*-lft-identity94.7%
metadata-eval94.7%
times-frac94.7%
neg-mul-194.7%
remove-double-neg94.7%
neg-mul-194.7%
sub0-neg94.7%
associate--r+94.7%
neg-sub094.7%
div-sub94.7%
distribute-frac-neg94.7%
*-inverses94.7%
metadata-eval94.7%
Simplified94.7%
Taylor expanded in v around 0 97.1%
associate-*r/97.1%
neg-mul-197.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in t1 around 0 83.8%
unpow283.8%
associate-*r/91.5%
Simplified91.5%
if 2.0000000000000001e-62 < t1 < 3.5e-34 or 1.00000000000000004e42 < t1 Initial program 49.1%
times-frac99.9%
Simplified99.9%
Taylor expanded in t1 around inf 83.0%
associate-*r/83.0%
neg-mul-183.0%
Simplified83.0%
if 3.5e-34 < t1 < 1.00000000000000004e42Initial program 86.2%
associate-/l*92.9%
Simplified92.9%
Taylor expanded in t1 around 0 86.1%
unpow286.1%
Simplified86.1%
Taylor expanded in u around 0 86.1%
unpow286.1%
associate-*r/92.6%
Simplified92.6%
Final simplification83.3%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) (+ t1 (* u 2.0)))))
(if (<= t1 -5.3e-108)
t_1
(if (<= t1 4.85e-67)
(/ (- v) (* u (/ u t1)))
(if (or (<= t1 4.8e-43) (not (<= t1 4.1e+46)))
t_1
(/ (- t1) (* u (/ u v))))))))
double code(double u, double v, double t1) {
double t_1 = -v / (t1 + (u * 2.0));
double tmp;
if (t1 <= -5.3e-108) {
tmp = t_1;
} else if (t1 <= 4.85e-67) {
tmp = -v / (u * (u / t1));
} else if ((t1 <= 4.8e-43) || !(t1 <= 4.1e+46)) {
tmp = t_1;
} else {
tmp = -t1 / (u * (u / v));
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: t_1
real(8) :: tmp
t_1 = -v / (t1 + (u * 2.0d0))
if (t1 <= (-5.3d-108)) then
tmp = t_1
else if (t1 <= 4.85d-67) then
tmp = -v / (u * (u / t1))
else if ((t1 <= 4.8d-43) .or. (.not. (t1 <= 4.1d+46))) then
tmp = t_1
else
tmp = -t1 / (u * (u / v))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = -v / (t1 + (u * 2.0));
double tmp;
if (t1 <= -5.3e-108) {
tmp = t_1;
} else if (t1 <= 4.85e-67) {
tmp = -v / (u * (u / t1));
} else if ((t1 <= 4.8e-43) || !(t1 <= 4.1e+46)) {
tmp = t_1;
} else {
tmp = -t1 / (u * (u / v));
}
return tmp;
}
def code(u, v, t1): t_1 = -v / (t1 + (u * 2.0)) tmp = 0 if t1 <= -5.3e-108: tmp = t_1 elif t1 <= 4.85e-67: tmp = -v / (u * (u / t1)) elif (t1 <= 4.8e-43) or not (t1 <= 4.1e+46): tmp = t_1 else: tmp = -t1 / (u * (u / v)) return tmp
function code(u, v, t1) t_1 = Float64(Float64(-v) / Float64(t1 + Float64(u * 2.0))) tmp = 0.0 if (t1 <= -5.3e-108) tmp = t_1; elseif (t1 <= 4.85e-67) tmp = Float64(Float64(-v) / Float64(u * Float64(u / t1))); elseif ((t1 <= 4.8e-43) || !(t1 <= 4.1e+46)) tmp = t_1; else tmp = Float64(Float64(-t1) / Float64(u * Float64(u / v))); end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -v / (t1 + (u * 2.0)); tmp = 0.0; if (t1 <= -5.3e-108) tmp = t_1; elseif (t1 <= 4.85e-67) tmp = -v / (u * (u / t1)); elseif ((t1 <= 4.8e-43) || ~((t1 <= 4.1e+46))) tmp = t_1; else tmp = -t1 / (u * (u / v)); end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(t1 + N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -5.3e-108], t$95$1, If[LessEqual[t1, 4.85e-67], N[((-v) / N[(u * N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t1, 4.8e-43], N[Not[LessEqual[t1, 4.1e+46]], $MachinePrecision]], t$95$1, N[((-t1) / N[(u * N[(u / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{t1 + u \cdot 2}\\
\mathbf{if}\;t1 \leq -5.3 \cdot 10^{-108}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t1 \leq 4.85 \cdot 10^{-67}:\\
\;\;\;\;\frac{-v}{u \cdot \frac{u}{t1}}\\
\mathbf{elif}\;t1 \leq 4.8 \cdot 10^{-43} \lor \neg \left(t1 \leq 4.1 \cdot 10^{+46}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{-t1}{u \cdot \frac{u}{v}}\\
\end{array}
\end{array}
if t1 < -5.29999999999999989e-108 or 4.8500000000000003e-67 < t1 < 4.8000000000000004e-43 or 4.1e46 < t1 Initial program 59.6%
*-commutative59.6%
times-frac99.9%
neg-mul-199.9%
associate-/l*99.9%
associate-*r/99.9%
associate-/l*99.9%
associate-/l/99.9%
neg-mul-199.9%
*-lft-identity99.9%
metadata-eval99.9%
times-frac99.9%
neg-mul-199.9%
remove-double-neg99.9%
neg-mul-199.9%
sub0-neg99.9%
associate--r+99.9%
neg-sub099.9%
div-sub99.9%
distribute-frac-neg99.9%
*-inverses99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in v around 0 95.3%
associate-*r/95.3%
neg-mul-195.3%
+-commutative95.3%
Simplified95.3%
Taylor expanded in t1 around inf 79.8%
*-commutative79.8%
Simplified79.8%
if -5.29999999999999989e-108 < t1 < 4.8500000000000003e-67Initial program 82.8%
*-commutative82.8%
times-frac94.6%
neg-mul-194.6%
associate-/l*94.6%
associate-*r/94.7%
associate-/l*94.7%
associate-/l/94.7%
neg-mul-194.7%
*-lft-identity94.7%
metadata-eval94.7%
times-frac94.7%
neg-mul-194.7%
remove-double-neg94.7%
neg-mul-194.7%
sub0-neg94.7%
associate--r+94.7%
neg-sub094.7%
div-sub94.7%
distribute-frac-neg94.7%
*-inverses94.7%
metadata-eval94.7%
Simplified94.7%
Taylor expanded in v around 0 97.1%
associate-*r/97.1%
neg-mul-197.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in t1 around 0 83.8%
unpow283.8%
associate-*r/91.5%
Simplified91.5%
if 4.8000000000000004e-43 < t1 < 4.1e46Initial program 86.2%
associate-/l*92.9%
Simplified92.9%
Taylor expanded in t1 around 0 86.1%
unpow286.1%
Simplified86.1%
Taylor expanded in u around 0 86.1%
unpow286.1%
associate-*r/92.6%
Simplified92.6%
Final simplification84.0%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) (+ t1 (* u 2.0)))))
(if (<= t1 -1.85e-109)
t_1
(if (<= t1 9.5e-65)
(/ (- v) (* u (/ u t1)))
(if (or (<= t1 5.6e-48) (not (<= t1 2.05e+40)))
t_1
(/ (* v (/ t1 u)) (- u)))))))
double code(double u, double v, double t1) {
double t_1 = -v / (t1 + (u * 2.0));
double tmp;
if (t1 <= -1.85e-109) {
tmp = t_1;
} else if (t1 <= 9.5e-65) {
tmp = -v / (u * (u / t1));
} else if ((t1 <= 5.6e-48) || !(t1 <= 2.05e+40)) {
tmp = t_1;
} else {
tmp = (v * (t1 / u)) / -u;
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: t_1
real(8) :: tmp
t_1 = -v / (t1 + (u * 2.0d0))
if (t1 <= (-1.85d-109)) then
tmp = t_1
else if (t1 <= 9.5d-65) then
tmp = -v / (u * (u / t1))
else if ((t1 <= 5.6d-48) .or. (.not. (t1 <= 2.05d+40))) then
tmp = t_1
else
tmp = (v * (t1 / u)) / -u
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = -v / (t1 + (u * 2.0));
double tmp;
if (t1 <= -1.85e-109) {
tmp = t_1;
} else if (t1 <= 9.5e-65) {
tmp = -v / (u * (u / t1));
} else if ((t1 <= 5.6e-48) || !(t1 <= 2.05e+40)) {
tmp = t_1;
} else {
tmp = (v * (t1 / u)) / -u;
}
return tmp;
}
def code(u, v, t1): t_1 = -v / (t1 + (u * 2.0)) tmp = 0 if t1 <= -1.85e-109: tmp = t_1 elif t1 <= 9.5e-65: tmp = -v / (u * (u / t1)) elif (t1 <= 5.6e-48) or not (t1 <= 2.05e+40): tmp = t_1 else: tmp = (v * (t1 / u)) / -u return tmp
function code(u, v, t1) t_1 = Float64(Float64(-v) / Float64(t1 + Float64(u * 2.0))) tmp = 0.0 if (t1 <= -1.85e-109) tmp = t_1; elseif (t1 <= 9.5e-65) tmp = Float64(Float64(-v) / Float64(u * Float64(u / t1))); elseif ((t1 <= 5.6e-48) || !(t1 <= 2.05e+40)) tmp = t_1; else tmp = Float64(Float64(v * Float64(t1 / u)) / Float64(-u)); end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -v / (t1 + (u * 2.0)); tmp = 0.0; if (t1 <= -1.85e-109) tmp = t_1; elseif (t1 <= 9.5e-65) tmp = -v / (u * (u / t1)); elseif ((t1 <= 5.6e-48) || ~((t1 <= 2.05e+40))) tmp = t_1; else tmp = (v * (t1 / u)) / -u; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(t1 + N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -1.85e-109], t$95$1, If[LessEqual[t1, 9.5e-65], N[((-v) / N[(u * N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t1, 5.6e-48], N[Not[LessEqual[t1, 2.05e+40]], $MachinePrecision]], t$95$1, N[(N[(v * N[(t1 / u), $MachinePrecision]), $MachinePrecision] / (-u)), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{t1 + u \cdot 2}\\
\mathbf{if}\;t1 \leq -1.85 \cdot 10^{-109}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t1 \leq 9.5 \cdot 10^{-65}:\\
\;\;\;\;\frac{-v}{u \cdot \frac{u}{t1}}\\
\mathbf{elif}\;t1 \leq 5.6 \cdot 10^{-48} \lor \neg \left(t1 \leq 2.05 \cdot 10^{+40}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{v \cdot \frac{t1}{u}}{-u}\\
\end{array}
\end{array}
if t1 < -1.8499999999999999e-109 or 9.5000000000000004e-65 < t1 < 5.6000000000000001e-48 or 2.0500000000000001e40 < t1 Initial program 59.1%
*-commutative59.1%
times-frac99.9%
neg-mul-199.9%
associate-/l*99.9%
associate-*r/99.9%
associate-/l*99.9%
associate-/l/99.9%
neg-mul-199.9%
*-lft-identity99.9%
metadata-eval99.9%
times-frac99.9%
neg-mul-199.9%
remove-double-neg99.9%
neg-mul-199.9%
sub0-neg99.9%
associate--r+99.9%
neg-sub099.9%
div-sub99.9%
distribute-frac-neg99.9%
*-inverses99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in v around 0 95.3%
associate-*r/95.3%
neg-mul-195.3%
+-commutative95.3%
Simplified95.3%
Taylor expanded in t1 around inf 80.1%
*-commutative80.1%
Simplified80.1%
if -1.8499999999999999e-109 < t1 < 9.5000000000000004e-65Initial program 82.8%
*-commutative82.8%
times-frac94.6%
neg-mul-194.6%
associate-/l*94.6%
associate-*r/94.7%
associate-/l*94.7%
associate-/l/94.7%
neg-mul-194.7%
*-lft-identity94.7%
metadata-eval94.7%
times-frac94.7%
neg-mul-194.7%
remove-double-neg94.7%
neg-mul-194.7%
sub0-neg94.7%
associate--r+94.7%
neg-sub094.7%
div-sub94.7%
distribute-frac-neg94.7%
*-inverses94.7%
metadata-eval94.7%
Simplified94.7%
Taylor expanded in v around 0 97.1%
associate-*r/97.1%
neg-mul-197.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in t1 around 0 83.8%
unpow283.8%
associate-*r/91.5%
Simplified91.5%
if 5.6000000000000001e-48 < t1 < 2.0500000000000001e40Initial program 87.8%
associate-/l*93.7%
Simplified93.7%
Taylor expanded in t1 around 0 81.6%
unpow281.6%
Simplified81.6%
associate-/r/81.7%
add-sqr-sqrt0.0%
sqrt-unprod26.7%
sqr-neg26.7%
sqrt-unprod26.7%
add-sqr-sqrt26.7%
Applied egg-rr26.7%
associate-*l/26.7%
*-commutative26.7%
times-frac26.6%
frac-2neg26.6%
associate-*l/26.6%
add-sqr-sqrt25.9%
sqrt-unprod38.9%
sqr-neg38.9%
sqrt-unprod25.2%
add-sqr-sqrt87.6%
Applied egg-rr87.6%
Final simplification84.0%
(FPCore (u v t1)
:precision binary64
(if (<= t1 -2.2e-109)
(/ (/ v t1) (- -1.0 (/ u t1)))
(if (<= t1 4.9e-67)
(/ (- v) (* u (/ u t1)))
(if (or (<= t1 2.3e-56) (not (<= t1 2.6e+41)))
(/ (- v) (+ t1 (* u 2.0)))
(/ (* v (/ t1 u)) (- u))))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -2.2e-109) {
tmp = (v / t1) / (-1.0 - (u / t1));
} else if (t1 <= 4.9e-67) {
tmp = -v / (u * (u / t1));
} else if ((t1 <= 2.3e-56) || !(t1 <= 2.6e+41)) {
tmp = -v / (t1 + (u * 2.0));
} else {
tmp = (v * (t1 / u)) / -u;
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if (t1 <= (-2.2d-109)) then
tmp = (v / t1) / ((-1.0d0) - (u / t1))
else if (t1 <= 4.9d-67) then
tmp = -v / (u * (u / t1))
else if ((t1 <= 2.3d-56) .or. (.not. (t1 <= 2.6d+41))) then
tmp = -v / (t1 + (u * 2.0d0))
else
tmp = (v * (t1 / u)) / -u
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (t1 <= -2.2e-109) {
tmp = (v / t1) / (-1.0 - (u / t1));
} else if (t1 <= 4.9e-67) {
tmp = -v / (u * (u / t1));
} else if ((t1 <= 2.3e-56) || !(t1 <= 2.6e+41)) {
tmp = -v / (t1 + (u * 2.0));
} else {
tmp = (v * (t1 / u)) / -u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if t1 <= -2.2e-109: tmp = (v / t1) / (-1.0 - (u / t1)) elif t1 <= 4.9e-67: tmp = -v / (u * (u / t1)) elif (t1 <= 2.3e-56) or not (t1 <= 2.6e+41): tmp = -v / (t1 + (u * 2.0)) else: tmp = (v * (t1 / u)) / -u return tmp
function code(u, v, t1) tmp = 0.0 if (t1 <= -2.2e-109) tmp = Float64(Float64(v / t1) / Float64(-1.0 - Float64(u / t1))); elseif (t1 <= 4.9e-67) tmp = Float64(Float64(-v) / Float64(u * Float64(u / t1))); elseif ((t1 <= 2.3e-56) || !(t1 <= 2.6e+41)) tmp = Float64(Float64(-v) / Float64(t1 + Float64(u * 2.0))); else tmp = Float64(Float64(v * Float64(t1 / u)) / Float64(-u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (t1 <= -2.2e-109) tmp = (v / t1) / (-1.0 - (u / t1)); elseif (t1 <= 4.9e-67) tmp = -v / (u * (u / t1)); elseif ((t1 <= 2.3e-56) || ~((t1 <= 2.6e+41))) tmp = -v / (t1 + (u * 2.0)); else tmp = (v * (t1 / u)) / -u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[t1, -2.2e-109], N[(N[(v / t1), $MachinePrecision] / N[(-1.0 - N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 4.9e-67], N[((-v) / N[(u * N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t1, 2.3e-56], N[Not[LessEqual[t1, 2.6e+41]], $MachinePrecision]], N[((-v) / N[(t1 + N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(v * N[(t1 / u), $MachinePrecision]), $MachinePrecision] / (-u)), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -2.2 \cdot 10^{-109}:\\
\;\;\;\;\frac{\frac{v}{t1}}{-1 - \frac{u}{t1}}\\
\mathbf{elif}\;t1 \leq 4.9 \cdot 10^{-67}:\\
\;\;\;\;\frac{-v}{u \cdot \frac{u}{t1}}\\
\mathbf{elif}\;t1 \leq 2.3 \cdot 10^{-56} \lor \neg \left(t1 \leq 2.6 \cdot 10^{+41}\right):\\
\;\;\;\;\frac{-v}{t1 + u \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{v \cdot \frac{t1}{u}}{-u}\\
\end{array}
\end{array}
if t1 < -2.1999999999999999e-109Initial program 66.5%
*-commutative66.5%
times-frac99.9%
neg-mul-199.9%
associate-/l*99.9%
associate-*r/99.9%
associate-/l*99.9%
associate-/l/99.9%
neg-mul-199.9%
*-lft-identity99.9%
metadata-eval99.9%
times-frac99.9%
neg-mul-199.9%
remove-double-neg99.9%
neg-mul-199.9%
sub0-neg99.9%
associate--r+99.9%
neg-sub099.9%
div-sub99.9%
distribute-frac-neg99.9%
*-inverses99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in t1 around inf 77.0%
if -2.1999999999999999e-109 < t1 < 4.89999999999999993e-67Initial program 82.8%
*-commutative82.8%
times-frac94.6%
neg-mul-194.6%
associate-/l*94.6%
associate-*r/94.7%
associate-/l*94.7%
associate-/l/94.7%
neg-mul-194.7%
*-lft-identity94.7%
metadata-eval94.7%
times-frac94.7%
neg-mul-194.7%
remove-double-neg94.7%
neg-mul-194.7%
sub0-neg94.7%
associate--r+94.7%
neg-sub094.7%
div-sub94.7%
distribute-frac-neg94.7%
*-inverses94.7%
metadata-eval94.7%
Simplified94.7%
Taylor expanded in v around 0 97.1%
associate-*r/97.1%
neg-mul-197.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in t1 around 0 83.8%
unpow283.8%
associate-*r/91.5%
Simplified91.5%
if 4.89999999999999993e-67 < t1 < 2.30000000000000002e-56 or 2.6000000000000001e41 < t1 Initial program 47.5%
*-commutative47.5%
times-frac99.9%
neg-mul-199.9%
associate-/l*99.9%
associate-*r/99.9%
associate-/l*99.9%
associate-/l/99.9%
neg-mul-199.9%
*-lft-identity99.9%
metadata-eval99.9%
times-frac99.9%
neg-mul-199.9%
remove-double-neg99.9%
neg-mul-199.9%
sub0-neg99.9%
associate--r+99.9%
neg-sub099.9%
div-sub100.0%
distribute-frac-neg100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in v around 0 96.9%
associate-*r/96.9%
neg-mul-196.9%
+-commutative96.9%
Simplified96.9%
Taylor expanded in t1 around inf 85.0%
*-commutative85.0%
Simplified85.0%
if 2.30000000000000002e-56 < t1 < 2.6000000000000001e41Initial program 87.8%
associate-/l*93.7%
Simplified93.7%
Taylor expanded in t1 around 0 81.6%
unpow281.6%
Simplified81.6%
associate-/r/81.7%
add-sqr-sqrt0.0%
sqrt-unprod26.7%
sqr-neg26.7%
sqrt-unprod26.7%
add-sqr-sqrt26.7%
Applied egg-rr26.7%
associate-*l/26.7%
*-commutative26.7%
times-frac26.6%
frac-2neg26.6%
associate-*l/26.6%
add-sqr-sqrt25.9%
sqrt-unprod38.9%
sqr-neg38.9%
sqrt-unprod25.2%
add-sqr-sqrt87.6%
Applied egg-rr87.6%
Final simplification84.0%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) (+ t1 u))) (t_2 (* (- v) (/ t1 (* u u)))))
(if (<= t1 -9e-107)
t_1
(if (<= t1 1.18e-64)
t_2
(if (<= t1 4.4e-51) t_1 (if (<= t1 1.02e+42) t_2 (/ (- v) t1)))))))
double code(double u, double v, double t1) {
double t_1 = -v / (t1 + u);
double t_2 = -v * (t1 / (u * u));
double tmp;
if (t1 <= -9e-107) {
tmp = t_1;
} else if (t1 <= 1.18e-64) {
tmp = t_2;
} else if (t1 <= 4.4e-51) {
tmp = t_1;
} else if (t1 <= 1.02e+42) {
tmp = t_2;
} else {
tmp = -v / t1;
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = -v / (t1 + u)
t_2 = -v * (t1 / (u * u))
if (t1 <= (-9d-107)) then
tmp = t_1
else if (t1 <= 1.18d-64) then
tmp = t_2
else if (t1 <= 4.4d-51) then
tmp = t_1
else if (t1 <= 1.02d+42) then
tmp = t_2
else
tmp = -v / t1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = -v / (t1 + u);
double t_2 = -v * (t1 / (u * u));
double tmp;
if (t1 <= -9e-107) {
tmp = t_1;
} else if (t1 <= 1.18e-64) {
tmp = t_2;
} else if (t1 <= 4.4e-51) {
tmp = t_1;
} else if (t1 <= 1.02e+42) {
tmp = t_2;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): t_1 = -v / (t1 + u) t_2 = -v * (t1 / (u * u)) tmp = 0 if t1 <= -9e-107: tmp = t_1 elif t1 <= 1.18e-64: tmp = t_2 elif t1 <= 4.4e-51: tmp = t_1 elif t1 <= 1.02e+42: tmp = t_2 else: tmp = -v / t1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-v) / Float64(t1 + u)) t_2 = Float64(Float64(-v) * Float64(t1 / Float64(u * u))) tmp = 0.0 if (t1 <= -9e-107) tmp = t_1; elseif (t1 <= 1.18e-64) tmp = t_2; elseif (t1 <= 4.4e-51) tmp = t_1; elseif (t1 <= 1.02e+42) tmp = t_2; else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -v / (t1 + u); t_2 = -v * (t1 / (u * u)); tmp = 0.0; if (t1 <= -9e-107) tmp = t_1; elseif (t1 <= 1.18e-64) tmp = t_2; elseif (t1 <= 4.4e-51) tmp = t_1; elseif (t1 <= 1.02e+42) tmp = t_2; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-v) * N[(t1 / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -9e-107], t$95$1, If[LessEqual[t1, 1.18e-64], t$95$2, If[LessEqual[t1, 4.4e-51], t$95$1, If[LessEqual[t1, 1.02e+42], t$95$2, N[((-v) / t1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{t1 + u}\\
t_2 := \left(-v\right) \cdot \frac{t1}{u \cdot u}\\
\mathbf{if}\;t1 \leq -9 \cdot 10^{-107}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t1 \leq 1.18 \cdot 10^{-64}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t1 \leq 4.4 \cdot 10^{-51}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t1 \leq 1.02 \cdot 10^{+42}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if t1 < -9.00000000000000032e-107 or 1.17999999999999996e-64 < t1 < 4.4e-51Initial program 67.2%
times-frac99.9%
Simplified99.9%
Taylor expanded in t1 around inf 76.8%
if -9.00000000000000032e-107 < t1 < 1.17999999999999996e-64 or 4.4e-51 < t1 < 1.01999999999999996e42Initial program 83.7%
*-commutative83.7%
times-frac95.4%
neg-mul-195.4%
associate-/l*95.5%
associate-*r/95.6%
associate-/l*95.6%
associate-/l/95.6%
neg-mul-195.6%
*-lft-identity95.6%
metadata-eval95.6%
times-frac95.6%
neg-mul-195.6%
remove-double-neg95.6%
neg-mul-195.6%
sub0-neg95.6%
associate--r+95.6%
neg-sub095.6%
div-sub95.6%
distribute-frac-neg95.6%
*-inverses95.6%
metadata-eval95.6%
Simplified95.6%
Taylor expanded in v around 0 96.5%
associate-*r/96.5%
neg-mul-196.5%
+-commutative96.5%
Simplified96.5%
Taylor expanded in t1 around 0 80.6%
mul-1-neg80.6%
unpow280.6%
associate-*l/83.5%
*-commutative83.5%
Simplified83.5%
if 1.01999999999999996e42 < t1 Initial program 44.7%
times-frac99.9%
Simplified99.9%
Taylor expanded in t1 around inf 83.3%
associate-*r/83.3%
neg-mul-183.3%
Simplified83.3%
Final simplification80.7%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) (+ t1 u))) (t_2 (* (/ (- t1) u) (/ v u))))
(if (<= t1 -5.3e-108)
t_1
(if (<= t1 3.5e-65)
t_2
(if (<= t1 2e-56) t_1 (if (<= t1 2.1e+44) t_2 (/ (- v) t1)))))))
double code(double u, double v, double t1) {
double t_1 = -v / (t1 + u);
double t_2 = (-t1 / u) * (v / u);
double tmp;
if (t1 <= -5.3e-108) {
tmp = t_1;
} else if (t1 <= 3.5e-65) {
tmp = t_2;
} else if (t1 <= 2e-56) {
tmp = t_1;
} else if (t1 <= 2.1e+44) {
tmp = t_2;
} else {
tmp = -v / t1;
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = -v / (t1 + u)
t_2 = (-t1 / u) * (v / u)
if (t1 <= (-5.3d-108)) then
tmp = t_1
else if (t1 <= 3.5d-65) then
tmp = t_2
else if (t1 <= 2d-56) then
tmp = t_1
else if (t1 <= 2.1d+44) then
tmp = t_2
else
tmp = -v / t1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = -v / (t1 + u);
double t_2 = (-t1 / u) * (v / u);
double tmp;
if (t1 <= -5.3e-108) {
tmp = t_1;
} else if (t1 <= 3.5e-65) {
tmp = t_2;
} else if (t1 <= 2e-56) {
tmp = t_1;
} else if (t1 <= 2.1e+44) {
tmp = t_2;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): t_1 = -v / (t1 + u) t_2 = (-t1 / u) * (v / u) tmp = 0 if t1 <= -5.3e-108: tmp = t_1 elif t1 <= 3.5e-65: tmp = t_2 elif t1 <= 2e-56: tmp = t_1 elif t1 <= 2.1e+44: tmp = t_2 else: tmp = -v / t1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-v) / Float64(t1 + u)) t_2 = Float64(Float64(Float64(-t1) / u) * Float64(v / u)) tmp = 0.0 if (t1 <= -5.3e-108) tmp = t_1; elseif (t1 <= 3.5e-65) tmp = t_2; elseif (t1 <= 2e-56) tmp = t_1; elseif (t1 <= 2.1e+44) tmp = t_2; else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -v / (t1 + u); t_2 = (-t1 / u) * (v / u); tmp = 0.0; if (t1 <= -5.3e-108) tmp = t_1; elseif (t1 <= 3.5e-65) tmp = t_2; elseif (t1 <= 2e-56) tmp = t_1; elseif (t1 <= 2.1e+44) tmp = t_2; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[((-t1) / u), $MachinePrecision] * N[(v / u), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -5.3e-108], t$95$1, If[LessEqual[t1, 3.5e-65], t$95$2, If[LessEqual[t1, 2e-56], t$95$1, If[LessEqual[t1, 2.1e+44], t$95$2, N[((-v) / t1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{t1 + u}\\
t_2 := \frac{-t1}{u} \cdot \frac{v}{u}\\
\mathbf{if}\;t1 \leq -5.3 \cdot 10^{-108}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t1 \leq 3.5 \cdot 10^{-65}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t1 \leq 2 \cdot 10^{-56}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t1 \leq 2.1 \cdot 10^{+44}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if t1 < -5.29999999999999989e-108 or 3.50000000000000005e-65 < t1 < 2.0000000000000001e-56Initial program 67.2%
times-frac99.9%
Simplified99.9%
Taylor expanded in t1 around inf 76.8%
if -5.29999999999999989e-108 < t1 < 3.50000000000000005e-65 or 2.0000000000000001e-56 < t1 < 2.09999999999999987e44Initial program 83.7%
times-frac95.4%
Simplified95.4%
Taylor expanded in t1 around 0 87.6%
Taylor expanded in t1 around 0 88.7%
associate-*r/88.7%
neg-mul-188.7%
Simplified88.7%
if 2.09999999999999987e44 < t1 Initial program 44.7%
times-frac99.9%
Simplified99.9%
Taylor expanded in t1 around inf 83.3%
associate-*r/83.3%
neg-mul-183.3%
Simplified83.3%
Final simplification82.6%
(FPCore (u v t1) :precision binary64 (if (or (<= u -4.6e+163) (not (<= u 3.6e+162))) (* t1 (/ v (* u u))) (/ (- v) (+ t1 u))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -4.6e+163) || !(u <= 3.6e+162)) {
tmp = t1 * (v / (u * u));
} else {
tmp = -v / (t1 + u);
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if ((u <= (-4.6d+163)) .or. (.not. (u <= 3.6d+162))) then
tmp = t1 * (v / (u * u))
else
tmp = -v / (t1 + u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((u <= -4.6e+163) || !(u <= 3.6e+162)) {
tmp = t1 * (v / (u * u));
} else {
tmp = -v / (t1 + u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -4.6e+163) or not (u <= 3.6e+162): tmp = t1 * (v / (u * u)) else: tmp = -v / (t1 + u) return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -4.6e+163) || !(u <= 3.6e+162)) tmp = Float64(t1 * Float64(v / Float64(u * u))); else tmp = Float64(Float64(-v) / Float64(t1 + u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -4.6e+163) || ~((u <= 3.6e+162))) tmp = t1 * (v / (u * u)); else tmp = -v / (t1 + u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -4.6e+163], N[Not[LessEqual[u, 3.6e+162]], $MachinePrecision]], N[(t1 * N[(v / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -4.6 \cdot 10^{+163} \lor \neg \left(u \leq 3.6 \cdot 10^{+162}\right):\\
\;\;\;\;t1 \cdot \frac{v}{u \cdot u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1 + u}\\
\end{array}
\end{array}
if u < -4.60000000000000003e163 or 3.59999999999999994e162 < u Initial program 72.4%
associate-/l*72.9%
Simplified72.9%
Taylor expanded in t1 around 0 72.9%
unpow272.9%
Simplified72.9%
div-inv72.9%
clear-num72.9%
add-sqr-sqrt40.3%
sqrt-unprod56.6%
sqr-neg56.6%
sqrt-unprod32.6%
add-sqr-sqrt72.9%
Applied egg-rr72.9%
if -4.60000000000000003e163 < u < 3.59999999999999994e162Initial program 66.5%
times-frac97.8%
Simplified97.8%
Taylor expanded in t1 around inf 67.5%
Final simplification68.9%
(FPCore (u v t1) :precision binary64 (if (or (<= u -1.75e+165) (not (<= u 3.9e+164))) (* (/ v u) -0.5) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -1.75e+165) || !(u <= 3.9e+164)) {
tmp = (v / u) * -0.5;
} else {
tmp = -v / t1;
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if ((u <= (-1.75d+165)) .or. (.not. (u <= 3.9d+164))) then
tmp = (v / u) * (-0.5d0)
else
tmp = -v / t1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((u <= -1.75e+165) || !(u <= 3.9e+164)) {
tmp = (v / u) * -0.5;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -1.75e+165) or not (u <= 3.9e+164): tmp = (v / u) * -0.5 else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -1.75e+165) || !(u <= 3.9e+164)) tmp = Float64(Float64(v / u) * -0.5); else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -1.75e+165) || ~((u <= 3.9e+164))) tmp = (v / u) * -0.5; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -1.75e+165], N[Not[LessEqual[u, 3.9e+164]], $MachinePrecision]], N[(N[(v / u), $MachinePrecision] * -0.5), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.75 \cdot 10^{+165} \lor \neg \left(u \leq 3.9 \cdot 10^{+164}\right):\\
\;\;\;\;\frac{v}{u} \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -1.74999999999999998e165 or 3.89999999999999985e164 < u Initial program 72.4%
*-commutative72.4%
times-frac99.9%
neg-mul-199.9%
associate-/l*99.9%
associate-*r/100.0%
associate-/l*100.0%
associate-/l/100.0%
neg-mul-1100.0%
*-lft-identity100.0%
metadata-eval100.0%
times-frac100.0%
neg-mul-1100.0%
remove-double-neg100.0%
neg-mul-1100.0%
sub0-neg100.0%
associate--r+100.0%
neg-sub0100.0%
div-sub100.0%
distribute-frac-neg100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in v around 0 84.9%
associate-*r/84.9%
neg-mul-184.9%
+-commutative84.9%
Simplified84.9%
Taylor expanded in t1 around inf 42.2%
*-commutative42.2%
Simplified42.2%
Taylor expanded in t1 around 0 39.4%
if -1.74999999999999998e165 < u < 3.89999999999999985e164Initial program 66.5%
times-frac97.8%
Simplified97.8%
Taylor expanded in t1 around inf 66.2%
associate-*r/66.2%
neg-mul-166.2%
Simplified66.2%
Final simplification59.6%
(FPCore (u v t1) :precision binary64 (if (<= u -4e+165) (* v (/ -0.5 u)) (if (<= u 3.55e+162) (/ (- v) t1) (* (/ v u) -0.5))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -4e+165) {
tmp = v * (-0.5 / u);
} else if (u <= 3.55e+162) {
tmp = -v / t1;
} else {
tmp = (v / u) * -0.5;
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if (u <= (-4d+165)) then
tmp = v * ((-0.5d0) / u)
else if (u <= 3.55d+162) then
tmp = -v / t1
else
tmp = (v / u) * (-0.5d0)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -4e+165) {
tmp = v * (-0.5 / u);
} else if (u <= 3.55e+162) {
tmp = -v / t1;
} else {
tmp = (v / u) * -0.5;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -4e+165: tmp = v * (-0.5 / u) elif u <= 3.55e+162: tmp = -v / t1 else: tmp = (v / u) * -0.5 return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -4e+165) tmp = Float64(v * Float64(-0.5 / u)); elseif (u <= 3.55e+162) tmp = Float64(Float64(-v) / t1); else tmp = Float64(Float64(v / u) * -0.5); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -4e+165) tmp = v * (-0.5 / u); elseif (u <= 3.55e+162) tmp = -v / t1; else tmp = (v / u) * -0.5; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -4e+165], N[(v * N[(-0.5 / u), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 3.55e+162], N[((-v) / t1), $MachinePrecision], N[(N[(v / u), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -4 \cdot 10^{+165}:\\
\;\;\;\;v \cdot \frac{-0.5}{u}\\
\mathbf{elif}\;u \leq 3.55 \cdot 10^{+162}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u} \cdot -0.5\\
\end{array}
\end{array}
if u < -3.9999999999999996e165Initial program 73.3%
*-commutative73.3%
times-frac100.0%
neg-mul-1100.0%
associate-/l*100.0%
associate-*r/99.9%
associate-/l*99.9%
associate-/l/99.9%
neg-mul-199.9%
*-lft-identity99.9%
metadata-eval99.9%
times-frac99.9%
neg-mul-199.9%
remove-double-neg99.9%
neg-mul-199.9%
sub0-neg99.9%
associate--r+99.9%
neg-sub099.9%
div-sub99.9%
distribute-frac-neg99.9%
*-inverses99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in v around 0 82.7%
associate-*r/82.7%
neg-mul-182.7%
+-commutative82.7%
Simplified82.7%
Taylor expanded in t1 around inf 41.7%
*-commutative41.7%
Simplified41.7%
Taylor expanded in t1 around 0 39.1%
expm1-log1p-u39.0%
expm1-udef74.0%
Applied egg-rr74.0%
expm1-def39.0%
expm1-log1p39.1%
associate-*r/39.1%
associate-*l/39.1%
*-commutative39.1%
Simplified39.1%
if -3.9999999999999996e165 < u < 3.5499999999999999e162Initial program 66.5%
times-frac97.8%
Simplified97.8%
Taylor expanded in t1 around inf 66.2%
associate-*r/66.2%
neg-mul-166.2%
Simplified66.2%
if 3.5499999999999999e162 < u Initial program 71.5%
*-commutative71.5%
times-frac99.9%
neg-mul-199.9%
associate-/l*99.9%
associate-*r/100.0%
associate-/l*100.0%
associate-/l/100.0%
neg-mul-1100.0%
*-lft-identity100.0%
metadata-eval100.0%
times-frac100.0%
neg-mul-1100.0%
remove-double-neg100.0%
neg-mul-1100.0%
sub0-neg100.0%
associate--r+100.0%
neg-sub0100.0%
div-sub100.0%
distribute-frac-neg100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in v around 0 87.4%
associate-*r/87.4%
neg-mul-187.4%
+-commutative87.4%
Simplified87.4%
Taylor expanded in t1 around inf 42.7%
*-commutative42.7%
Simplified42.7%
Taylor expanded in t1 around 0 39.7%
Final simplification59.6%
(FPCore (u v t1) :precision binary64 (if (<= u -5.1e+163) (/ -0.5 (/ u v)) (if (<= u 6.4e+163) (/ (- v) t1) (* (/ v u) -0.5))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -5.1e+163) {
tmp = -0.5 / (u / v);
} else if (u <= 6.4e+163) {
tmp = -v / t1;
} else {
tmp = (v / u) * -0.5;
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if (u <= (-5.1d+163)) then
tmp = (-0.5d0) / (u / v)
else if (u <= 6.4d+163) then
tmp = -v / t1
else
tmp = (v / u) * (-0.5d0)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -5.1e+163) {
tmp = -0.5 / (u / v);
} else if (u <= 6.4e+163) {
tmp = -v / t1;
} else {
tmp = (v / u) * -0.5;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -5.1e+163: tmp = -0.5 / (u / v) elif u <= 6.4e+163: tmp = -v / t1 else: tmp = (v / u) * -0.5 return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -5.1e+163) tmp = Float64(-0.5 / Float64(u / v)); elseif (u <= 6.4e+163) tmp = Float64(Float64(-v) / t1); else tmp = Float64(Float64(v / u) * -0.5); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -5.1e+163) tmp = -0.5 / (u / v); elseif (u <= 6.4e+163) tmp = -v / t1; else tmp = (v / u) * -0.5; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -5.1e+163], N[(-0.5 / N[(u / v), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 6.4e+163], N[((-v) / t1), $MachinePrecision], N[(N[(v / u), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -5.1 \cdot 10^{+163}:\\
\;\;\;\;\frac{-0.5}{\frac{u}{v}}\\
\mathbf{elif}\;u \leq 6.4 \cdot 10^{+163}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u} \cdot -0.5\\
\end{array}
\end{array}
if u < -5.1000000000000002e163Initial program 73.3%
*-commutative73.3%
times-frac100.0%
neg-mul-1100.0%
associate-/l*100.0%
associate-*r/99.9%
associate-/l*99.9%
associate-/l/99.9%
neg-mul-199.9%
*-lft-identity99.9%
metadata-eval99.9%
times-frac99.9%
neg-mul-199.9%
remove-double-neg99.9%
neg-mul-199.9%
sub0-neg99.9%
associate--r+99.9%
neg-sub099.9%
div-sub99.9%
distribute-frac-neg99.9%
*-inverses99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in v around 0 82.7%
associate-*r/82.7%
neg-mul-182.7%
+-commutative82.7%
Simplified82.7%
Taylor expanded in t1 around inf 41.7%
*-commutative41.7%
Simplified41.7%
Taylor expanded in t1 around 0 39.1%
associate-*r/39.1%
associate-/l*42.9%
Simplified42.9%
if -5.1000000000000002e163 < u < 6.3999999999999996e163Initial program 66.5%
times-frac97.8%
Simplified97.8%
Taylor expanded in t1 around inf 66.2%
associate-*r/66.2%
neg-mul-166.2%
Simplified66.2%
if 6.3999999999999996e163 < u Initial program 71.5%
*-commutative71.5%
times-frac99.9%
neg-mul-199.9%
associate-/l*99.9%
associate-*r/100.0%
associate-/l*100.0%
associate-/l/100.0%
neg-mul-1100.0%
*-lft-identity100.0%
metadata-eval100.0%
times-frac100.0%
neg-mul-1100.0%
remove-double-neg100.0%
neg-mul-1100.0%
sub0-neg100.0%
associate--r+100.0%
neg-sub0100.0%
div-sub100.0%
distribute-frac-neg100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in v around 0 87.4%
associate-*r/87.4%
neg-mul-187.4%
+-commutative87.4%
Simplified87.4%
Taylor expanded in t1 around inf 42.7%
*-commutative42.7%
Simplified42.7%
Taylor expanded in t1 around 0 39.7%
Final simplification60.1%
(FPCore (u v t1) :precision binary64 (if (or (<= u -1.3e+164) (not (<= u 2e+166))) (/ v (- u)) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -1.3e+164) || !(u <= 2e+166)) {
tmp = v / -u;
} else {
tmp = -v / t1;
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if ((u <= (-1.3d+164)) .or. (.not. (u <= 2d+166))) then
tmp = v / -u
else
tmp = -v / t1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((u <= -1.3e+164) || !(u <= 2e+166)) {
tmp = v / -u;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -1.3e+164) or not (u <= 2e+166): tmp = v / -u else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -1.3e+164) || !(u <= 2e+166)) tmp = Float64(v / Float64(-u)); else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -1.3e+164) || ~((u <= 2e+166))) tmp = v / -u; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -1.3e+164], N[Not[LessEqual[u, 2e+166]], $MachinePrecision]], N[(v / (-u)), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.3 \cdot 10^{+164} \lor \neg \left(u \leq 2 \cdot 10^{+166}\right):\\
\;\;\;\;\frac{v}{-u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -1.3e164 or 1.99999999999999988e166 < u Initial program 72.4%
*-commutative72.4%
times-frac99.9%
neg-mul-199.9%
associate-/l*99.9%
associate-*r/100.0%
associate-/l*100.0%
associate-/l/100.0%
neg-mul-1100.0%
*-lft-identity100.0%
metadata-eval100.0%
times-frac100.0%
neg-mul-1100.0%
remove-double-neg100.0%
neg-mul-1100.0%
sub0-neg100.0%
associate--r+100.0%
neg-sub0100.0%
div-sub100.0%
distribute-frac-neg100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in t1 around inf 59.2%
Taylor expanded in t1 around 0 39.3%
metadata-eval39.3%
times-frac39.3%
*-lft-identity39.3%
neg-mul-139.3%
Simplified39.3%
if -1.3e164 < u < 1.99999999999999988e166Initial program 66.5%
times-frac97.8%
Simplified97.8%
Taylor expanded in t1 around inf 66.2%
associate-*r/66.2%
neg-mul-166.2%
Simplified66.2%
Final simplification59.6%
(FPCore (u v t1) :precision binary64 (/ (- v) (+ t1 u)))
double code(double u, double v, double t1) {
return -v / (t1 + u);
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = -v / (t1 + u)
end function
public static double code(double u, double v, double t1) {
return -v / (t1 + u);
}
def code(u, v, t1): return -v / (t1 + u)
function code(u, v, t1) return Float64(Float64(-v) / Float64(t1 + u)) end
function tmp = code(u, v, t1) tmp = -v / (t1 + u); end
code[u_, v_, t1_] := N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-v}{t1 + u}
\end{array}
Initial program 67.9%
times-frac98.3%
Simplified98.3%
Taylor expanded in t1 around inf 61.3%
Final simplification61.3%
(FPCore (u v t1) :precision binary64 (/ v (- u)))
double code(double u, double v, double t1) {
return v / -u;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = v / -u
end function
public static double code(double u, double v, double t1) {
return v / -u;
}
def code(u, v, t1): return v / -u
function code(u, v, t1) return Float64(v / Float64(-u)) end
function tmp = code(u, v, t1) tmp = v / -u; end
code[u_, v_, t1_] := N[(v / (-u)), $MachinePrecision]
\begin{array}{l}
\\
\frac{v}{-u}
\end{array}
Initial program 67.9%
*-commutative67.9%
times-frac98.3%
neg-mul-198.3%
associate-/l*98.3%
associate-*r/98.3%
associate-/l*98.3%
associate-/l/98.3%
neg-mul-198.3%
*-lft-identity98.3%
metadata-eval98.3%
times-frac98.3%
neg-mul-198.3%
remove-double-neg98.3%
neg-mul-198.3%
sub0-neg98.3%
associate--r+98.3%
neg-sub098.3%
div-sub98.4%
distribute-frac-neg98.4%
*-inverses98.4%
metadata-eval98.4%
Simplified98.4%
Taylor expanded in t1 around inf 65.8%
Taylor expanded in t1 around 0 17.0%
metadata-eval17.0%
times-frac17.0%
*-lft-identity17.0%
neg-mul-117.0%
Simplified17.0%
Final simplification17.0%
herbie shell --seed 2023240
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))