
(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 (+ t1 u))))
double code(double u, double v, double t1) {
return (-t1 / (t1 + u)) * (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 = (-t1 / (t1 + u)) * (v / (t1 + u))
end function
public static double code(double u, double v, double t1) {
return (-t1 / (t1 + u)) * (v / (t1 + u));
}
def code(u, v, t1): return (-t1 / (t1 + u)) * (v / (t1 + u))
function code(u, v, t1) return Float64(Float64(Float64(-t1) / Float64(t1 + u)) * Float64(v / Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = (-t1 / (t1 + u)) * (v / (t1 + u)); end
code[u_, v_, t1_] := N[(N[((-t1) / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}
\end{array}
Initial program 74.2%
times-frac97.5%
Simplified97.5%
Final simplification97.5%
(FPCore (u v t1) :precision binary64 (if (or (<= u -1.9e+48) (not (<= u 1.5e+165))) (/ (/ t1 u) (/ u v)) (/ (- v) (+ t1 (* u 2.0)))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -1.9e+48) || !(u <= 1.5e+165)) {
tmp = (t1 / u) / (u / v);
} else {
tmp = -v / (t1 + (u * 2.0));
}
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.9d+48)) .or. (.not. (u <= 1.5d+165))) then
tmp = (t1 / u) / (u / v)
else
tmp = -v / (t1 + (u * 2.0d0))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((u <= -1.9e+48) || !(u <= 1.5e+165)) {
tmp = (t1 / u) / (u / v);
} else {
tmp = -v / (t1 + (u * 2.0));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -1.9e+48) or not (u <= 1.5e+165): tmp = (t1 / u) / (u / v) else: tmp = -v / (t1 + (u * 2.0)) return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -1.9e+48) || !(u <= 1.5e+165)) tmp = Float64(Float64(t1 / u) / Float64(u / v)); else tmp = Float64(Float64(-v) / Float64(t1 + Float64(u * 2.0))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -1.9e+48) || ~((u <= 1.5e+165))) tmp = (t1 / u) / (u / v); else tmp = -v / (t1 + (u * 2.0)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -1.9e+48], N[Not[LessEqual[u, 1.5e+165]], $MachinePrecision]], N[(N[(t1 / u), $MachinePrecision] / N[(u / v), $MachinePrecision]), $MachinePrecision], N[((-v) / N[(t1 + N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.9 \cdot 10^{+48} \lor \neg \left(u \leq 1.5 \cdot 10^{+165}\right):\\
\;\;\;\;\frac{\frac{t1}{u}}{\frac{u}{v}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1 + u \cdot 2}\\
\end{array}
\end{array}
if u < -1.9e48 or 1.49999999999999995e165 < u Initial program 78.6%
times-frac96.4%
Simplified96.4%
Taylor expanded in t1 around 0 81.9%
Taylor expanded in t1 around 0 81.9%
associate-*r/81.9%
neg-mul-181.9%
Simplified81.9%
clear-num81.8%
un-div-inv81.8%
add-sqr-sqrt40.9%
sqrt-unprod59.2%
sqr-neg59.2%
sqrt-unprod32.9%
add-sqr-sqrt64.5%
Applied egg-rr64.5%
if -1.9e48 < u < 1.49999999999999995e165Initial program 72.2%
*-commutative72.2%
times-frac98.0%
neg-mul-198.0%
associate-/l*97.6%
associate-*r/97.6%
associate-/l*97.6%
associate-/l/97.6%
neg-mul-197.6%
*-lft-identity97.6%
metadata-eval97.6%
times-frac97.6%
neg-mul-197.6%
remove-double-neg97.6%
neg-mul-197.6%
sub0-neg97.6%
associate--r+97.6%
neg-sub097.6%
div-sub97.6%
distribute-frac-neg97.6%
*-inverses97.6%
metadata-eval97.6%
Simplified97.6%
Taylor expanded in v around 0 96.6%
mul-1-neg96.6%
+-commutative96.6%
Simplified96.6%
Taylor expanded in t1 around inf 68.7%
*-commutative68.7%
Simplified68.7%
Final simplification67.3%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -1.1e+14) (not (<= t1 0.000125))) (/ (- v) (+ t1 (* u 2.0))) (* t1 (/ (- v) (* u u)))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.1e+14) || !(t1 <= 0.000125)) {
tmp = -v / (t1 + (u * 2.0));
} 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.1d+14)) .or. (.not. (t1 <= 0.000125d0))) then
tmp = -v / (t1 + (u * 2.0d0))
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.1e+14) || !(t1 <= 0.000125)) {
tmp = -v / (t1 + (u * 2.0));
} else {
tmp = t1 * (-v / (u * u));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -1.1e+14) or not (t1 <= 0.000125): tmp = -v / (t1 + (u * 2.0)) else: tmp = t1 * (-v / (u * u)) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -1.1e+14) || !(t1 <= 0.000125)) tmp = Float64(Float64(-v) / Float64(t1 + Float64(u * 2.0))); else tmp = Float64(t1 * Float64(Float64(-v) / Float64(u * u))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -1.1e+14) || ~((t1 <= 0.000125))) tmp = -v / (t1 + (u * 2.0)); else tmp = t1 * (-v / (u * u)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -1.1e+14], N[Not[LessEqual[t1, 0.000125]], $MachinePrecision]], N[((-v) / N[(t1 + N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t1 * N[((-v) / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.1 \cdot 10^{+14} \lor \neg \left(t1 \leq 0.000125\right):\\
\;\;\;\;\frac{-v}{t1 + u \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;t1 \cdot \frac{-v}{u \cdot u}\\
\end{array}
\end{array}
if t1 < -1.1e14 or 1.25e-4 < t1 Initial program 64.9%
*-commutative64.9%
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 98.4%
mul-1-neg98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in t1 around inf 87.7%
*-commutative87.7%
Simplified87.7%
if -1.1e14 < t1 < 1.25e-4Initial program 83.3%
associate-/l*84.2%
neg-mul-184.2%
*-commutative84.2%
associate-*r/83.7%
associate-/l*83.7%
neg-mul-183.7%
associate-/r*89.6%
Simplified89.6%
Taylor expanded in t1 around 0 71.6%
associate-*r/71.6%
neg-mul-171.6%
unpow271.6%
Simplified71.6%
Final simplification79.5%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -1.05e+14) (not (<= t1 0.000205))) (/ (- v) (+ t1 (* u 2.0))) (* (/ v u) (/ (- t1) u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.05e+14) || !(t1 <= 0.000205)) {
tmp = -v / (t1 + (u * 2.0));
} 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.05d+14)) .or. (.not. (t1 <= 0.000205d0))) then
tmp = -v / (t1 + (u * 2.0d0))
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.05e+14) || !(t1 <= 0.000205)) {
tmp = -v / (t1 + (u * 2.0));
} else {
tmp = (v / u) * (-t1 / u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -1.05e+14) or not (t1 <= 0.000205): tmp = -v / (t1 + (u * 2.0)) else: tmp = (v / u) * (-t1 / u) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -1.05e+14) || !(t1 <= 0.000205)) tmp = Float64(Float64(-v) / Float64(t1 + Float64(u * 2.0))); else tmp = Float64(Float64(v / u) * Float64(Float64(-t1) / u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -1.05e+14) || ~((t1 <= 0.000205))) tmp = -v / (t1 + (u * 2.0)); else tmp = (v / u) * (-t1 / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -1.05e+14], N[Not[LessEqual[t1, 0.000205]], $MachinePrecision]], N[((-v) / N[(t1 + N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(v / u), $MachinePrecision] * N[((-t1) / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.05 \cdot 10^{+14} \lor \neg \left(t1 \leq 0.000205\right):\\
\;\;\;\;\frac{-v}{t1 + u \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u} \cdot \frac{-t1}{u}\\
\end{array}
\end{array}
if t1 < -1.05e14 or 2.05e-4 < t1 Initial program 64.9%
*-commutative64.9%
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 98.4%
mul-1-neg98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in t1 around inf 87.7%
*-commutative87.7%
Simplified87.7%
if -1.05e14 < t1 < 2.05e-4Initial program 83.3%
times-frac95.1%
Simplified95.1%
Taylor expanded in t1 around 0 73.8%
Taylor expanded in t1 around 0 76.4%
associate-*r/76.4%
neg-mul-176.4%
Simplified76.4%
Final simplification81.9%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -1e+14) (not (<= t1 13000.0))) (/ (- v) (+ t1 (* u 2.0))) (/ (* t1 (/ v u)) (- u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1e+14) || !(t1 <= 13000.0)) {
tmp = -v / (t1 + (u * 2.0));
} 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 <= (-1d+14)) .or. (.not. (t1 <= 13000.0d0))) then
tmp = -v / (t1 + (u * 2.0d0))
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 <= -1e+14) || !(t1 <= 13000.0)) {
tmp = -v / (t1 + (u * 2.0));
} else {
tmp = (t1 * (v / u)) / -u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -1e+14) or not (t1 <= 13000.0): tmp = -v / (t1 + (u * 2.0)) else: tmp = (t1 * (v / u)) / -u return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -1e+14) || !(t1 <= 13000.0)) tmp = Float64(Float64(-v) / Float64(t1 + Float64(u * 2.0))); 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 ((t1 <= -1e+14) || ~((t1 <= 13000.0))) tmp = -v / (t1 + (u * 2.0)); else tmp = (t1 * (v / u)) / -u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -1e+14], N[Not[LessEqual[t1, 13000.0]], $MachinePrecision]], N[((-v) / N[(t1 + N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t1 * N[(v / u), $MachinePrecision]), $MachinePrecision] / (-u)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1 \cdot 10^{+14} \lor \neg \left(t1 \leq 13000\right):\\
\;\;\;\;\frac{-v}{t1 + u \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{t1 \cdot \frac{v}{u}}{-u}\\
\end{array}
\end{array}
if t1 < -1e14 or 13000 < t1 Initial program 64.9%
*-commutative64.9%
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 98.4%
mul-1-neg98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in t1 around inf 87.7%
*-commutative87.7%
Simplified87.7%
if -1e14 < t1 < 13000Initial program 83.3%
times-frac95.1%
Simplified95.1%
Taylor expanded in t1 around 0 73.8%
Taylor expanded in t1 around 0 76.4%
associate-*r/76.4%
neg-mul-176.4%
Simplified76.4%
associate-*l/79.0%
frac-2neg79.0%
add-sqr-sqrt37.4%
sqrt-unprod49.4%
sqr-neg49.4%
sqrt-unprod20.4%
add-sqr-sqrt37.3%
distribute-lft-neg-out37.3%
add-sqr-sqrt16.8%
sqrt-unprod44.1%
sqr-neg44.1%
sqrt-unprod41.4%
add-sqr-sqrt79.0%
Applied egg-rr79.0%
Final simplification83.3%
(FPCore (u v t1) :precision binary64 (if (or (<= u -9.4e+47) (not (<= u 8e+168))) (* (/ v u) (/ t1 u)) (/ (- v) (+ t1 u))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -9.4e+47) || !(u <= 8e+168)) {
tmp = (v / u) * (t1 / 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 <= (-9.4d+47)) .or. (.not. (u <= 8d+168))) then
tmp = (v / u) * (t1 / 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 <= -9.4e+47) || !(u <= 8e+168)) {
tmp = (v / u) * (t1 / u);
} else {
tmp = -v / (t1 + u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -9.4e+47) or not (u <= 8e+168): tmp = (v / u) * (t1 / u) else: tmp = -v / (t1 + u) return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -9.4e+47) || !(u <= 8e+168)) tmp = Float64(Float64(v / u) * Float64(t1 / 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 <= -9.4e+47) || ~((u <= 8e+168))) tmp = (v / u) * (t1 / u); else tmp = -v / (t1 + u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -9.4e+47], N[Not[LessEqual[u, 8e+168]], $MachinePrecision]], N[(N[(v / u), $MachinePrecision] * N[(t1 / u), $MachinePrecision]), $MachinePrecision], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -9.4 \cdot 10^{+47} \lor \neg \left(u \leq 8 \cdot 10^{+168}\right):\\
\;\;\;\;\frac{v}{u} \cdot \frac{t1}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1 + u}\\
\end{array}
\end{array}
if u < -9.39999999999999928e47 or 7.9999999999999995e168 < u Initial program 78.6%
Taylor expanded in t1 around 0 72.4%
unpow272.4%
Simplified72.4%
*-commutative72.4%
times-frac81.9%
add-sqr-sqrt41.1%
sqrt-unprod59.4%
sqr-neg59.4%
sqrt-unprod32.9%
add-sqr-sqrt64.5%
Applied egg-rr64.5%
if -9.39999999999999928e47 < u < 7.9999999999999995e168Initial program 72.2%
times-frac98.0%
Simplified98.0%
Taylor expanded in t1 around inf 67.7%
Final simplification66.7%
(FPCore (u v t1) :precision binary64 (if (or (<= u -1.9e+48) (not (<= u 1.45e+165))) (/ (/ t1 u) (/ u v)) (/ (- v) (+ t1 u))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -1.9e+48) || !(u <= 1.45e+165)) {
tmp = (t1 / u) / (u / v);
} 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 <= (-1.9d+48)) .or. (.not. (u <= 1.45d+165))) then
tmp = (t1 / u) / (u / v)
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 <= -1.9e+48) || !(u <= 1.45e+165)) {
tmp = (t1 / u) / (u / v);
} else {
tmp = -v / (t1 + u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -1.9e+48) or not (u <= 1.45e+165): tmp = (t1 / u) / (u / v) else: tmp = -v / (t1 + u) return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -1.9e+48) || !(u <= 1.45e+165)) tmp = Float64(Float64(t1 / u) / Float64(u / v)); else tmp = Float64(Float64(-v) / Float64(t1 + u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -1.9e+48) || ~((u <= 1.45e+165))) tmp = (t1 / u) / (u / v); else tmp = -v / (t1 + u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -1.9e+48], N[Not[LessEqual[u, 1.45e+165]], $MachinePrecision]], N[(N[(t1 / u), $MachinePrecision] / N[(u / v), $MachinePrecision]), $MachinePrecision], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.9 \cdot 10^{+48} \lor \neg \left(u \leq 1.45 \cdot 10^{+165}\right):\\
\;\;\;\;\frac{\frac{t1}{u}}{\frac{u}{v}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1 + u}\\
\end{array}
\end{array}
if u < -1.9e48 or 1.45000000000000003e165 < u Initial program 78.6%
times-frac96.4%
Simplified96.4%
Taylor expanded in t1 around 0 81.9%
Taylor expanded in t1 around 0 81.9%
associate-*r/81.9%
neg-mul-181.9%
Simplified81.9%
clear-num81.8%
un-div-inv81.8%
add-sqr-sqrt40.9%
sqrt-unprod59.2%
sqr-neg59.2%
sqrt-unprod32.9%
add-sqr-sqrt64.5%
Applied egg-rr64.5%
if -1.9e48 < u < 1.45000000000000003e165Initial program 72.2%
times-frac98.0%
Simplified98.0%
Taylor expanded in t1 around inf 67.7%
Final simplification66.7%
(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 74.2%
*-commutative74.2%
times-frac97.5%
neg-mul-197.5%
associate-/l*97.2%
associate-*r/97.2%
associate-/l*97.2%
associate-/l/97.2%
neg-mul-197.2%
*-lft-identity97.2%
metadata-eval97.2%
times-frac97.2%
neg-mul-197.2%
remove-double-neg97.2%
neg-mul-197.2%
sub0-neg97.2%
associate--r+97.2%
neg-sub097.2%
div-sub97.3%
distribute-frac-neg97.3%
*-inverses97.3%
metadata-eval97.3%
Simplified97.3%
Final simplification97.3%
(FPCore (u v t1) :precision binary64 (if (<= u -4.2e+104) (* (/ v u) (- 0.5)) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if (u <= -4.2e+104) {
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 <= (-4.2d+104)) 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 <= -4.2e+104) {
tmp = (v / u) * -0.5;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -4.2e+104: tmp = (v / u) * -0.5 else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -4.2e+104) tmp = Float64(Float64(v / u) * Float64(-0.5)); else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -4.2e+104) tmp = (v / u) * -0.5; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -4.2e+104], N[(N[(v / u), $MachinePrecision] * (-0.5)), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -4.2 \cdot 10^{+104}:\\
\;\;\;\;\frac{v}{u} \cdot \left(-0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -4.1999999999999997e104Initial program 75.9%
*-commutative75.9%
times-frac93.7%
neg-mul-193.7%
associate-/l*93.7%
associate-*r/93.7%
associate-/l*93.7%
associate-/l/93.7%
neg-mul-193.7%
*-lft-identity93.7%
metadata-eval93.7%
times-frac93.7%
neg-mul-193.7%
remove-double-neg93.7%
neg-mul-193.7%
sub0-neg93.7%
associate--r+93.7%
neg-sub093.7%
div-sub93.7%
distribute-frac-neg93.7%
*-inverses93.7%
metadata-eval93.7%
Simplified93.7%
Taylor expanded in v around 0 82.8%
mul-1-neg82.8%
+-commutative82.8%
Simplified82.8%
Taylor expanded in t1 around inf 44.2%
*-commutative44.2%
Simplified44.2%
Taylor expanded in t1 around 0 33.5%
if -4.1999999999999997e104 < u Initial program 73.9%
times-frac98.3%
Simplified98.3%
Taylor expanded in t1 around inf 61.3%
associate-*r/61.3%
neg-mul-161.3%
Simplified61.3%
Final simplification56.4%
(FPCore (u v t1) :precision binary64 (if (<= u -5.2e+107) (/ (- 0.5) (/ u v)) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if (u <= -5.2e+107) {
tmp = -0.5 / (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 <= (-5.2d+107)) then
tmp = -0.5d0 / (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 <= -5.2e+107) {
tmp = -0.5 / (u / v);
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -5.2e+107: tmp = -0.5 / (u / v) else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -5.2e+107) tmp = Float64(Float64(-0.5) / Float64(u / v)); else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -5.2e+107) tmp = -0.5 / (u / v); else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -5.2e+107], N[((-0.5) / N[(u / v), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -5.2 \cdot 10^{+107}:\\
\;\;\;\;\frac{-0.5}{\frac{u}{v}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -5.2000000000000002e107Initial program 75.9%
*-commutative75.9%
times-frac93.7%
neg-mul-193.7%
associate-/l*93.7%
associate-*r/93.7%
associate-/l*93.7%
associate-/l/93.7%
neg-mul-193.7%
*-lft-identity93.7%
metadata-eval93.7%
times-frac93.7%
neg-mul-193.7%
remove-double-neg93.7%
neg-mul-193.7%
sub0-neg93.7%
associate--r+93.7%
neg-sub093.7%
div-sub93.7%
distribute-frac-neg93.7%
*-inverses93.7%
metadata-eval93.7%
Simplified93.7%
Taylor expanded in v around 0 82.8%
mul-1-neg82.8%
+-commutative82.8%
Simplified82.8%
Taylor expanded in t1 around inf 44.2%
*-commutative44.2%
Simplified44.2%
Taylor expanded in t1 around 0 33.5%
clear-num33.9%
un-div-inv33.9%
Applied egg-rr33.9%
if -5.2000000000000002e107 < u Initial program 73.9%
times-frac98.3%
Simplified98.3%
Taylor expanded in t1 around inf 61.3%
associate-*r/61.3%
neg-mul-161.3%
Simplified61.3%
Final simplification56.5%
(FPCore (u v t1) :precision binary64 (if (<= u -3.4e+107) (/ (* v (- -0.5)) u) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if (u <= -3.4e+107) {
tmp = (v * -(-0.5)) / 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.4d+107)) then
tmp = (v * -(-0.5d0)) / 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.4e+107) {
tmp = (v * -(-0.5)) / u;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -3.4e+107: tmp = (v * -(-0.5)) / u else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -3.4e+107) tmp = Float64(Float64(v * Float64(-(-0.5))) / u); else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -3.4e+107) tmp = (v * -(-0.5)) / u; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -3.4e+107], N[(N[(v * (--0.5)), $MachinePrecision] / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -3.4 \cdot 10^{+107}:\\
\;\;\;\;\frac{v \cdot \left(--0.5\right)}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -3.3999999999999997e107Initial program 75.9%
*-commutative75.9%
times-frac93.7%
neg-mul-193.7%
associate-/l*93.7%
associate-*r/93.7%
associate-/l*93.7%
associate-/l/93.7%
neg-mul-193.7%
*-lft-identity93.7%
metadata-eval93.7%
times-frac93.7%
neg-mul-193.7%
remove-double-neg93.7%
neg-mul-193.7%
sub0-neg93.7%
associate--r+93.7%
neg-sub093.7%
div-sub93.7%
distribute-frac-neg93.7%
*-inverses93.7%
metadata-eval93.7%
Simplified93.7%
Taylor expanded in v around 0 82.8%
mul-1-neg82.8%
+-commutative82.8%
Simplified82.8%
Taylor expanded in t1 around inf 44.2%
*-commutative44.2%
Simplified44.2%
Taylor expanded in t1 around 0 33.5%
associate-*r/33.5%
frac-2neg33.5%
add-sqr-sqrt33.5%
sqrt-unprod58.6%
sqr-neg58.6%
sqrt-unprod0.0%
add-sqr-sqrt34.1%
Applied egg-rr34.1%
distribute-lft-neg-in34.1%
metadata-eval34.1%
Simplified34.1%
if -3.3999999999999997e107 < u Initial program 73.9%
times-frac98.3%
Simplified98.3%
Taylor expanded in t1 around inf 61.3%
associate-*r/61.3%
neg-mul-161.3%
Simplified61.3%
Final simplification56.5%
(FPCore (u v t1) :precision binary64 (if (<= u -2.25e+105) (/ (- v) u) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if (u <= -2.25e+105) {
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 <= (-2.25d+105)) 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 <= -2.25e+105) {
tmp = -v / u;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -2.25e+105: tmp = -v / u else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -2.25e+105) tmp = Float64(Float64(-v) / u); else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -2.25e+105) tmp = -v / u; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -2.25e+105], N[((-v) / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.25 \cdot 10^{+105}:\\
\;\;\;\;\frac{-v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -2.2500000000000001e105Initial program 75.9%
times-frac93.7%
Simplified93.7%
Taylor expanded in t1 around 0 81.8%
Taylor expanded in t1 around inf 33.5%
associate-*r/33.5%
neg-mul-133.5%
Simplified33.5%
if -2.2500000000000001e105 < u Initial program 73.9%
times-frac98.3%
Simplified98.3%
Taylor expanded in t1 around inf 61.3%
associate-*r/61.3%
neg-mul-161.3%
Simplified61.3%
Final simplification56.4%
(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 74.2%
times-frac97.5%
Simplified97.5%
Taylor expanded in t1 around inf 60.5%
Final simplification60.5%
(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(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 74.2%
times-frac97.5%
Simplified97.5%
Taylor expanded in t1 around inf 54.4%
associate-*r/54.4%
neg-mul-154.4%
Simplified54.4%
Final simplification54.4%
herbie shell --seed 2023221
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))