
(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 14 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 (/ (* (/ t1 (+ t1 u)) v) (- (- u) t1)))
double code(double u, double v, double t1) {
return ((t1 / (t1 + u)) * v) / (-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 = ((t1 / (t1 + u)) * v) / (-u - t1)
end function
public static double code(double u, double v, double t1) {
return ((t1 / (t1 + u)) * v) / (-u - t1);
}
def code(u, v, t1): return ((t1 / (t1 + u)) * v) / (-u - t1)
function code(u, v, t1) return Float64(Float64(Float64(t1 / Float64(t1 + u)) * v) / Float64(Float64(-u) - t1)) end
function tmp = code(u, v, t1) tmp = ((t1 / (t1 + u)) * v) / (-u - t1); end
code[u_, v_, t1_] := N[(N[(N[(t1 / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * v), $MachinePrecision] / N[((-u) - t1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{t1}{t1 + u} \cdot v}{\left(-u\right) - t1}
\end{array}
Initial program 70.6%
associate-/l*71.0%
distribute-lft-neg-out71.0%
distribute-rgt-neg-in71.0%
associate-/r*82.0%
distribute-neg-frac282.0%
Simplified82.0%
distribute-frac-neg282.0%
distribute-rgt-neg-out82.0%
associate-/r*71.0%
distribute-lft-neg-out71.0%
associate-/l*70.6%
times-frac98.0%
frac-2neg98.0%
associate-*r/98.7%
add-sqr-sqrt44.7%
sqrt-unprod43.0%
sqr-neg43.0%
sqrt-unprod19.9%
add-sqr-sqrt35.3%
add-sqr-sqrt14.7%
sqrt-unprod58.4%
sqr-neg58.4%
sqrt-prod54.7%
add-sqr-sqrt98.7%
Applied egg-rr98.7%
Final simplification98.7%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (- (- u) t1)))
(if (or (<= t1 -5e+175) (not (<= t1 1.2e+93)))
(/ v t_1)
(* t1 (/ (/ v (+ t1 u)) t_1)))))
double code(double u, double v, double t1) {
double t_1 = -u - t1;
double tmp;
if ((t1 <= -5e+175) || !(t1 <= 1.2e+93)) {
tmp = v / t_1;
} else {
tmp = t1 * ((v / (t1 + u)) / t_1);
}
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 = -u - t1
if ((t1 <= (-5d+175)) .or. (.not. (t1 <= 1.2d+93))) then
tmp = v / t_1
else
tmp = t1 * ((v / (t1 + u)) / t_1)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = -u - t1;
double tmp;
if ((t1 <= -5e+175) || !(t1 <= 1.2e+93)) {
tmp = v / t_1;
} else {
tmp = t1 * ((v / (t1 + u)) / t_1);
}
return tmp;
}
def code(u, v, t1): t_1 = -u - t1 tmp = 0 if (t1 <= -5e+175) or not (t1 <= 1.2e+93): tmp = v / t_1 else: tmp = t1 * ((v / (t1 + u)) / t_1) return tmp
function code(u, v, t1) t_1 = Float64(Float64(-u) - t1) tmp = 0.0 if ((t1 <= -5e+175) || !(t1 <= 1.2e+93)) tmp = Float64(v / t_1); else tmp = Float64(t1 * Float64(Float64(v / Float64(t1 + u)) / t_1)); end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -u - t1; tmp = 0.0; if ((t1 <= -5e+175) || ~((t1 <= 1.2e+93))) tmp = v / t_1; else tmp = t1 * ((v / (t1 + u)) / t_1); end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-u) - t1), $MachinePrecision]}, If[Or[LessEqual[t1, -5e+175], N[Not[LessEqual[t1, 1.2e+93]], $MachinePrecision]], N[(v / t$95$1), $MachinePrecision], N[(t1 * N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-u\right) - t1\\
\mathbf{if}\;t1 \leq -5 \cdot 10^{+175} \lor \neg \left(t1 \leq 1.2 \cdot 10^{+93}\right):\\
\;\;\;\;\frac{v}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t1 \cdot \frac{\frac{v}{t1 + u}}{t\_1}\\
\end{array}
\end{array}
if t1 < -5e175 or 1.20000000000000005e93 < t1 Initial program 52.8%
associate-/l*55.3%
distribute-lft-neg-out55.3%
distribute-rgt-neg-in55.3%
associate-/r*67.5%
distribute-neg-frac267.5%
Simplified67.5%
distribute-frac-neg267.5%
distribute-rgt-neg-out67.5%
associate-/r*55.3%
distribute-lft-neg-out55.3%
associate-/l*52.8%
times-frac99.9%
frac-2neg99.9%
associate-*r/99.9%
add-sqr-sqrt39.7%
sqrt-unprod6.9%
sqr-neg6.9%
sqrt-unprod25.0%
add-sqr-sqrt45.4%
add-sqr-sqrt21.9%
sqrt-unprod56.6%
sqr-neg56.6%
sqrt-prod53.1%
add-sqr-sqrt99.9%
Applied egg-rr99.9%
Taylor expanded in t1 around inf 89.8%
mul-1-neg89.8%
Simplified89.8%
if -5e175 < t1 < 1.20000000000000005e93Initial program 78.0%
associate-/l*77.5%
distribute-lft-neg-out77.5%
distribute-rgt-neg-in77.5%
associate-/r*88.1%
distribute-neg-frac288.1%
Simplified88.1%
Final simplification88.6%
(FPCore (u v t1) :precision binary64 (if (or (<= u -3.7e-47) (not (<= u 1.22e+23))) (/ (* t1 (/ v u)) (- u)) (/ v (- t1))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -3.7e-47) || !(u <= 1.22e+23)) {
tmp = (t1 * (v / u)) / -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 <= (-3.7d-47)) .or. (.not. (u <= 1.22d+23))) then
tmp = (t1 * (v / u)) / -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 <= -3.7e-47) || !(u <= 1.22e+23)) {
tmp = (t1 * (v / u)) / -u;
} else {
tmp = v / -t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -3.7e-47) or not (u <= 1.22e+23): tmp = (t1 * (v / u)) / -u else: tmp = v / -t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -3.7e-47) || !(u <= 1.22e+23)) tmp = Float64(Float64(t1 * Float64(v / u)) / Float64(-u)); else tmp = Float64(v / Float64(-t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -3.7e-47) || ~((u <= 1.22e+23))) tmp = (t1 * (v / u)) / -u; else tmp = v / -t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -3.7e-47], N[Not[LessEqual[u, 1.22e+23]], $MachinePrecision]], N[(N[(t1 * N[(v / u), $MachinePrecision]), $MachinePrecision] / (-u)), $MachinePrecision], N[(v / (-t1)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -3.7 \cdot 10^{-47} \lor \neg \left(u \leq 1.22 \cdot 10^{+23}\right):\\
\;\;\;\;\frac{t1 \cdot \frac{v}{u}}{-u}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{-t1}\\
\end{array}
\end{array}
if u < -3.7e-47 or 1.22e23 < u Initial program 77.2%
associate-/l*77.7%
distribute-lft-neg-out77.7%
distribute-rgt-neg-in77.7%
associate-/r*88.2%
distribute-neg-frac288.2%
Simplified88.2%
Taylor expanded in t1 around 0 78.6%
Taylor expanded in t1 around 0 76.8%
associate-*r/79.7%
frac-2neg79.7%
remove-double-neg79.7%
Applied egg-rr79.7%
if -3.7e-47 < u < 1.22e23Initial program 63.7%
Taylor expanded in t1 around inf 80.8%
associate-*r/80.8%
neg-mul-180.8%
Simplified80.8%
Final simplification80.3%
(FPCore (u v t1) :precision binary64 (if (or (<= u -2.3e-46) (not (<= u 1.55e+18))) (* t1 (/ (/ v u) (- u))) (/ v (- t1))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -2.3e-46) || !(u <= 1.55e+18)) {
tmp = t1 * ((v / u) / -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 <= (-2.3d-46)) .or. (.not. (u <= 1.55d+18))) then
tmp = t1 * ((v / u) / -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 <= -2.3e-46) || !(u <= 1.55e+18)) {
tmp = t1 * ((v / u) / -u);
} else {
tmp = v / -t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -2.3e-46) or not (u <= 1.55e+18): tmp = t1 * ((v / u) / -u) else: tmp = v / -t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -2.3e-46) || !(u <= 1.55e+18)) tmp = Float64(t1 * Float64(Float64(v / u) / Float64(-u))); else tmp = Float64(v / Float64(-t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -2.3e-46) || ~((u <= 1.55e+18))) tmp = t1 * ((v / u) / -u); else tmp = v / -t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -2.3e-46], N[Not[LessEqual[u, 1.55e+18]], $MachinePrecision]], N[(t1 * N[(N[(v / u), $MachinePrecision] / (-u)), $MachinePrecision]), $MachinePrecision], N[(v / (-t1)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.3 \cdot 10^{-46} \lor \neg \left(u \leq 1.55 \cdot 10^{+18}\right):\\
\;\;\;\;t1 \cdot \frac{\frac{v}{u}}{-u}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{-t1}\\
\end{array}
\end{array}
if u < -2.2999999999999999e-46 or 1.55e18 < u Initial program 77.2%
associate-/l*77.7%
distribute-lft-neg-out77.7%
distribute-rgt-neg-in77.7%
associate-/r*88.2%
distribute-neg-frac288.2%
Simplified88.2%
Taylor expanded in t1 around 0 78.6%
Taylor expanded in t1 around 0 76.8%
if -2.2999999999999999e-46 < u < 1.55e18Initial program 63.7%
Taylor expanded in t1 around inf 80.8%
associate-*r/80.8%
neg-mul-180.8%
Simplified80.8%
Final simplification78.8%
(FPCore (u v t1) :precision binary64 (if (<= u -2.9e-47) (* t1 (/ (/ v u) (- (- u) t1))) (if (<= u 2.1e+18) (/ v (- t1)) (/ (* t1 (/ v u)) (- u)))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -2.9e-47) {
tmp = t1 * ((v / u) / (-u - t1));
} else if (u <= 2.1e+18) {
tmp = v / -t1;
} else {
tmp = (t1 * (v / 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 (u <= (-2.9d-47)) then
tmp = t1 * ((v / u) / (-u - t1))
else if (u <= 2.1d+18) then
tmp = v / -t1
else
tmp = (t1 * (v / u)) / -u
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -2.9e-47) {
tmp = t1 * ((v / u) / (-u - t1));
} else if (u <= 2.1e+18) {
tmp = v / -t1;
} else {
tmp = (t1 * (v / u)) / -u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -2.9e-47: tmp = t1 * ((v / u) / (-u - t1)) elif u <= 2.1e+18: tmp = v / -t1 else: tmp = (t1 * (v / u)) / -u return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -2.9e-47) tmp = Float64(t1 * Float64(Float64(v / u) / Float64(Float64(-u) - t1))); elseif (u <= 2.1e+18) tmp = Float64(v / Float64(-t1)); else tmp = Float64(Float64(t1 * Float64(v / u)) / Float64(-u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -2.9e-47) tmp = t1 * ((v / u) / (-u - t1)); elseif (u <= 2.1e+18) tmp = v / -t1; else tmp = (t1 * (v / u)) / -u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -2.9e-47], N[(t1 * N[(N[(v / u), $MachinePrecision] / N[((-u) - t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 2.1e+18], N[(v / (-t1)), $MachinePrecision], N[(N[(t1 * N[(v / u), $MachinePrecision]), $MachinePrecision] / (-u)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.9 \cdot 10^{-47}:\\
\;\;\;\;t1 \cdot \frac{\frac{v}{u}}{\left(-u\right) - t1}\\
\mathbf{elif}\;u \leq 2.1 \cdot 10^{+18}:\\
\;\;\;\;\frac{v}{-t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t1 \cdot \frac{v}{u}}{-u}\\
\end{array}
\end{array}
if u < -2.9e-47Initial program 77.7%
associate-/l*78.2%
distribute-lft-neg-out78.2%
distribute-rgt-neg-in78.2%
associate-/r*90.6%
distribute-neg-frac290.6%
Simplified90.6%
Taylor expanded in t1 around 0 81.8%
if -2.9e-47 < u < 2.1e18Initial program 63.7%
Taylor expanded in t1 around inf 80.8%
associate-*r/80.8%
neg-mul-180.8%
Simplified80.8%
if 2.1e18 < u Initial program 76.7%
associate-/l*77.3%
distribute-lft-neg-out77.3%
distribute-rgt-neg-in77.3%
associate-/r*86.1%
distribute-neg-frac286.1%
Simplified86.1%
Taylor expanded in t1 around 0 75.9%
Taylor expanded in t1 around 0 74.7%
associate-*r/79.8%
frac-2neg79.8%
remove-double-neg79.8%
Applied egg-rr79.8%
Final simplification80.8%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -1.85e-176) (not (<= t1 1.05e-167))) (/ v (- (- u) t1)) (/ (/ (* t1 v) u) u)))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.85e-176) || !(t1 <= 1.05e-167)) {
tmp = v / (-u - t1);
} else {
tmp = ((t1 * v) / 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 <= (-1.85d-176)) .or. (.not. (t1 <= 1.05d-167))) then
tmp = v / (-u - t1)
else
tmp = ((t1 * v) / u) / u
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.85e-176) || !(t1 <= 1.05e-167)) {
tmp = v / (-u - t1);
} else {
tmp = ((t1 * v) / u) / u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -1.85e-176) or not (t1 <= 1.05e-167): tmp = v / (-u - t1) else: tmp = ((t1 * v) / u) / u return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -1.85e-176) || !(t1 <= 1.05e-167)) tmp = Float64(v / Float64(Float64(-u) - t1)); else tmp = Float64(Float64(Float64(t1 * v) / u) / u); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -1.85e-176) || ~((t1 <= 1.05e-167))) tmp = v / (-u - t1); else tmp = ((t1 * v) / u) / u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -1.85e-176], N[Not[LessEqual[t1, 1.05e-167]], $MachinePrecision]], N[(v / N[((-u) - t1), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t1 * v), $MachinePrecision] / u), $MachinePrecision] / u), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.85 \cdot 10^{-176} \lor \neg \left(t1 \leq 1.05 \cdot 10^{-167}\right):\\
\;\;\;\;\frac{v}{\left(-u\right) - t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{t1 \cdot v}{u}}{u}\\
\end{array}
\end{array}
if t1 < -1.84999999999999992e-176 or 1.05000000000000009e-167 < t1 Initial program 68.6%
associate-/l*70.1%
distribute-lft-neg-out70.1%
distribute-rgt-neg-in70.1%
associate-/r*82.0%
distribute-neg-frac282.0%
Simplified82.0%
distribute-frac-neg282.0%
distribute-rgt-neg-out82.0%
associate-/r*70.1%
distribute-lft-neg-out70.1%
associate-/l*68.6%
times-frac99.4%
frac-2neg99.4%
associate-*r/99.4%
add-sqr-sqrt47.4%
sqrt-unprod38.7%
sqr-neg38.7%
sqrt-unprod16.1%
add-sqr-sqrt28.9%
add-sqr-sqrt11.9%
sqrt-unprod54.2%
sqr-neg54.2%
sqrt-prod53.4%
add-sqr-sqrt99.4%
Applied egg-rr99.4%
Taylor expanded in t1 around inf 73.5%
mul-1-neg73.5%
Simplified73.5%
if -1.84999999999999992e-176 < t1 < 1.05000000000000009e-167Initial program 77.4%
associate-/l*74.1%
distribute-lft-neg-out74.1%
distribute-rgt-neg-in74.1%
associate-/r*82.3%
distribute-neg-frac282.3%
Simplified82.3%
Taylor expanded in t1 around 0 76.9%
Taylor expanded in t1 around 0 78.7%
associate-*r/85.8%
add-sqr-sqrt38.3%
sqrt-unprod66.5%
sqr-neg66.5%
sqrt-unprod32.6%
add-sqr-sqrt56.6%
Applied egg-rr56.6%
Taylor expanded in t1 around 0 56.8%
Final simplification69.7%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -3.8e-175) (not (<= t1 1.25e-167))) (/ v (- (- u) t1)) (/ (* t1 (/ v u)) u)))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -3.8e-175) || !(t1 <= 1.25e-167)) {
tmp = v / (-u - t1);
} else {
tmp = (t1 * (v / 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 <= (-3.8d-175)) .or. (.not. (t1 <= 1.25d-167))) then
tmp = v / (-u - t1)
else
tmp = (t1 * (v / u)) / u
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -3.8e-175) || !(t1 <= 1.25e-167)) {
tmp = v / (-u - t1);
} else {
tmp = (t1 * (v / u)) / u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -3.8e-175) or not (t1 <= 1.25e-167): tmp = v / (-u - t1) else: tmp = (t1 * (v / u)) / u return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -3.8e-175) || !(t1 <= 1.25e-167)) tmp = Float64(v / Float64(Float64(-u) - t1)); else tmp = Float64(Float64(t1 * Float64(v / u)) / u); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -3.8e-175) || ~((t1 <= 1.25e-167))) tmp = v / (-u - t1); else tmp = (t1 * (v / u)) / u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -3.8e-175], N[Not[LessEqual[t1, 1.25e-167]], $MachinePrecision]], N[(v / N[((-u) - t1), $MachinePrecision]), $MachinePrecision], N[(N[(t1 * N[(v / u), $MachinePrecision]), $MachinePrecision] / u), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -3.8 \cdot 10^{-175} \lor \neg \left(t1 \leq 1.25 \cdot 10^{-167}\right):\\
\;\;\;\;\frac{v}{\left(-u\right) - t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t1 \cdot \frac{v}{u}}{u}\\
\end{array}
\end{array}
if t1 < -3.8e-175 or 1.25000000000000005e-167 < t1 Initial program 68.6%
associate-/l*70.1%
distribute-lft-neg-out70.1%
distribute-rgt-neg-in70.1%
associate-/r*82.0%
distribute-neg-frac282.0%
Simplified82.0%
distribute-frac-neg282.0%
distribute-rgt-neg-out82.0%
associate-/r*70.1%
distribute-lft-neg-out70.1%
associate-/l*68.6%
times-frac99.4%
frac-2neg99.4%
associate-*r/99.4%
add-sqr-sqrt47.4%
sqrt-unprod38.7%
sqr-neg38.7%
sqrt-unprod16.1%
add-sqr-sqrt28.9%
add-sqr-sqrt11.9%
sqrt-unprod54.2%
sqr-neg54.2%
sqrt-prod53.4%
add-sqr-sqrt99.4%
Applied egg-rr99.4%
Taylor expanded in t1 around inf 73.5%
mul-1-neg73.5%
Simplified73.5%
if -3.8e-175 < t1 < 1.25000000000000005e-167Initial program 77.4%
associate-/l*74.1%
distribute-lft-neg-out74.1%
distribute-rgt-neg-in74.1%
associate-/r*82.3%
distribute-neg-frac282.3%
Simplified82.3%
Taylor expanded in t1 around 0 76.9%
Taylor expanded in t1 around 0 78.7%
associate-*r/85.8%
add-sqr-sqrt38.3%
sqrt-unprod66.5%
sqr-neg66.5%
sqrt-unprod32.6%
add-sqr-sqrt56.6%
Applied egg-rr56.6%
Final simplification69.6%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -1.46e-170) (not (<= t1 6.2e-168))) (/ v (- (- u) t1)) (* (/ v u) (/ t1 u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.46e-170) || !(t1 <= 6.2e-168)) {
tmp = v / (-u - t1);
} else {
tmp = (v / u) * (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 ((t1 <= (-1.46d-170)) .or. (.not. (t1 <= 6.2d-168))) then
tmp = v / (-u - t1)
else
tmp = (v / u) * (t1 / u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.46e-170) || !(t1 <= 6.2e-168)) {
tmp = v / (-u - t1);
} else {
tmp = (v / u) * (t1 / u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -1.46e-170) or not (t1 <= 6.2e-168): tmp = v / (-u - t1) else: tmp = (v / u) * (t1 / u) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -1.46e-170) || !(t1 <= 6.2e-168)) tmp = Float64(v / Float64(Float64(-u) - t1)); else tmp = Float64(Float64(v / u) * Float64(t1 / u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -1.46e-170) || ~((t1 <= 6.2e-168))) tmp = v / (-u - t1); else tmp = (v / u) * (t1 / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -1.46e-170], N[Not[LessEqual[t1, 6.2e-168]], $MachinePrecision]], N[(v / N[((-u) - t1), $MachinePrecision]), $MachinePrecision], N[(N[(v / u), $MachinePrecision] * N[(t1 / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.46 \cdot 10^{-170} \lor \neg \left(t1 \leq 6.2 \cdot 10^{-168}\right):\\
\;\;\;\;\frac{v}{\left(-u\right) - t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u} \cdot \frac{t1}{u}\\
\end{array}
\end{array}
if t1 < -1.46000000000000003e-170 or 6.2e-168 < t1 Initial program 68.6%
associate-/l*70.1%
distribute-lft-neg-out70.1%
distribute-rgt-neg-in70.1%
associate-/r*82.0%
distribute-neg-frac282.0%
Simplified82.0%
distribute-frac-neg282.0%
distribute-rgt-neg-out82.0%
associate-/r*70.1%
distribute-lft-neg-out70.1%
associate-/l*68.6%
times-frac99.4%
frac-2neg99.4%
associate-*r/99.4%
add-sqr-sqrt47.4%
sqrt-unprod38.7%
sqr-neg38.7%
sqrt-unprod16.1%
add-sqr-sqrt28.9%
add-sqr-sqrt11.9%
sqrt-unprod54.2%
sqr-neg54.2%
sqrt-prod53.4%
add-sqr-sqrt99.4%
Applied egg-rr99.4%
Taylor expanded in t1 around inf 73.5%
mul-1-neg73.5%
Simplified73.5%
if -1.46000000000000003e-170 < t1 < 6.2e-168Initial program 77.4%
Taylor expanded in t1 around 0 75.7%
Taylor expanded in t1 around 0 77.4%
associate-/l*74.1%
add-sqr-sqrt29.2%
sqrt-unprod56.6%
sqr-neg56.6%
sqrt-unprod32.5%
add-sqr-sqrt56.4%
associate-/r*56.5%
associate-/l*56.6%
*-commutative56.6%
associate-/l*56.6%
Applied egg-rr56.6%
Final simplification69.6%
(FPCore (u v t1) :precision binary64 (if (or (<= u -4.5e+142) (not (<= u 2.25e+198))) (/ 1.0 (/ u v)) (/ v (- t1))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -4.5e+142) || !(u <= 2.25e+198)) {
tmp = 1.0 / (u / v);
} 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 <= (-4.5d+142)) .or. (.not. (u <= 2.25d+198))) then
tmp = 1.0d0 / (u / v)
else
tmp = v / -t1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((u <= -4.5e+142) || !(u <= 2.25e+198)) {
tmp = 1.0 / (u / v);
} else {
tmp = v / -t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -4.5e+142) or not (u <= 2.25e+198): tmp = 1.0 / (u / v) else: tmp = v / -t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -4.5e+142) || !(u <= 2.25e+198)) tmp = Float64(1.0 / Float64(u / v)); else tmp = Float64(v / Float64(-t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -4.5e+142) || ~((u <= 2.25e+198))) tmp = 1.0 / (u / v); else tmp = v / -t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -4.5e+142], N[Not[LessEqual[u, 2.25e+198]], $MachinePrecision]], N[(1.0 / N[(u / v), $MachinePrecision]), $MachinePrecision], N[(v / (-t1)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -4.5 \cdot 10^{+142} \lor \neg \left(u \leq 2.25 \cdot 10^{+198}\right):\\
\;\;\;\;\frac{1}{\frac{u}{v}}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{-t1}\\
\end{array}
\end{array}
if u < -4.4999999999999999e142 or 2.25000000000000001e198 < u Initial program 76.0%
associate-/l*76.4%
distribute-lft-neg-out76.4%
distribute-rgt-neg-in76.4%
associate-/r*91.1%
distribute-neg-frac291.1%
Simplified91.1%
Taylor expanded in t1 around 0 89.8%
Taylor expanded in t1 around inf 43.8%
neg-mul-143.8%
distribute-neg-frac243.8%
Simplified43.8%
add-sqr-sqrt23.7%
sqrt-unprod43.4%
sqr-neg43.4%
sqrt-unprod20.4%
add-sqr-sqrt44.1%
frac-2neg44.1%
clear-num45.4%
inv-pow45.4%
Applied egg-rr45.4%
unpow-145.4%
Simplified45.4%
if -4.4999999999999999e142 < u < 2.25000000000000001e198Initial program 69.0%
Taylor expanded in t1 around inf 63.8%
associate-*r/63.8%
neg-mul-163.8%
Simplified63.8%
Final simplification59.7%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -2.35e+67) (not (<= t1 8.3e+111))) (/ v t1) (/ v (- u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -2.35e+67) || !(t1 <= 8.3e+111)) {
tmp = v / t1;
} else {
tmp = v / -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.35d+67)) .or. (.not. (t1 <= 8.3d+111))) then
tmp = v / t1
else
tmp = v / -u
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -2.35e+67) || !(t1 <= 8.3e+111)) {
tmp = v / t1;
} else {
tmp = v / -u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -2.35e+67) or not (t1 <= 8.3e+111): tmp = v / t1 else: tmp = v / -u return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -2.35e+67) || !(t1 <= 8.3e+111)) tmp = Float64(v / t1); else tmp = Float64(v / Float64(-u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -2.35e+67) || ~((t1 <= 8.3e+111))) tmp = v / t1; else tmp = v / -u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -2.35e+67], N[Not[LessEqual[t1, 8.3e+111]], $MachinePrecision]], N[(v / t1), $MachinePrecision], N[(v / (-u)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -2.35 \cdot 10^{+67} \lor \neg \left(t1 \leq 8.3 \cdot 10^{+111}\right):\\
\;\;\;\;\frac{v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{-u}\\
\end{array}
\end{array}
if t1 < -2.35000000000000009e67 or 8.29999999999999976e111 < t1 Initial program 51.5%
times-frac99.9%
distribute-frac-neg99.9%
distribute-neg-frac299.9%
+-commutative99.9%
distribute-neg-in99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in t1 around inf 85.7%
Taylor expanded in u around inf 35.7%
if -2.35000000000000009e67 < t1 < 8.29999999999999976e111Initial program 81.1%
associate-/l*80.5%
distribute-lft-neg-out80.5%
distribute-rgt-neg-in80.5%
associate-/r*89.1%
distribute-neg-frac289.1%
Simplified89.1%
Taylor expanded in t1 around 0 61.2%
Taylor expanded in t1 around inf 17.5%
neg-mul-117.5%
distribute-neg-frac217.5%
Simplified17.5%
Final simplification23.9%
(FPCore (u v t1) :precision binary64 (* (/ t1 (+ t1 u)) (/ v (- (- u) t1))))
double code(double u, double v, double t1) {
return (t1 / (t1 + u)) * (v / (-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 = (t1 / (t1 + u)) * (v / (-u - t1))
end function
public static double code(double u, double v, double t1) {
return (t1 / (t1 + u)) * (v / (-u - t1));
}
def code(u, v, t1): return (t1 / (t1 + u)) * (v / (-u - t1))
function code(u, v, t1) return Float64(Float64(t1 / Float64(t1 + u)) * Float64(v / Float64(Float64(-u) - t1))) end
function tmp = code(u, v, t1) tmp = (t1 / (t1 + u)) * (v / (-u - t1)); end
code[u_, v_, t1_] := N[(N[(t1 / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(v / N[((-u) - t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{t1}{t1 + u} \cdot \frac{v}{\left(-u\right) - t1}
\end{array}
Initial program 70.6%
times-frac98.0%
distribute-frac-neg98.0%
distribute-neg-frac298.0%
+-commutative98.0%
distribute-neg-in98.0%
unsub-neg98.0%
Simplified98.0%
Final simplification98.0%
(FPCore (u v t1) :precision binary64 (if (<= u 5e+201) (/ v (- t1)) (/ v (- u))))
double code(double u, double v, double t1) {
double tmp;
if (u <= 5e+201) {
tmp = v / -t1;
} else {
tmp = v / -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 <= 5d+201) then
tmp = v / -t1
else
tmp = v / -u
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= 5e+201) {
tmp = v / -t1;
} else {
tmp = v / -u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= 5e+201: tmp = v / -t1 else: tmp = v / -u return tmp
function code(u, v, t1) tmp = 0.0 if (u <= 5e+201) tmp = Float64(v / Float64(-t1)); else tmp = Float64(v / Float64(-u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= 5e+201) tmp = v / -t1; else tmp = v / -u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, 5e+201], N[(v / (-t1)), $MachinePrecision], N[(v / (-u)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq 5 \cdot 10^{+201}:\\
\;\;\;\;\frac{v}{-t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{-u}\\
\end{array}
\end{array}
if u < 4.9999999999999995e201Initial program 69.4%
Taylor expanded in t1 around inf 58.5%
associate-*r/58.5%
neg-mul-158.5%
Simplified58.5%
if 4.9999999999999995e201 < u Initial program 82.9%
associate-/l*83.1%
distribute-lft-neg-out83.1%
distribute-rgt-neg-in83.1%
associate-/r*87.3%
distribute-neg-frac287.3%
Simplified87.3%
Taylor expanded in t1 around 0 87.3%
Taylor expanded in t1 around inf 51.1%
neg-mul-151.1%
distribute-neg-frac251.1%
Simplified51.1%
Final simplification57.9%
(FPCore (u v t1) :precision binary64 (/ v (- (- u) t1)))
double code(double u, double v, double t1) {
return v / (-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 / (-u - t1)
end function
public static double code(double u, double v, double t1) {
return v / (-u - t1);
}
def code(u, v, t1): return v / (-u - t1)
function code(u, v, t1) return Float64(v / Float64(Float64(-u) - t1)) end
function tmp = code(u, v, t1) tmp = v / (-u - t1); end
code[u_, v_, t1_] := N[(v / N[((-u) - t1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{v}{\left(-u\right) - t1}
\end{array}
Initial program 70.6%
associate-/l*71.0%
distribute-lft-neg-out71.0%
distribute-rgt-neg-in71.0%
associate-/r*82.0%
distribute-neg-frac282.0%
Simplified82.0%
distribute-frac-neg282.0%
distribute-rgt-neg-out82.0%
associate-/r*71.0%
distribute-lft-neg-out71.0%
associate-/l*70.6%
times-frac98.0%
frac-2neg98.0%
associate-*r/98.7%
add-sqr-sqrt44.7%
sqrt-unprod43.0%
sqr-neg43.0%
sqrt-unprod19.9%
add-sqr-sqrt35.3%
add-sqr-sqrt14.7%
sqrt-unprod58.4%
sqr-neg58.4%
sqrt-prod54.7%
add-sqr-sqrt98.7%
Applied egg-rr98.7%
Taylor expanded in t1 around inf 61.7%
mul-1-neg61.7%
Simplified61.7%
Final simplification61.7%
(FPCore (u v t1) :precision binary64 (/ v t1))
double code(double u, double v, double t1) {
return v / 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
end function
public static double code(double u, double v, double t1) {
return v / t1;
}
def code(u, v, t1): return v / t1
function code(u, v, t1) return Float64(v / t1) end
function tmp = code(u, v, t1) tmp = v / t1; end
code[u_, v_, t1_] := N[(v / t1), $MachinePrecision]
\begin{array}{l}
\\
\frac{v}{t1}
\end{array}
Initial program 70.6%
times-frac98.0%
distribute-frac-neg98.0%
distribute-neg-frac298.0%
+-commutative98.0%
distribute-neg-in98.0%
unsub-neg98.0%
Simplified98.0%
Taylor expanded in t1 around inf 57.1%
Taylor expanded in u around inf 15.1%
herbie shell --seed 2024113
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))