
(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 12 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 79.7%
*-commutative79.7%
times-frac96.7%
neg-mul-196.7%
associate-/l*96.7%
associate-*r/96.7%
associate-/l*96.7%
associate-/l/96.7%
neg-mul-196.7%
*-lft-identity96.7%
metadata-eval96.7%
times-frac96.7%
neg-mul-196.7%
remove-double-neg96.7%
neg-mul-196.7%
sub0-neg96.7%
associate--r+96.7%
neg-sub096.7%
div-sub96.7%
distribute-frac-neg96.7%
*-inverses96.7%
metadata-eval96.7%
Simplified96.7%
Final simplification96.7%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -5.5e-43) (not (<= t1 650000000000.0))) (/ (- v) t1) (* t1 (/ (- v) (* u u)))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -5.5e-43) || !(t1 <= 650000000000.0)) {
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 ((t1 <= (-5.5d-43)) .or. (.not. (t1 <= 650000000000.0d0))) 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 ((t1 <= -5.5e-43) || !(t1 <= 650000000000.0)) {
tmp = -v / t1;
} else {
tmp = t1 * (-v / (u * u));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -5.5e-43) or not (t1 <= 650000000000.0): tmp = -v / t1 else: tmp = t1 * (-v / (u * u)) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -5.5e-43) || !(t1 <= 650000000000.0)) tmp = Float64(Float64(-v) / t1); 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 <= -5.5e-43) || ~((t1 <= 650000000000.0))) tmp = -v / t1; else tmp = t1 * (-v / (u * u)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -5.5e-43], N[Not[LessEqual[t1, 650000000000.0]], $MachinePrecision]], N[((-v) / t1), $MachinePrecision], N[(t1 * N[((-v) / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -5.5 \cdot 10^{-43} \lor \neg \left(t1 \leq 650000000000\right):\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;t1 \cdot \frac{-v}{u \cdot u}\\
\end{array}
\end{array}
if t1 < -5.50000000000000013e-43 or 6.5e11 < t1 Initial program 65.6%
associate-/l*60.6%
neg-mul-160.6%
*-commutative60.6%
associate-*r/60.6%
associate-/l*61.8%
neg-mul-161.8%
associate-/r*73.6%
Simplified73.6%
Taylor expanded in t1 around inf 94.6%
associate-*r/94.6%
neg-mul-194.6%
Simplified94.6%
if -5.50000000000000013e-43 < t1 < 6.5e11Initial program 90.3%
associate-/l*87.5%
neg-mul-187.5%
*-commutative87.5%
associate-*r/86.8%
associate-/l*86.8%
neg-mul-186.8%
associate-/r*89.6%
Simplified89.6%
Taylor expanded in t1 around 0 74.3%
associate-*r/74.3%
neg-mul-174.3%
unpow274.3%
Simplified74.3%
Final simplification83.0%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -1.45e-43) (not (<= t1 650000000000.0))) (/ (- v) t1) (* (/ v u) (/ t1 (- u)))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.45e-43) || !(t1 <= 650000000000.0)) {
tmp = -v / 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.45d-43)) .or. (.not. (t1 <= 650000000000.0d0))) then
tmp = -v / 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.45e-43) || !(t1 <= 650000000000.0)) {
tmp = -v / t1;
} else {
tmp = (v / u) * (t1 / -u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -1.45e-43) or not (t1 <= 650000000000.0): tmp = -v / t1 else: tmp = (v / u) * (t1 / -u) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -1.45e-43) || !(t1 <= 650000000000.0)) tmp = Float64(Float64(-v) / t1); else tmp = Float64(Float64(v / u) * Float64(t1 / Float64(-u))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -1.45e-43) || ~((t1 <= 650000000000.0))) tmp = -v / t1; else tmp = (v / u) * (t1 / -u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -1.45e-43], N[Not[LessEqual[t1, 650000000000.0]], $MachinePrecision]], N[((-v) / t1), $MachinePrecision], N[(N[(v / u), $MachinePrecision] * N[(t1 / (-u)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.45 \cdot 10^{-43} \lor \neg \left(t1 \leq 650000000000\right):\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u} \cdot \frac{t1}{-u}\\
\end{array}
\end{array}
if t1 < -1.4500000000000001e-43 or 6.5e11 < t1 Initial program 65.6%
associate-/l*60.6%
neg-mul-160.6%
*-commutative60.6%
associate-*r/60.6%
associate-/l*61.8%
neg-mul-161.8%
associate-/r*73.6%
Simplified73.6%
Taylor expanded in t1 around inf 94.6%
associate-*r/94.6%
neg-mul-194.6%
Simplified94.6%
if -1.4500000000000001e-43 < t1 < 6.5e11Initial program 90.3%
associate-/l*87.5%
neg-mul-187.5%
*-commutative87.5%
associate-*r/86.8%
associate-/l*86.8%
neg-mul-186.8%
associate-/r*89.6%
Simplified89.6%
Taylor expanded in t1 around 0 74.3%
associate-*r/74.3%
neg-mul-174.3%
unpow274.3%
Simplified74.3%
associate-*r/78.1%
frac-2neg78.1%
add-sqr-sqrt38.5%
sqrt-unprod49.7%
sqr-neg49.7%
sqrt-unprod20.6%
add-sqr-sqrt41.0%
distribute-rgt-neg-out41.0%
add-sqr-sqrt20.4%
sqrt-unprod53.2%
sqr-neg53.2%
sqrt-unprod39.4%
add-sqr-sqrt78.1%
distribute-rgt-neg-in78.1%
Applied egg-rr78.1%
*-commutative78.1%
times-frac79.2%
Simplified79.2%
Final simplification85.8%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -1.6e-44) (not (<= t1 650000000000.0))) (/ (- v) t1) (/ (- v) (* u (/ u t1)))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.6e-44) || !(t1 <= 650000000000.0)) {
tmp = -v / t1;
} else {
tmp = -v / (u * (u / 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 ((t1 <= (-1.6d-44)) .or. (.not. (t1 <= 650000000000.0d0))) then
tmp = -v / t1
else
tmp = -v / (u * (u / t1))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.6e-44) || !(t1 <= 650000000000.0)) {
tmp = -v / t1;
} else {
tmp = -v / (u * (u / t1));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -1.6e-44) or not (t1 <= 650000000000.0): tmp = -v / t1 else: tmp = -v / (u * (u / t1)) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -1.6e-44) || !(t1 <= 650000000000.0)) tmp = Float64(Float64(-v) / t1); else tmp = Float64(Float64(-v) / Float64(u * Float64(u / t1))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -1.6e-44) || ~((t1 <= 650000000000.0))) tmp = -v / t1; else tmp = -v / (u * (u / t1)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -1.6e-44], N[Not[LessEqual[t1, 650000000000.0]], $MachinePrecision]], N[((-v) / t1), $MachinePrecision], N[((-v) / N[(u * N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.6 \cdot 10^{-44} \lor \neg \left(t1 \leq 650000000000\right):\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{u \cdot \frac{u}{t1}}\\
\end{array}
\end{array}
if t1 < -1.59999999999999997e-44 or 6.5e11 < t1 Initial program 65.6%
associate-/l*60.6%
neg-mul-160.6%
*-commutative60.6%
associate-*r/60.6%
associate-/l*61.8%
neg-mul-161.8%
associate-/r*73.6%
Simplified73.6%
Taylor expanded in t1 around inf 94.6%
associate-*r/94.6%
neg-mul-194.6%
Simplified94.6%
if -1.59999999999999997e-44 < t1 < 6.5e11Initial program 90.3%
*-commutative90.3%
times-frac94.2%
neg-mul-194.2%
associate-/l*94.2%
associate-*r/94.2%
associate-/l*94.2%
associate-/l/94.2%
neg-mul-194.2%
*-lft-identity94.2%
metadata-eval94.2%
times-frac94.2%
neg-mul-194.2%
remove-double-neg94.2%
neg-mul-194.2%
sub0-neg94.2%
associate--r+94.2%
neg-sub094.2%
div-sub94.2%
distribute-frac-neg94.2%
*-inverses94.2%
metadata-eval94.2%
Simplified94.2%
frac-2neg94.2%
distribute-frac-neg94.2%
add-sqr-sqrt48.7%
sqrt-unprod59.9%
sqr-neg59.9%
sqrt-unprod20.4%
add-sqr-sqrt41.0%
distribute-frac-neg41.0%
frac-2neg41.0%
associate-/l/41.1%
sub-neg41.1%
add-sqr-sqrt15.1%
sqrt-unprod45.8%
sqr-neg45.8%
sqrt-unprod40.0%
add-sqr-sqrt72.9%
distribute-frac-neg72.9%
frac-2neg72.9%
Applied egg-rr72.9%
distribute-neg-frac72.9%
*-commutative72.9%
Simplified72.9%
Taylor expanded in t1 around 0 77.1%
unpow277.1%
Simplified77.1%
Taylor expanded in u around 0 77.1%
unpow277.1%
associate-*r/79.8%
Simplified79.8%
Final simplification86.1%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -1.6e-44) (not (<= t1 650000000000.0))) (/ (- v) t1) (/ (* v (/ t1 u)) (- u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.6e-44) || !(t1 <= 650000000000.0)) {
tmp = -v / t1;
} 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 <= (-1.6d-44)) .or. (.not. (t1 <= 650000000000.0d0))) then
tmp = -v / t1
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 <= -1.6e-44) || !(t1 <= 650000000000.0)) {
tmp = -v / t1;
} else {
tmp = (v * (t1 / u)) / -u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -1.6e-44) or not (t1 <= 650000000000.0): tmp = -v / t1 else: tmp = (v * (t1 / u)) / -u return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -1.6e-44) || !(t1 <= 650000000000.0)) tmp = Float64(Float64(-v) / t1); 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 <= -1.6e-44) || ~((t1 <= 650000000000.0))) tmp = -v / t1; else tmp = (v * (t1 / u)) / -u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -1.6e-44], N[Not[LessEqual[t1, 650000000000.0]], $MachinePrecision]], N[((-v) / t1), $MachinePrecision], N[(N[(v * N[(t1 / u), $MachinePrecision]), $MachinePrecision] / (-u)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.6 \cdot 10^{-44} \lor \neg \left(t1 \leq 650000000000\right):\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v \cdot \frac{t1}{u}}{-u}\\
\end{array}
\end{array}
if t1 < -1.59999999999999997e-44 or 6.5e11 < t1 Initial program 65.6%
associate-/l*60.6%
neg-mul-160.6%
*-commutative60.6%
associate-*r/60.6%
associate-/l*61.8%
neg-mul-161.8%
associate-/r*73.6%
Simplified73.6%
Taylor expanded in t1 around inf 94.6%
associate-*r/94.6%
neg-mul-194.6%
Simplified94.6%
if -1.59999999999999997e-44 < t1 < 6.5e11Initial program 90.3%
associate-/l*87.5%
neg-mul-187.5%
*-commutative87.5%
associate-*r/86.8%
associate-/l*86.8%
neg-mul-186.8%
associate-/r*89.6%
Simplified89.6%
Taylor expanded in t1 around 0 74.3%
associate-*r/74.3%
neg-mul-174.3%
unpow274.3%
Simplified74.3%
clear-num74.4%
un-div-inv74.5%
add-sqr-sqrt36.0%
sqrt-unprod49.8%
sqr-neg49.8%
sqrt-unprod20.5%
add-sqr-sqrt40.9%
Applied egg-rr40.9%
unpow240.9%
associate-/l*41.0%
unpow241.0%
times-frac40.9%
Simplified40.9%
*-commutative40.9%
frac-2neg40.9%
associate-*l/41.0%
add-sqr-sqrt20.4%
sqrt-unprod56.1%
sqr-neg56.1%
sqrt-unprod42.4%
add-sqr-sqrt82.4%
Applied egg-rr82.4%
Final simplification87.6%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -1.15e-41) (not (<= t1 650000000000.0))) (/ (- v) t1) (/ (/ v (/ u t1)) (- u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.15e-41) || !(t1 <= 650000000000.0)) {
tmp = -v / 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.15d-41)) .or. (.not. (t1 <= 650000000000.0d0))) then
tmp = -v / 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.15e-41) || !(t1 <= 650000000000.0)) {
tmp = -v / t1;
} else {
tmp = (v / (u / t1)) / -u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -1.15e-41) or not (t1 <= 650000000000.0): tmp = -v / t1 else: tmp = (v / (u / t1)) / -u return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -1.15e-41) || !(t1 <= 650000000000.0)) tmp = Float64(Float64(-v) / t1); else tmp = Float64(Float64(v / Float64(u / t1)) / Float64(-u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -1.15e-41) || ~((t1 <= 650000000000.0))) tmp = -v / t1; else tmp = (v / (u / t1)) / -u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -1.15e-41], N[Not[LessEqual[t1, 650000000000.0]], $MachinePrecision]], N[((-v) / t1), $MachinePrecision], N[(N[(v / N[(u / t1), $MachinePrecision]), $MachinePrecision] / (-u)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.15 \cdot 10^{-41} \lor \neg \left(t1 \leq 650000000000\right):\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{v}{\frac{u}{t1}}}{-u}\\
\end{array}
\end{array}
if t1 < -1.15000000000000005e-41 or 6.5e11 < t1 Initial program 65.6%
associate-/l*60.6%
neg-mul-160.6%
*-commutative60.6%
associate-*r/60.6%
associate-/l*61.8%
neg-mul-161.8%
associate-/r*73.6%
Simplified73.6%
Taylor expanded in t1 around inf 94.6%
associate-*r/94.6%
neg-mul-194.6%
Simplified94.6%
if -1.15000000000000005e-41 < t1 < 6.5e11Initial program 90.3%
associate-/l*87.5%
neg-mul-187.5%
*-commutative87.5%
associate-*r/86.8%
associate-/l*86.8%
neg-mul-186.8%
associate-/r*89.6%
Simplified89.6%
Taylor expanded in t1 around 0 74.3%
associate-*r/74.3%
neg-mul-174.3%
unpow274.3%
Simplified74.3%
clear-num74.4%
un-div-inv74.5%
add-sqr-sqrt36.0%
sqrt-unprod49.8%
sqr-neg49.8%
sqrt-unprod20.5%
add-sqr-sqrt40.9%
Applied egg-rr40.9%
unpow240.9%
associate-/l*41.0%
unpow241.0%
times-frac40.9%
Simplified40.9%
*-commutative40.9%
frac-2neg40.9%
associate-*l/41.0%
add-sqr-sqrt20.4%
sqrt-unprod56.1%
sqr-neg56.1%
sqrt-unprod42.4%
add-sqr-sqrt82.4%
Applied egg-rr82.4%
clear-num82.4%
div-inv82.5%
Applied egg-rr82.5%
Final simplification87.7%
(FPCore (u v t1) :precision binary64 (if (or (<= u -3.4e+23) (not (<= u 1150000000000.0))) (* t1 (/ v (* u u))) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -3.4e+23) || !(u <= 1150000000000.0)) {
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.4d+23)) .or. (.not. (u <= 1150000000000.0d0))) 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.4e+23) || !(u <= 1150000000000.0)) {
tmp = t1 * (v / (u * u));
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -3.4e+23) or not (u <= 1150000000000.0): tmp = t1 * (v / (u * u)) else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -3.4e+23) || !(u <= 1150000000000.0)) tmp = Float64(t1 * Float64(v / Float64(u * 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+23) || ~((u <= 1150000000000.0))) tmp = t1 * (v / (u * u)); else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -3.4e+23], N[Not[LessEqual[u, 1150000000000.0]], $MachinePrecision]], N[(t1 * N[(v / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -3.4 \cdot 10^{+23} \lor \neg \left(u \leq 1150000000000\right):\\
\;\;\;\;t1 \cdot \frac{v}{u \cdot u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -3.39999999999999992e23 or 1.15e12 < u Initial program 95.8%
associate-/l*95.9%
neg-mul-195.9%
*-commutative95.9%
associate-*r/95.9%
associate-/l*95.9%
neg-mul-195.9%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in t1 around 0 95.9%
associate-*r/95.9%
neg-mul-195.9%
unpow295.9%
Simplified95.9%
add-sqr-sqrt45.3%
sqrt-unprod77.0%
sqr-neg77.0%
sqrt-unprod41.8%
times-frac41.7%
Applied egg-rr41.7%
times-frac41.8%
rem-square-sqrt78.0%
Simplified78.0%
if -3.39999999999999992e23 < u < 1.15e12Initial program 73.3%
associate-/l*68.0%
neg-mul-168.0%
*-commutative68.0%
associate-*r/67.4%
associate-/l*68.1%
neg-mul-168.1%
associate-/r*75.8%
Simplified75.8%
Taylor expanded in t1 around inf 75.7%
associate-*r/75.7%
neg-mul-175.7%
Simplified75.7%
Final simplification76.3%
(FPCore (u v t1) :precision binary64 (if (<= u -3.4e+23) (* t1 (/ v (* u u))) (if (<= u 1100000000000.0) (/ (- v) t1) (* v (/ t1 (* u u))))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -3.4e+23) {
tmp = t1 * (v / (u * u));
} else if (u <= 1100000000000.0) {
tmp = -v / t1;
} 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 (u <= (-3.4d+23)) then
tmp = t1 * (v / (u * u))
else if (u <= 1100000000000.0d0) then
tmp = -v / t1
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 (u <= -3.4e+23) {
tmp = t1 * (v / (u * u));
} else if (u <= 1100000000000.0) {
tmp = -v / t1;
} else {
tmp = v * (t1 / (u * u));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -3.4e+23: tmp = t1 * (v / (u * u)) elif u <= 1100000000000.0: tmp = -v / t1 else: tmp = v * (t1 / (u * u)) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -3.4e+23) tmp = Float64(t1 * Float64(v / Float64(u * u))); elseif (u <= 1100000000000.0) tmp = Float64(Float64(-v) / t1); else tmp = Float64(v * Float64(t1 / Float64(u * u))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -3.4e+23) tmp = t1 * (v / (u * u)); elseif (u <= 1100000000000.0) tmp = -v / t1; else tmp = v * (t1 / (u * u)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -3.4e+23], N[(t1 * N[(v / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 1100000000000.0], N[((-v) / t1), $MachinePrecision], N[(v * N[(t1 / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -3.4 \cdot 10^{+23}:\\
\;\;\;\;t1 \cdot \frac{v}{u \cdot u}\\
\mathbf{elif}\;u \leq 1100000000000:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;v \cdot \frac{t1}{u \cdot u}\\
\end{array}
\end{array}
if u < -3.39999999999999992e23Initial program 96.6%
associate-/l*96.6%
neg-mul-196.6%
*-commutative96.6%
associate-*r/96.7%
associate-/l*96.7%
neg-mul-196.7%
associate-/r*100.0%
Simplified100.0%
Taylor expanded in t1 around 0 96.7%
associate-*r/96.7%
neg-mul-196.7%
unpow296.7%
Simplified96.7%
add-sqr-sqrt42.5%
sqrt-unprod85.0%
sqr-neg85.0%
sqrt-unprod48.5%
times-frac48.5%
Applied egg-rr48.5%
times-frac48.5%
rem-square-sqrt88.1%
Simplified88.1%
if -3.39999999999999992e23 < u < 1.1e12Initial program 73.3%
associate-/l*68.0%
neg-mul-168.0%
*-commutative68.0%
associate-*r/67.4%
associate-/l*68.1%
neg-mul-168.1%
associate-/r*75.8%
Simplified75.8%
Taylor expanded in t1 around inf 75.7%
associate-*r/75.7%
neg-mul-175.7%
Simplified75.7%
if 1.1e12 < u Initial program 95.2%
associate-/l*95.3%
neg-mul-195.3%
*-commutative95.3%
associate-*r/95.3%
associate-/l*95.2%
neg-mul-195.2%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in t1 around 0 95.2%
associate-*r/95.2%
neg-mul-195.2%
unpow295.2%
Simplified95.2%
clear-num95.3%
un-div-inv95.3%
add-sqr-sqrt47.5%
sqrt-unprod70.5%
sqr-neg70.5%
sqrt-unprod36.2%
add-sqr-sqrt69.6%
Applied egg-rr69.6%
unpow269.6%
associate-/l*69.6%
unpow269.6%
times-frac69.6%
Simplified69.6%
Taylor expanded in t1 around 0 69.6%
*-commutative69.6%
unpow269.6%
associate-*r/69.8%
Simplified69.8%
Final simplification76.4%
(FPCore (u v t1) :precision binary64 (if (<= u -3.4e+23) (/ v (* u (/ u t1))) (if (<= u 1080000000000.0) (/ (- v) t1) (* v (/ t1 (* u u))))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -3.4e+23) {
tmp = v / (u * (u / t1));
} else if (u <= 1080000000000.0) {
tmp = -v / t1;
} 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 (u <= (-3.4d+23)) then
tmp = v / (u * (u / t1))
else if (u <= 1080000000000.0d0) then
tmp = -v / t1
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 (u <= -3.4e+23) {
tmp = v / (u * (u / t1));
} else if (u <= 1080000000000.0) {
tmp = -v / t1;
} else {
tmp = v * (t1 / (u * u));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -3.4e+23: tmp = v / (u * (u / t1)) elif u <= 1080000000000.0: tmp = -v / t1 else: tmp = v * (t1 / (u * u)) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -3.4e+23) tmp = Float64(v / Float64(u * Float64(u / t1))); elseif (u <= 1080000000000.0) tmp = Float64(Float64(-v) / t1); else tmp = Float64(v * Float64(t1 / Float64(u * u))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -3.4e+23) tmp = v / (u * (u / t1)); elseif (u <= 1080000000000.0) tmp = -v / t1; else tmp = v * (t1 / (u * u)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -3.4e+23], N[(v / N[(u * N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 1080000000000.0], N[((-v) / t1), $MachinePrecision], N[(v * N[(t1 / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -3.4 \cdot 10^{+23}:\\
\;\;\;\;\frac{v}{u \cdot \frac{u}{t1}}\\
\mathbf{elif}\;u \leq 1080000000000:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;v \cdot \frac{t1}{u \cdot u}\\
\end{array}
\end{array}
if u < -3.39999999999999992e23Initial program 96.6%
associate-/l*96.6%
neg-mul-196.6%
*-commutative96.6%
associate-*r/96.7%
associate-/l*96.7%
neg-mul-196.7%
associate-/r*100.0%
Simplified100.0%
Taylor expanded in t1 around 0 96.7%
associate-*r/96.7%
neg-mul-196.7%
unpow296.7%
Simplified96.7%
clear-num96.7%
un-div-inv96.6%
add-sqr-sqrt42.5%
sqrt-unprod85.0%
sqr-neg85.0%
sqrt-unprod48.5%
add-sqr-sqrt88.1%
Applied egg-rr88.1%
unpow288.1%
associate-/l*88.1%
unpow288.1%
times-frac88.0%
Simplified88.0%
clear-num88.0%
frac-times88.1%
*-un-lft-identity88.1%
Applied egg-rr88.1%
if -3.39999999999999992e23 < u < 1.08e12Initial program 73.3%
associate-/l*68.0%
neg-mul-168.0%
*-commutative68.0%
associate-*r/67.4%
associate-/l*68.1%
neg-mul-168.1%
associate-/r*75.8%
Simplified75.8%
Taylor expanded in t1 around inf 75.7%
associate-*r/75.7%
neg-mul-175.7%
Simplified75.7%
if 1.08e12 < u Initial program 95.2%
associate-/l*95.3%
neg-mul-195.3%
*-commutative95.3%
associate-*r/95.3%
associate-/l*95.2%
neg-mul-195.2%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in t1 around 0 95.2%
associate-*r/95.2%
neg-mul-195.2%
unpow295.2%
Simplified95.2%
clear-num95.3%
un-div-inv95.3%
add-sqr-sqrt47.5%
sqrt-unprod70.5%
sqr-neg70.5%
sqrt-unprod36.2%
add-sqr-sqrt69.6%
Applied egg-rr69.6%
unpow269.6%
associate-/l*69.6%
unpow269.6%
times-frac69.6%
Simplified69.6%
Taylor expanded in t1 around 0 69.6%
*-commutative69.6%
unpow269.6%
associate-*r/69.8%
Simplified69.8%
Final simplification76.4%
(FPCore (u v t1) :precision binary64 (if (or (<= u -2.7e+15) (not (<= u 1150000000000.0))) (/ (- v) u) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -2.7e+15) || !(u <= 1150000000000.0)) {
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.7d+15)) .or. (.not. (u <= 1150000000000.0d0))) 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.7e+15) || !(u <= 1150000000000.0)) {
tmp = -v / u;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -2.7e+15) or not (u <= 1150000000000.0): tmp = -v / u else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -2.7e+15) || !(u <= 1150000000000.0)) 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.7e+15) || ~((u <= 1150000000000.0))) tmp = -v / u; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -2.7e+15], N[Not[LessEqual[u, 1150000000000.0]], $MachinePrecision]], N[((-v) / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.7 \cdot 10^{+15} \lor \neg \left(u \leq 1150000000000\right):\\
\;\;\;\;\frac{-v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -2.7e15 or 1.15e12 < u Initial program 95.9%
associate-/l*95.9%
neg-mul-195.9%
*-commutative95.9%
associate-*r/96.0%
associate-/l*95.9%
neg-mul-195.9%
associate-/r*99.9%
Simplified99.9%
associate-/l/95.9%
associate-*r/95.9%
distribute-rgt-neg-in95.9%
distribute-lft-neg-out95.9%
times-frac97.7%
frac-2neg97.7%
associate-*r/97.7%
add-sqr-sqrt58.6%
sqrt-unprod82.5%
sqr-neg82.5%
sqrt-unprod26.3%
add-sqr-sqrt76.9%
add-sqr-sqrt35.7%
sqrt-unprod74.9%
sqr-neg74.9%
sqrt-unprod50.3%
add-sqr-sqrt97.7%
distribute-neg-in97.7%
Applied egg-rr97.7%
Taylor expanded in t1 around inf 33.8%
Taylor expanded in t1 around 0 33.8%
associate-*r/33.8%
neg-mul-133.8%
Simplified33.8%
if -2.7e15 < u < 1.15e12Initial program 73.2%
associate-/l*67.9%
neg-mul-167.9%
*-commutative67.9%
associate-*r/67.2%
associate-/l*68.0%
neg-mul-168.0%
associate-/r*75.7%
Simplified75.7%
Taylor expanded in t1 around inf 76.1%
associate-*r/76.1%
neg-mul-176.1%
Simplified76.1%
Final simplification63.9%
(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 79.7%
associate-/l*76.0%
neg-mul-176.0%
*-commutative76.0%
associate-*r/75.5%
associate-/l*76.0%
neg-mul-176.0%
associate-/r*82.7%
Simplified82.7%
Taylor expanded in t1 around inf 55.0%
associate-*r/55.0%
neg-mul-155.0%
Simplified55.0%
Final simplification55.0%
(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 79.7%
associate-/l*76.0%
neg-mul-176.0%
*-commutative76.0%
associate-*r/75.5%
associate-/l*76.0%
neg-mul-176.0%
associate-/r*82.7%
Simplified82.7%
associate-/l/76.0%
associate-*r/79.7%
distribute-rgt-neg-in79.7%
distribute-lft-neg-out79.7%
times-frac96.7%
frac-2neg96.7%
associate-*r/98.5%
add-sqr-sqrt53.5%
sqrt-unprod47.3%
sqr-neg47.3%
sqrt-unprod12.2%
add-sqr-sqrt35.5%
add-sqr-sqrt19.8%
sqrt-unprod53.0%
sqr-neg53.0%
sqrt-unprod44.9%
add-sqr-sqrt98.5%
distribute-neg-in98.5%
Applied egg-rr56.0%
Taylor expanded in t1 around inf 11.7%
Final simplification11.7%
herbie shell --seed 2023278
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))