
(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 11 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 69.5%
times-frac99.5%
distribute-frac-neg99.5%
distribute-neg-frac299.5%
+-commutative99.5%
distribute-neg-in99.5%
unsub-neg99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -2.02e+108) (not (<= t1 2.3e+153))) (/ v (- (- t1) (* u 2.0))) (* t1 (/ (/ v (+ t1 u)) (- (- u) t1)))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -2.02e+108) || !(t1 <= 2.3e+153)) {
tmp = v / (-t1 - (u * 2.0));
} else {
tmp = t1 * ((v / (t1 + 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 <= (-2.02d+108)) .or. (.not. (t1 <= 2.3d+153))) then
tmp = v / (-t1 - (u * 2.0d0))
else
tmp = t1 * ((v / (t1 + u)) / (-u - t1))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -2.02e+108) || !(t1 <= 2.3e+153)) {
tmp = v / (-t1 - (u * 2.0));
} else {
tmp = t1 * ((v / (t1 + u)) / (-u - t1));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -2.02e+108) or not (t1 <= 2.3e+153): tmp = v / (-t1 - (u * 2.0)) else: tmp = t1 * ((v / (t1 + u)) / (-u - t1)) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -2.02e+108) || !(t1 <= 2.3e+153)) tmp = Float64(v / Float64(Float64(-t1) - Float64(u * 2.0))); else tmp = Float64(t1 * Float64(Float64(v / Float64(t1 + u)) / Float64(Float64(-u) - t1))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -2.02e+108) || ~((t1 <= 2.3e+153))) tmp = v / (-t1 - (u * 2.0)); else tmp = t1 * ((v / (t1 + u)) / (-u - t1)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -2.02e+108], N[Not[LessEqual[t1, 2.3e+153]], $MachinePrecision]], N[(v / N[((-t1) - N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t1 * N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] / N[((-u) - t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -2.02 \cdot 10^{+108} \lor \neg \left(t1 \leq 2.3 \cdot 10^{+153}\right):\\
\;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;t1 \cdot \frac{\frac{v}{t1 + u}}{\left(-u\right) - t1}\\
\end{array}
\end{array}
if t1 < -2.02000000000000007e108 or 2.3000000000000001e153 < t1 Initial program 43.3%
associate-/l*44.0%
distribute-lft-neg-out44.0%
distribute-rgt-neg-in44.0%
associate-/r*67.6%
distribute-neg-frac267.6%
Simplified67.6%
associate-*r/100.0%
+-commutative100.0%
distribute-neg-in100.0%
sub-neg100.0%
associate-*l/100.0%
clear-num100.0%
frac-2neg100.0%
frac-times98.7%
*-un-lft-identity98.7%
frac-2neg98.7%
sub-neg98.7%
distribute-neg-in98.7%
+-commutative98.7%
remove-double-neg98.7%
add-sqr-sqrt52.9%
sqrt-unprod13.1%
sqr-neg13.1%
sqrt-unprod20.1%
add-sqr-sqrt37.8%
add-sqr-sqrt16.5%
sqrt-unprod38.7%
Applied egg-rr98.7%
Taylor expanded in u around 0 95.8%
*-commutative95.8%
Simplified95.8%
if -2.02000000000000007e108 < t1 < 2.3000000000000001e153Initial program 80.8%
associate-/l*83.5%
distribute-lft-neg-out83.5%
distribute-rgt-neg-in83.5%
associate-/r*91.4%
distribute-neg-frac291.4%
Simplified91.4%
Final simplification92.7%
(FPCore (u v t1) :precision binary64 (if (or (<= u -5.2e-47) (not (<= u 2e-55))) (* (/ v (+ t1 u)) (/ t1 (- u))) (/ v (- t1))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -5.2e-47) || !(u <= 2e-55)) {
tmp = (v / (t1 + u)) * (t1 / -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 <= (-5.2d-47)) .or. (.not. (u <= 2d-55))) then
tmp = (v / (t1 + u)) * (t1 / -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 <= -5.2e-47) || !(u <= 2e-55)) {
tmp = (v / (t1 + u)) * (t1 / -u);
} else {
tmp = v / -t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -5.2e-47) or not (u <= 2e-55): tmp = (v / (t1 + u)) * (t1 / -u) else: tmp = v / -t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -5.2e-47) || !(u <= 2e-55)) tmp = Float64(Float64(v / Float64(t1 + u)) * Float64(t1 / Float64(-u))); else tmp = Float64(v / Float64(-t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -5.2e-47) || ~((u <= 2e-55))) tmp = (v / (t1 + u)) * (t1 / -u); else tmp = v / -t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -5.2e-47], N[Not[LessEqual[u, 2e-55]], $MachinePrecision]], N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(t1 / (-u)), $MachinePrecision]), $MachinePrecision], N[(v / (-t1)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -5.2 \cdot 10^{-47} \lor \neg \left(u \leq 2 \cdot 10^{-55}\right):\\
\;\;\;\;\frac{v}{t1 + u} \cdot \frac{t1}{-u}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{-t1}\\
\end{array}
\end{array}
if u < -5.2e-47 or 1.99999999999999999e-55 < u Initial program 72.0%
times-frac99.8%
distribute-frac-neg99.8%
distribute-neg-frac299.8%
+-commutative99.8%
distribute-neg-in99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in t1 around 0 81.3%
associate-*r/81.3%
mul-1-neg81.3%
Simplified81.3%
if -5.2e-47 < u < 1.99999999999999999e-55Initial program 66.0%
associate-/l*69.2%
distribute-lft-neg-out69.2%
distribute-rgt-neg-in69.2%
associate-/r*79.2%
distribute-neg-frac279.2%
Simplified79.2%
Taylor expanded in t1 around inf 86.1%
associate-*r/86.1%
neg-mul-186.1%
Simplified86.1%
Final simplification83.3%
(FPCore (u v t1) :precision binary64 (if (or (<= u -5.5e-51) (not (<= u 1.25e-123))) (/ t1 (* u (/ (- t1 u) v))) (/ v (- t1))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -5.5e-51) || !(u <= 1.25e-123)) {
tmp = t1 / (u * ((t1 - 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.5d-51)) .or. (.not. (u <= 1.25d-123))) then
tmp = t1 / (u * ((t1 - 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.5e-51) || !(u <= 1.25e-123)) {
tmp = t1 / (u * ((t1 - u) / v));
} else {
tmp = v / -t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -5.5e-51) or not (u <= 1.25e-123): tmp = t1 / (u * ((t1 - u) / v)) else: tmp = v / -t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -5.5e-51) || !(u <= 1.25e-123)) tmp = Float64(t1 / Float64(u * Float64(Float64(t1 - u) / v))); else tmp = Float64(v / Float64(-t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -5.5e-51) || ~((u <= 1.25e-123))) tmp = t1 / (u * ((t1 - u) / v)); else tmp = v / -t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -5.5e-51], N[Not[LessEqual[u, 1.25e-123]], $MachinePrecision]], N[(t1 / N[(u * N[(N[(t1 - u), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(v / (-t1)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -5.5 \cdot 10^{-51} \lor \neg \left(u \leq 1.25 \cdot 10^{-123}\right):\\
\;\;\;\;\frac{t1}{u \cdot \frac{t1 - u}{v}}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{-t1}\\
\end{array}
\end{array}
if u < -5.4999999999999997e-51 or 1.25000000000000007e-123 < u Initial program 72.6%
times-frac99.8%
distribute-frac-neg99.8%
distribute-neg-frac299.8%
+-commutative99.8%
distribute-neg-in99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in t1 around 0 80.0%
associate-*r/80.0%
mul-1-neg80.0%
Simplified80.0%
*-commutative80.0%
clear-num80.3%
frac-times77.1%
*-un-lft-identity77.1%
add-sqr-sqrt36.5%
sqrt-unprod49.1%
sqr-neg49.1%
sqrt-unprod25.6%
add-sqr-sqrt49.5%
frac-2neg49.5%
distribute-neg-in49.5%
add-sqr-sqrt23.9%
sqrt-unprod49.6%
sqr-neg49.6%
sqrt-unprod25.6%
add-sqr-sqrt48.9%
sub-neg48.9%
add-sqr-sqrt25.7%
sqrt-unprod50.8%
sqr-neg50.8%
sqrt-unprod37.6%
add-sqr-sqrt77.7%
Applied egg-rr77.7%
if -5.4999999999999997e-51 < u < 1.25000000000000007e-123Initial program 64.4%
associate-/l*66.1%
distribute-lft-neg-out66.1%
distribute-rgt-neg-in66.1%
associate-/r*77.1%
distribute-neg-frac277.1%
Simplified77.1%
Taylor expanded in t1 around inf 88.6%
associate-*r/88.6%
neg-mul-188.6%
Simplified88.6%
Final simplification81.8%
(FPCore (u v t1) :precision binary64 (if (<= u -4.6e-48) (* t1 (/ (/ v (- u)) (+ t1 u))) (if (<= u 1.44e-123) (/ v (- t1)) (/ t1 (* u (/ (- t1 u) v))))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -4.6e-48) {
tmp = t1 * ((v / -u) / (t1 + u));
} else if (u <= 1.44e-123) {
tmp = v / -t1;
} else {
tmp = t1 / (u * ((t1 - u) / v));
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if (u <= (-4.6d-48)) then
tmp = t1 * ((v / -u) / (t1 + u))
else if (u <= 1.44d-123) then
tmp = v / -t1
else
tmp = t1 / (u * ((t1 - u) / v))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -4.6e-48) {
tmp = t1 * ((v / -u) / (t1 + u));
} else if (u <= 1.44e-123) {
tmp = v / -t1;
} else {
tmp = t1 / (u * ((t1 - u) / v));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -4.6e-48: tmp = t1 * ((v / -u) / (t1 + u)) elif u <= 1.44e-123: tmp = v / -t1 else: tmp = t1 / (u * ((t1 - u) / v)) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -4.6e-48) tmp = Float64(t1 * Float64(Float64(v / Float64(-u)) / Float64(t1 + u))); elseif (u <= 1.44e-123) tmp = Float64(v / Float64(-t1)); else tmp = Float64(t1 / Float64(u * Float64(Float64(t1 - u) / v))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -4.6e-48) tmp = t1 * ((v / -u) / (t1 + u)); elseif (u <= 1.44e-123) tmp = v / -t1; else tmp = t1 / (u * ((t1 - u) / v)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -4.6e-48], N[(t1 * N[(N[(v / (-u)), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 1.44e-123], N[(v / (-t1)), $MachinePrecision], N[(t1 / N[(u * N[(N[(t1 - u), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -4.6 \cdot 10^{-48}:\\
\;\;\;\;t1 \cdot \frac{\frac{v}{-u}}{t1 + u}\\
\mathbf{elif}\;u \leq 1.44 \cdot 10^{-123}:\\
\;\;\;\;\frac{v}{-t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t1}{u \cdot \frac{t1 - u}{v}}\\
\end{array}
\end{array}
if u < -4.6000000000000001e-48Initial program 73.4%
associate-/l*75.1%
distribute-lft-neg-out75.1%
distribute-rgt-neg-in75.1%
associate-/r*92.2%
distribute-neg-frac292.2%
Simplified92.2%
Taylor expanded in t1 around 0 80.4%
if -4.6000000000000001e-48 < u < 1.44000000000000004e-123Initial program 64.4%
associate-/l*66.1%
distribute-lft-neg-out66.1%
distribute-rgt-neg-in66.1%
associate-/r*77.1%
distribute-neg-frac277.1%
Simplified77.1%
Taylor expanded in t1 around inf 88.6%
associate-*r/88.6%
neg-mul-188.6%
Simplified88.6%
if 1.44000000000000004e-123 < u Initial program 71.8%
times-frac99.8%
distribute-frac-neg99.8%
distribute-neg-frac299.8%
+-commutative99.8%
distribute-neg-in99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in t1 around 0 78.3%
associate-*r/78.3%
mul-1-neg78.3%
Simplified78.3%
*-commutative78.3%
clear-num78.3%
frac-times74.5%
*-un-lft-identity74.5%
add-sqr-sqrt27.8%
sqrt-unprod45.7%
sqr-neg45.7%
sqrt-unprod31.9%
add-sqr-sqrt51.8%
frac-2neg51.8%
distribute-neg-in51.8%
add-sqr-sqrt19.9%
sqrt-unprod52.1%
sqr-neg52.1%
sqrt-unprod32.3%
add-sqr-sqrt50.7%
sub-neg50.7%
add-sqr-sqrt30.6%
sqrt-unprod56.2%
sqr-neg56.2%
sqrt-unprod35.6%
add-sqr-sqrt75.5%
Applied egg-rr75.5%
Final simplification82.0%
(FPCore (u v t1) :precision binary64 (if (or (<= u -5.8e+20) (not (<= u 3.9e-54))) (* (/ t1 (- u)) (/ v u)) (/ v (- t1))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -5.8e+20) || !(u <= 3.9e-54)) {
tmp = (t1 / -u) * (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 <= (-5.8d+20)) .or. (.not. (u <= 3.9d-54))) then
tmp = (t1 / -u) * (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 <= -5.8e+20) || !(u <= 3.9e-54)) {
tmp = (t1 / -u) * (v / u);
} else {
tmp = v / -t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -5.8e+20) or not (u <= 3.9e-54): tmp = (t1 / -u) * (v / u) else: tmp = v / -t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -5.8e+20) || !(u <= 3.9e-54)) tmp = Float64(Float64(t1 / Float64(-u)) * Float64(v / u)); else tmp = Float64(v / Float64(-t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -5.8e+20) || ~((u <= 3.9e-54))) tmp = (t1 / -u) * (v / u); else tmp = v / -t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -5.8e+20], N[Not[LessEqual[u, 3.9e-54]], $MachinePrecision]], N[(N[(t1 / (-u)), $MachinePrecision] * N[(v / u), $MachinePrecision]), $MachinePrecision], N[(v / (-t1)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -5.8 \cdot 10^{+20} \lor \neg \left(u \leq 3.9 \cdot 10^{-54}\right):\\
\;\;\;\;\frac{t1}{-u} \cdot \frac{v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{-t1}\\
\end{array}
\end{array}
if u < -5.8e20 or 3.9e-54 < u Initial program 72.5%
times-frac99.8%
distribute-frac-neg99.8%
distribute-neg-frac299.8%
+-commutative99.8%
distribute-neg-in99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in t1 around 0 83.2%
associate-*r/83.2%
mul-1-neg83.2%
Simplified83.2%
Taylor expanded in t1 around 0 79.1%
if -5.8e20 < u < 3.9e-54Initial program 66.1%
associate-/l*69.1%
distribute-lft-neg-out69.1%
distribute-rgt-neg-in69.1%
associate-/r*79.6%
distribute-neg-frac279.6%
Simplified79.6%
Taylor expanded in t1 around inf 82.7%
associate-*r/82.7%
neg-mul-182.7%
Simplified82.7%
Final simplification80.8%
(FPCore (u v t1) :precision binary64 (if (or (<= u -1.45e+72) (not (<= u 24500000000000.0))) (/ t1 (* u (/ u v))) (/ v (- t1))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -1.45e+72) || !(u <= 24500000000000.0)) {
tmp = t1 / (u * (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 <= (-1.45d+72)) .or. (.not. (u <= 24500000000000.0d0))) then
tmp = t1 / (u * (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 <= -1.45e+72) || !(u <= 24500000000000.0)) {
tmp = t1 / (u * (u / v));
} else {
tmp = v / -t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -1.45e+72) or not (u <= 24500000000000.0): tmp = t1 / (u * (u / v)) else: tmp = v / -t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -1.45e+72) || !(u <= 24500000000000.0)) tmp = Float64(t1 / Float64(u * 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 <= -1.45e+72) || ~((u <= 24500000000000.0))) tmp = t1 / (u * (u / v)); else tmp = v / -t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -1.45e+72], N[Not[LessEqual[u, 24500000000000.0]], $MachinePrecision]], N[(t1 / N[(u * N[(u / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(v / (-t1)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.45 \cdot 10^{+72} \lor \neg \left(u \leq 24500000000000\right):\\
\;\;\;\;\frac{t1}{u \cdot \frac{u}{v}}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{-t1}\\
\end{array}
\end{array}
if u < -1.45000000000000009e72 or 2.45e13 < u Initial program 71.1%
times-frac99.8%
distribute-frac-neg99.8%
distribute-neg-frac299.8%
+-commutative99.8%
distribute-neg-in99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in t1 around 0 86.8%
associate-*r/86.8%
mul-1-neg86.8%
Simplified86.8%
Taylor expanded in t1 around 0 84.3%
*-commutative84.3%
clear-num85.1%
frac-times80.9%
*-un-lft-identity80.9%
add-sqr-sqrt39.8%
sqrt-unprod61.0%
sqr-neg61.0%
sqrt-unprod29.2%
add-sqr-sqrt55.7%
Applied egg-rr55.7%
if -1.45000000000000009e72 < u < 2.45e13Initial program 68.2%
associate-/l*69.6%
distribute-lft-neg-out69.6%
distribute-rgt-neg-in69.6%
associate-/r*79.8%
distribute-neg-frac279.8%
Simplified79.8%
Taylor expanded in t1 around inf 77.8%
associate-*r/77.8%
neg-mul-177.8%
Simplified77.8%
Final simplification67.9%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -3.65e+180) (not (<= t1 2.7e+49))) (/ v t1) (/ v u)))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -3.65e+180) || !(t1 <= 2.7e+49)) {
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 <= (-3.65d+180)) .or. (.not. (t1 <= 2.7d+49))) 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 <= -3.65e+180) || !(t1 <= 2.7e+49)) {
tmp = v / t1;
} else {
tmp = v / u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -3.65e+180) or not (t1 <= 2.7e+49): tmp = v / t1 else: tmp = v / u return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -3.65e+180) || !(t1 <= 2.7e+49)) tmp = Float64(v / t1); else tmp = Float64(v / u); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -3.65e+180) || ~((t1 <= 2.7e+49))) tmp = v / t1; else tmp = v / u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -3.65e+180], N[Not[LessEqual[t1, 2.7e+49]], $MachinePrecision]], N[(v / t1), $MachinePrecision], N[(v / u), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -3.65 \cdot 10^{+180} \lor \neg \left(t1 \leq 2.7 \cdot 10^{+49}\right):\\
\;\;\;\;\frac{v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u}\\
\end{array}
\end{array}
if t1 < -3.65000000000000019e180 or 2.7000000000000001e49 < t1 Initial program 44.1%
associate-/l*46.9%
distribute-lft-neg-out46.9%
distribute-rgt-neg-in46.9%
associate-/r*69.3%
distribute-neg-frac269.3%
Simplified69.3%
distribute-frac-neg269.3%
distribute-rgt-neg-out69.3%
associate-/r*46.9%
distribute-lft-neg-out46.9%
associate-/l*44.1%
times-frac99.9%
frac-2neg99.9%
associate-*r/99.9%
add-sqr-sqrt31.2%
sqrt-unprod9.0%
sqr-neg9.0%
sqrt-unprod26.4%
add-sqr-sqrt37.7%
add-sqr-sqrt14.0%
sqrt-unprod48.0%
sqr-neg48.0%
sqrt-prod58.8%
add-sqr-sqrt99.9%
Applied egg-rr99.9%
Taylor expanded in t1 around inf 83.4%
mul-1-neg83.4%
Simplified83.4%
clear-num81.6%
associate-/r/83.2%
+-commutative83.2%
add-sqr-sqrt45.3%
sqrt-unprod46.4%
sqr-neg46.4%
sqrt-unprod13.0%
add-sqr-sqrt34.7%
Applied egg-rr34.7%
Taylor expanded in u around 0 34.1%
if -3.65000000000000019e180 < t1 < 2.7000000000000001e49Initial program 81.7%
times-frac99.3%
distribute-frac-neg99.3%
distribute-neg-frac299.3%
+-commutative99.3%
distribute-neg-in99.3%
unsub-neg99.3%
Simplified99.3%
Taylor expanded in t1 around 0 67.1%
associate-*r/67.1%
mul-1-neg67.1%
Simplified67.1%
clear-num67.1%
frac-2neg67.1%
frac-times60.6%
*-un-lft-identity60.6%
add-sqr-sqrt27.9%
sqrt-unprod38.2%
sqr-neg38.2%
sqrt-unprod18.9%
add-sqr-sqrt37.4%
add-sqr-sqrt20.0%
sqrt-unprod41.1%
sqr-neg41.1%
sqrt-unprod28.7%
add-sqr-sqrt60.6%
distribute-neg-in60.6%
add-sqr-sqrt31.8%
sqrt-unprod61.9%
sqr-neg61.9%
sqrt-unprod30.0%
add-sqr-sqrt62.6%
sub-neg62.6%
Applied egg-rr62.6%
Taylor expanded in u around 0 16.6%
Final simplification22.3%
(FPCore (u v t1) :precision binary64 (if (<= u -1.25e+145) (/ v u) (/ v (- t1))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -1.25e+145) {
tmp = v / u;
} else {
tmp = v / -t1;
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if (u <= (-1.25d+145)) then
tmp = v / u
else
tmp = v / -t1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -1.25e+145) {
tmp = v / u;
} else {
tmp = v / -t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -1.25e+145: tmp = v / u else: tmp = v / -t1 return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -1.25e+145) tmp = Float64(v / u); else tmp = Float64(v / Float64(-t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -1.25e+145) tmp = v / u; else tmp = v / -t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -1.25e+145], N[(v / u), $MachinePrecision], N[(v / (-t1)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.25 \cdot 10^{+145}:\\
\;\;\;\;\frac{v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{-t1}\\
\end{array}
\end{array}
if u < -1.24999999999999992e145Initial program 68.9%
times-frac100.0%
distribute-frac-neg100.0%
distribute-neg-frac2100.0%
+-commutative100.0%
distribute-neg-in100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in t1 around 0 94.3%
associate-*r/94.3%
mul-1-neg94.3%
Simplified94.3%
clear-num94.2%
frac-2neg94.2%
frac-times72.1%
*-un-lft-identity72.1%
add-sqr-sqrt34.7%
sqrt-unprod53.9%
sqr-neg53.9%
sqrt-unprod34.8%
add-sqr-sqrt69.8%
add-sqr-sqrt39.9%
sqrt-unprod60.8%
sqr-neg60.8%
sqrt-unprod32.3%
add-sqr-sqrt72.1%
distribute-neg-in72.1%
add-sqr-sqrt39.9%
sqrt-unprod69.5%
sqr-neg69.5%
sqrt-unprod32.6%
add-sqr-sqrt72.5%
sub-neg72.5%
Applied egg-rr72.5%
Taylor expanded in u around 0 31.4%
if -1.24999999999999992e145 < u Initial program 69.6%
associate-/l*72.0%
distribute-lft-neg-out72.0%
distribute-rgt-neg-in72.0%
associate-/r*82.6%
distribute-neg-frac282.6%
Simplified82.6%
Taylor expanded in t1 around inf 59.7%
associate-*r/59.7%
neg-mul-159.7%
Simplified59.7%
Final simplification55.8%
(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 69.5%
associate-/l*71.7%
distribute-lft-neg-out71.7%
distribute-rgt-neg-in71.7%
associate-/r*84.3%
distribute-neg-frac284.3%
Simplified84.3%
distribute-frac-neg284.3%
distribute-rgt-neg-out84.3%
associate-/r*71.7%
distribute-lft-neg-out71.7%
associate-/l*69.5%
times-frac99.5%
frac-2neg99.5%
associate-*r/99.3%
add-sqr-sqrt48.4%
sqrt-unprod44.5%
sqr-neg44.5%
sqrt-unprod19.3%
add-sqr-sqrt36.0%
add-sqr-sqrt16.4%
sqrt-unprod54.4%
sqr-neg54.4%
sqrt-prod48.2%
add-sqr-sqrt99.3%
Applied egg-rr99.3%
Taylor expanded in t1 around inf 58.1%
mul-1-neg58.1%
Simplified58.1%
Final simplification58.1%
(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 69.5%
associate-/l*71.7%
distribute-lft-neg-out71.7%
distribute-rgt-neg-in71.7%
associate-/r*84.3%
distribute-neg-frac284.3%
Simplified84.3%
distribute-frac-neg284.3%
distribute-rgt-neg-out84.3%
associate-/r*71.7%
distribute-lft-neg-out71.7%
associate-/l*69.5%
times-frac99.5%
frac-2neg99.5%
associate-*r/99.3%
add-sqr-sqrt48.4%
sqrt-unprod44.5%
sqr-neg44.5%
sqrt-unprod19.3%
add-sqr-sqrt36.0%
add-sqr-sqrt16.4%
sqrt-unprod54.4%
sqr-neg54.4%
sqrt-prod48.2%
add-sqr-sqrt99.3%
Applied egg-rr99.3%
Taylor expanded in t1 around inf 58.1%
mul-1-neg58.1%
Simplified58.1%
clear-num58.2%
associate-/r/58.0%
+-commutative58.0%
add-sqr-sqrt29.4%
sqrt-unprod36.2%
sqr-neg36.2%
sqrt-unprod9.2%
add-sqr-sqrt21.1%
Applied egg-rr21.1%
Taylor expanded in u around 0 13.2%
Final simplification13.2%
herbie shell --seed 2024074
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))