
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1): return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1) return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = (-t1 * v) / ((t1 + u) * (t1 + u)); end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1): return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1) return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = (-t1 * v) / ((t1 + u) * (t1 + u)); end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\end{array}
(FPCore (u v t1) :precision binary64 (/ (* v (/ (- t1) (+ t1 u))) (+ t1 u)))
double code(double u, double v, double t1) {
return (v * (-t1 / (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 = (v * (-t1 / (t1 + u))) / (t1 + u)
end function
public static double code(double u, double v, double t1) {
return (v * (-t1 / (t1 + u))) / (t1 + u);
}
def code(u, v, t1): return (v * (-t1 / (t1 + u))) / (t1 + u)
function code(u, v, t1) return Float64(Float64(v * Float64(Float64(-t1) / Float64(t1 + u))) / Float64(t1 + u)) end
function tmp = code(u, v, t1) tmp = (v * (-t1 / (t1 + u))) / (t1 + u); end
code[u_, v_, t1_] := N[(N[(v * N[((-t1) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{v \cdot \frac{-t1}{t1 + u}}{t1 + u}
\end{array}
Initial program 77.5%
associate-/l*77.6%
distribute-lft-neg-out77.6%
distribute-rgt-neg-in77.6%
associate-/r*86.3%
distribute-neg-frac286.3%
Simplified86.3%
distribute-frac-neg286.3%
associate-/r*77.6%
distribute-rgt-neg-in77.6%
distribute-lft-neg-out77.6%
associate-*r/77.5%
times-frac96.6%
frac-2neg96.6%
associate-*r/98.5%
add-sqr-sqrt49.6%
sqrt-unprod44.8%
sqr-neg44.8%
sqrt-unprod18.5%
add-sqr-sqrt39.4%
add-sqr-sqrt21.9%
sqrt-unprod64.2%
sqr-neg64.2%
sqrt-prod49.8%
add-sqr-sqrt98.5%
Applied egg-rr98.5%
Final simplification98.5%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) (+ t1 u))) (t_2 (* t1 (/ v (* (+ t1 u) (- u))))))
(if (<= t1 -3.6e-76)
t_1
(if (<= t1 2.6e-137)
t_2
(if (<= t1 7.1e-84)
(/ -1.0 (/ (+ t1 u) v))
(if (<= t1 1.3e-8) t_2 t_1))))))
double code(double u, double v, double t1) {
double t_1 = -v / (t1 + u);
double t_2 = t1 * (v / ((t1 + u) * -u));
double tmp;
if (t1 <= -3.6e-76) {
tmp = t_1;
} else if (t1 <= 2.6e-137) {
tmp = t_2;
} else if (t1 <= 7.1e-84) {
tmp = -1.0 / ((t1 + u) / v);
} else if (t1 <= 1.3e-8) {
tmp = t_2;
} else {
tmp = 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) :: t_2
real(8) :: tmp
t_1 = -v / (t1 + u)
t_2 = t1 * (v / ((t1 + u) * -u))
if (t1 <= (-3.6d-76)) then
tmp = t_1
else if (t1 <= 2.6d-137) then
tmp = t_2
else if (t1 <= 7.1d-84) then
tmp = (-1.0d0) / ((t1 + u) / v)
else if (t1 <= 1.3d-8) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = -v / (t1 + u);
double t_2 = t1 * (v / ((t1 + u) * -u));
double tmp;
if (t1 <= -3.6e-76) {
tmp = t_1;
} else if (t1 <= 2.6e-137) {
tmp = t_2;
} else if (t1 <= 7.1e-84) {
tmp = -1.0 / ((t1 + u) / v);
} else if (t1 <= 1.3e-8) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -v / (t1 + u) t_2 = t1 * (v / ((t1 + u) * -u)) tmp = 0 if t1 <= -3.6e-76: tmp = t_1 elif t1 <= 2.6e-137: tmp = t_2 elif t1 <= 7.1e-84: tmp = -1.0 / ((t1 + u) / v) elif t1 <= 1.3e-8: tmp = t_2 else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-v) / Float64(t1 + u)) t_2 = Float64(t1 * Float64(v / Float64(Float64(t1 + u) * Float64(-u)))) tmp = 0.0 if (t1 <= -3.6e-76) tmp = t_1; elseif (t1 <= 2.6e-137) tmp = t_2; elseif (t1 <= 7.1e-84) tmp = Float64(-1.0 / Float64(Float64(t1 + u) / v)); elseif (t1 <= 1.3e-8) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -v / (t1 + u); t_2 = t1 * (v / ((t1 + u) * -u)); tmp = 0.0; if (t1 <= -3.6e-76) tmp = t_1; elseif (t1 <= 2.6e-137) tmp = t_2; elseif (t1 <= 7.1e-84) tmp = -1.0 / ((t1 + u) / v); elseif (t1 <= 1.3e-8) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t1 * N[(v / N[(N[(t1 + u), $MachinePrecision] * (-u)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -3.6e-76], t$95$1, If[LessEqual[t1, 2.6e-137], t$95$2, If[LessEqual[t1, 7.1e-84], N[(-1.0 / N[(N[(t1 + u), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 1.3e-8], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{t1 + u}\\
t_2 := t1 \cdot \frac{v}{\left(t1 + u\right) \cdot \left(-u\right)}\\
\mathbf{if}\;t1 \leq -3.6 \cdot 10^{-76}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 2.6 \cdot 10^{-137}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t1 \leq 7.1 \cdot 10^{-84}:\\
\;\;\;\;\frac{-1}{\frac{t1 + u}{v}}\\
\mathbf{elif}\;t1 \leq 1.3 \cdot 10^{-8}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -3.6e-76 or 1.3000000000000001e-8 < t1 Initial program 68.1%
associate-/l*71.6%
distribute-lft-neg-out71.6%
distribute-rgt-neg-in71.6%
associate-/r*84.6%
distribute-neg-frac284.6%
Simplified84.6%
distribute-frac-neg284.6%
associate-/r*71.6%
distribute-rgt-neg-in71.6%
distribute-lft-neg-out71.6%
associate-*r/68.1%
times-frac99.9%
frac-2neg99.9%
associate-*r/99.9%
add-sqr-sqrt54.0%
sqrt-unprod39.5%
sqr-neg39.5%
sqrt-unprod17.3%
add-sqr-sqrt37.4%
add-sqr-sqrt22.1%
sqrt-unprod58.8%
sqr-neg58.8%
sqrt-prod48.3%
add-sqr-sqrt99.9%
Applied egg-rr99.9%
Taylor expanded in t1 around inf 84.3%
mul-1-neg84.3%
Simplified84.3%
if -3.6e-76 < t1 < 2.6e-137 or 7.0999999999999997e-84 < t1 < 1.3000000000000001e-8Initial program 89.4%
associate-/l*86.9%
distribute-lft-neg-out86.9%
distribute-rgt-neg-in86.9%
associate-/r*90.8%
distribute-neg-frac290.8%
Simplified90.8%
Taylor expanded in t1 around 0 84.4%
Taylor expanded in v around 0 85.0%
neg-mul-185.0%
associate-/l*81.5%
distribute-rgt-neg-in81.5%
distribute-neg-frac281.5%
*-commutative81.5%
distribute-rgt-neg-in81.5%
Simplified81.5%
if 2.6e-137 < t1 < 7.0999999999999997e-84Initial program 88.7%
times-frac99.9%
distribute-frac-neg99.9%
distribute-neg-frac299.9%
+-commutative99.9%
distribute-neg-in99.9%
unsub-neg99.9%
Simplified99.9%
clear-num99.6%
inv-pow99.6%
Applied egg-rr99.6%
unpow-199.6%
Simplified99.6%
Taylor expanded in t1 around inf 81.3%
Final simplification83.1%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ v (+ t1 u))))
(if (<= t1 -1e+189)
(* t_1 (/ (- u t1) t1))
(if (<= t1 5.4e+133) (* t1 (/ t_1 (- (- u) t1))) (/ (- v) (+ t1 u))))))
double code(double u, double v, double t1) {
double t_1 = v / (t1 + u);
double tmp;
if (t1 <= -1e+189) {
tmp = t_1 * ((u - t1) / t1);
} else if (t1 <= 5.4e+133) {
tmp = t1 * (t_1 / (-u - t1));
} 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) :: t_1
real(8) :: tmp
t_1 = v / (t1 + u)
if (t1 <= (-1d+189)) then
tmp = t_1 * ((u - t1) / t1)
else if (t1 <= 5.4d+133) then
tmp = t1 * (t_1 / (-u - t1))
else
tmp = -v / (t1 + u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = v / (t1 + u);
double tmp;
if (t1 <= -1e+189) {
tmp = t_1 * ((u - t1) / t1);
} else if (t1 <= 5.4e+133) {
tmp = t1 * (t_1 / (-u - t1));
} else {
tmp = -v / (t1 + u);
}
return tmp;
}
def code(u, v, t1): t_1 = v / (t1 + u) tmp = 0 if t1 <= -1e+189: tmp = t_1 * ((u - t1) / t1) elif t1 <= 5.4e+133: tmp = t1 * (t_1 / (-u - t1)) else: tmp = -v / (t1 + u) return tmp
function code(u, v, t1) t_1 = Float64(v / Float64(t1 + u)) tmp = 0.0 if (t1 <= -1e+189) tmp = Float64(t_1 * Float64(Float64(u - t1) / t1)); elseif (t1 <= 5.4e+133) tmp = Float64(t1 * Float64(t_1 / Float64(Float64(-u) - t1))); else tmp = Float64(Float64(-v) / Float64(t1 + u)); end return tmp end
function tmp_2 = code(u, v, t1) t_1 = v / (t1 + u); tmp = 0.0; if (t1 <= -1e+189) tmp = t_1 * ((u - t1) / t1); elseif (t1 <= 5.4e+133) tmp = t1 * (t_1 / (-u - t1)); else tmp = -v / (t1 + u); end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -1e+189], N[(t$95$1 * N[(N[(u - t1), $MachinePrecision] / t1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 5.4e+133], N[(t1 * N[(t$95$1 / N[((-u) - t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{v}{t1 + u}\\
\mathbf{if}\;t1 \leq -1 \cdot 10^{+189}:\\
\;\;\;\;t\_1 \cdot \frac{u - t1}{t1}\\
\mathbf{elif}\;t1 \leq 5.4 \cdot 10^{+133}:\\
\;\;\;\;t1 \cdot \frac{t\_1}{\left(-u\right) - t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1 + u}\\
\end{array}
\end{array}
if t1 < -1e189Initial program 52.3%
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 inf 91.6%
Taylor expanded in t1 around 0 91.6%
neg-mul-191.6%
sub-neg91.6%
Simplified91.6%
if -1e189 < t1 < 5.4000000000000004e133Initial program 84.0%
associate-/l*84.0%
distribute-lft-neg-out84.0%
distribute-rgt-neg-in84.0%
associate-/r*91.0%
distribute-neg-frac291.0%
Simplified91.0%
if 5.4000000000000004e133 < t1 Initial program 58.9%
associate-/l*58.1%
distribute-lft-neg-out58.1%
distribute-rgt-neg-in58.1%
associate-/r*78.6%
distribute-neg-frac278.6%
Simplified78.6%
distribute-frac-neg278.6%
associate-/r*58.1%
distribute-rgt-neg-in58.1%
distribute-lft-neg-out58.1%
associate-*r/58.9%
times-frac100.0%
frac-2neg100.0%
associate-*r/100.0%
add-sqr-sqrt0.0%
sqrt-unprod5.9%
sqr-neg5.9%
sqrt-unprod42.5%
add-sqr-sqrt42.5%
add-sqr-sqrt6.1%
sqrt-unprod65.4%
sqr-neg65.4%
sqrt-prod93.4%
add-sqr-sqrt100.0%
Applied egg-rr100.0%
Taylor expanded in t1 around inf 100.0%
mul-1-neg100.0%
Simplified100.0%
Final simplification92.2%
(FPCore (u v t1) :precision binary64 (if (or (<= u -1.1e-40) (not (<= u 750.0))) (* t1 (/ (/ v u) (- (- u) t1))) (/ v (- t1))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -1.1e-40) || !(u <= 750.0)) {
tmp = t1 * ((v / u) / (-u - t1));
} 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.1d-40)) .or. (.not. (u <= 750.0d0))) then
tmp = t1 * ((v / u) / (-u - t1))
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.1e-40) || !(u <= 750.0)) {
tmp = t1 * ((v / u) / (-u - t1));
} else {
tmp = v / -t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -1.1e-40) or not (u <= 750.0): tmp = t1 * ((v / u) / (-u - t1)) else: tmp = v / -t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -1.1e-40) || !(u <= 750.0)) tmp = Float64(t1 * Float64(Float64(v / u) / Float64(Float64(-u) - t1))); else tmp = Float64(v / Float64(-t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -1.1e-40) || ~((u <= 750.0))) tmp = t1 * ((v / u) / (-u - t1)); else tmp = v / -t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -1.1e-40], N[Not[LessEqual[u, 750.0]], $MachinePrecision]], N[(t1 * N[(N[(v / u), $MachinePrecision] / N[((-u) - t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(v / (-t1)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.1 \cdot 10^{-40} \lor \neg \left(u \leq 750\right):\\
\;\;\;\;t1 \cdot \frac{\frac{v}{u}}{\left(-u\right) - t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{-t1}\\
\end{array}
\end{array}
if u < -1.10000000000000004e-40 or 750 < u Initial program 81.0%
associate-/l*82.7%
distribute-lft-neg-out82.7%
distribute-rgt-neg-in82.7%
associate-/r*91.4%
distribute-neg-frac291.4%
Simplified91.4%
Taylor expanded in t1 around 0 82.1%
if -1.10000000000000004e-40 < u < 750Initial program 73.3%
associate-/l*71.3%
distribute-lft-neg-out71.3%
distribute-rgt-neg-in71.3%
associate-/r*80.0%
distribute-neg-frac280.0%
Simplified80.0%
Taylor expanded in t1 around inf 82.8%
associate-*r/82.8%
neg-mul-182.8%
Simplified82.8%
Final simplification82.4%
(FPCore (u v t1) :precision binary64 (if (or (<= u -7.6e+20) (not (<= u 1.55e+67))) (* t1 (/ v (* u (+ t1 u)))) (/ v (- t1))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -7.6e+20) || !(u <= 1.55e+67)) {
tmp = t1 * (v / (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 <= (-7.6d+20)) .or. (.not. (u <= 1.55d+67))) then
tmp = t1 * (v / (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 <= -7.6e+20) || !(u <= 1.55e+67)) {
tmp = t1 * (v / (u * (t1 + u)));
} else {
tmp = v / -t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -7.6e+20) or not (u <= 1.55e+67): tmp = t1 * (v / (u * (t1 + u))) else: tmp = v / -t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -7.6e+20) || !(u <= 1.55e+67)) tmp = Float64(t1 * Float64(v / Float64(u * Float64(t1 + u)))); else tmp = Float64(v / Float64(-t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -7.6e+20) || ~((u <= 1.55e+67))) tmp = t1 * (v / (u * (t1 + u))); else tmp = v / -t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -7.6e+20], N[Not[LessEqual[u, 1.55e+67]], $MachinePrecision]], N[(t1 * N[(v / N[(u * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(v / (-t1)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -7.6 \cdot 10^{+20} \lor \neg \left(u \leq 1.55 \cdot 10^{+67}\right):\\
\;\;\;\;t1 \cdot \frac{v}{u \cdot \left(t1 + u\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{-t1}\\
\end{array}
\end{array}
if u < -7.6e20 or 1.54999999999999998e67 < u Initial program 79.9%
associate-/l*81.9%
distribute-lft-neg-out81.9%
distribute-rgt-neg-in81.9%
associate-/r*91.1%
distribute-neg-frac291.1%
Simplified91.1%
Taylor expanded in t1 around 0 86.8%
associate-/l/80.2%
associate-*r/77.0%
*-commutative77.0%
add-sqr-sqrt44.9%
sqrt-unprod74.6%
sqr-neg74.6%
sqrt-unprod28.8%
add-sqr-sqrt66.1%
Applied egg-rr66.1%
associate-/l*67.6%
Simplified67.6%
if -7.6e20 < u < 1.54999999999999998e67Initial program 75.7%
associate-/l*74.1%
distribute-lft-neg-out74.1%
distribute-rgt-neg-in74.1%
associate-/r*82.6%
distribute-neg-frac282.6%
Simplified82.6%
Taylor expanded in t1 around inf 74.2%
associate-*r/74.2%
neg-mul-174.2%
Simplified74.2%
Final simplification71.3%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -4.6e-225) (not (<= t1 2e-140))) (/ (- v) (+ t1 u)) (* (/ v t1) (/ t1 u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -4.6e-225) || !(t1 <= 2e-140)) {
tmp = -v / (t1 + u);
} else {
tmp = (v / t1) * (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 <= (-4.6d-225)) .or. (.not. (t1 <= 2d-140))) then
tmp = -v / (t1 + u)
else
tmp = (v / t1) * (t1 / u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -4.6e-225) || !(t1 <= 2e-140)) {
tmp = -v / (t1 + u);
} else {
tmp = (v / t1) * (t1 / u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -4.6e-225) or not (t1 <= 2e-140): tmp = -v / (t1 + u) else: tmp = (v / t1) * (t1 / u) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -4.6e-225) || !(t1 <= 2e-140)) tmp = Float64(Float64(-v) / Float64(t1 + u)); else tmp = Float64(Float64(v / t1) * Float64(t1 / u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -4.6e-225) || ~((t1 <= 2e-140))) tmp = -v / (t1 + u); else tmp = (v / t1) * (t1 / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -4.6e-225], N[Not[LessEqual[t1, 2e-140]], $MachinePrecision]], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], N[(N[(v / t1), $MachinePrecision] * N[(t1 / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -4.6 \cdot 10^{-225} \lor \neg \left(t1 \leq 2 \cdot 10^{-140}\right):\\
\;\;\;\;\frac{-v}{t1 + u}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{t1} \cdot \frac{t1}{u}\\
\end{array}
\end{array}
if t1 < -4.5999999999999998e-225 or 2e-140 < t1 Initial program 72.9%
associate-/l*74.3%
distribute-lft-neg-out74.3%
distribute-rgt-neg-in74.3%
associate-/r*85.1%
distribute-neg-frac285.1%
Simplified85.1%
distribute-frac-neg285.1%
associate-/r*74.3%
distribute-rgt-neg-in74.3%
distribute-lft-neg-out74.3%
associate-*r/72.9%
times-frac99.0%
frac-2neg99.0%
associate-*r/99.5%
add-sqr-sqrt53.9%
sqrt-unprod44.6%
sqr-neg44.6%
sqrt-unprod16.3%
add-sqr-sqrt37.8%
add-sqr-sqrt20.8%
sqrt-unprod63.7%
sqr-neg63.7%
sqrt-prod51.2%
add-sqr-sqrt99.5%
Applied egg-rr99.5%
Taylor expanded in t1 around inf 72.4%
mul-1-neg72.4%
Simplified72.4%
if -4.5999999999999998e-225 < t1 < 2e-140Initial program 92.9%
associate-/l*88.2%
distribute-lft-neg-out88.2%
distribute-rgt-neg-in88.2%
associate-/r*90.4%
distribute-neg-frac290.4%
Simplified90.4%
Taylor expanded in t1 around 0 88.7%
associate-/l/86.6%
associate-*r/91.2%
*-commutative91.2%
add-sqr-sqrt51.5%
sqrt-unprod72.3%
sqr-neg72.3%
sqrt-unprod20.8%
add-sqr-sqrt46.3%
Applied egg-rr46.3%
Taylor expanded in u around 0 27.2%
*-commutative27.2%
times-frac33.3%
Applied egg-rr33.3%
Final simplification63.2%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -2.4e-224) (not (<= t1 8.2e-138))) (/ (- v) (+ t1 u)) (/ (* t1 (/ v u)) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -2.4e-224) || !(t1 <= 8.2e-138)) {
tmp = -v / (t1 + u);
} else {
tmp = (t1 * (v / 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.4d-224)) .or. (.not. (t1 <= 8.2d-138))) then
tmp = -v / (t1 + u)
else
tmp = (t1 * (v / u)) / t1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -2.4e-224) || !(t1 <= 8.2e-138)) {
tmp = -v / (t1 + u);
} else {
tmp = (t1 * (v / u)) / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -2.4e-224) or not (t1 <= 8.2e-138): tmp = -v / (t1 + u) else: tmp = (t1 * (v / u)) / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -2.4e-224) || !(t1 <= 8.2e-138)) tmp = Float64(Float64(-v) / Float64(t1 + u)); else tmp = Float64(Float64(t1 * Float64(v / u)) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -2.4e-224) || ~((t1 <= 8.2e-138))) tmp = -v / (t1 + u); else tmp = (t1 * (v / u)) / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -2.4e-224], N[Not[LessEqual[t1, 8.2e-138]], $MachinePrecision]], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], N[(N[(t1 * N[(v / u), $MachinePrecision]), $MachinePrecision] / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -2.4 \cdot 10^{-224} \lor \neg \left(t1 \leq 8.2 \cdot 10^{-138}\right):\\
\;\;\;\;\frac{-v}{t1 + u}\\
\mathbf{else}:\\
\;\;\;\;\frac{t1 \cdot \frac{v}{u}}{t1}\\
\end{array}
\end{array}
if t1 < -2.40000000000000014e-224 or 8.19999999999999998e-138 < t1 Initial program 72.7%
associate-/l*74.1%
distribute-lft-neg-out74.1%
distribute-rgt-neg-in74.1%
associate-/r*85.0%
distribute-neg-frac285.0%
Simplified85.0%
distribute-frac-neg285.0%
associate-/r*74.1%
distribute-rgt-neg-in74.1%
distribute-lft-neg-out74.1%
associate-*r/72.7%
times-frac99.0%
frac-2neg99.0%
associate-*r/99.5%
add-sqr-sqrt54.2%
sqrt-unprod44.3%
sqr-neg44.3%
sqrt-unprod15.9%
add-sqr-sqrt37.4%
add-sqr-sqrt20.9%
sqrt-unprod63.6%
sqr-neg63.6%
sqrt-prod51.0%
add-sqr-sqrt99.5%
Applied egg-rr99.5%
Taylor expanded in t1 around inf 72.7%
mul-1-neg72.7%
Simplified72.7%
if -2.40000000000000014e-224 < t1 < 8.19999999999999998e-138Initial program 93.0%
associate-/l*88.4%
distribute-lft-neg-out88.4%
distribute-rgt-neg-in88.4%
associate-/r*90.5%
distribute-neg-frac290.5%
Simplified90.5%
Taylor expanded in t1 around 0 88.9%
Taylor expanded in u around 0 13.3%
mul-1-neg13.3%
associate-/r*13.2%
distribute-neg-frac213.2%
Simplified13.2%
clear-num13.2%
inv-pow13.2%
div-inv13.2%
add-sqr-sqrt5.2%
sqrt-unprod26.4%
sqr-neg26.4%
sqrt-unprod7.9%
add-sqr-sqrt16.6%
clear-num16.6%
Applied egg-rr16.6%
unpow-116.6%
Simplified16.6%
associate-*r/16.5%
*-commutative16.5%
clear-num16.5%
associate-/l*26.9%
times-frac16.9%
associate-*l/41.2%
Applied egg-rr41.2%
Final simplification65.2%
(FPCore (u v t1) :precision binary64 (if (<= u -4.4e+248) (/ v (- u)) (if (<= u 1.55e+100) (/ v (- t1)) (/ 1.0 (/ u v)))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -4.4e+248) {
tmp = v / -u;
} else if (u <= 1.55e+100) {
tmp = v / -t1;
} else {
tmp = 1.0 / (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.4d+248)) then
tmp = v / -u
else if (u <= 1.55d+100) then
tmp = v / -t1
else
tmp = 1.0d0 / (u / v)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -4.4e+248) {
tmp = v / -u;
} else if (u <= 1.55e+100) {
tmp = v / -t1;
} else {
tmp = 1.0 / (u / v);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -4.4e+248: tmp = v / -u elif u <= 1.55e+100: tmp = v / -t1 else: tmp = 1.0 / (u / v) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -4.4e+248) tmp = Float64(v / Float64(-u)); elseif (u <= 1.55e+100) tmp = Float64(v / Float64(-t1)); else tmp = Float64(1.0 / Float64(u / v)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -4.4e+248) tmp = v / -u; elseif (u <= 1.55e+100) tmp = v / -t1; else tmp = 1.0 / (u / v); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -4.4e+248], N[(v / (-u)), $MachinePrecision], If[LessEqual[u, 1.55e+100], N[(v / (-t1)), $MachinePrecision], N[(1.0 / N[(u / v), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -4.4 \cdot 10^{+248}:\\
\;\;\;\;\frac{v}{-u}\\
\mathbf{elif}\;u \leq 1.55 \cdot 10^{+100}:\\
\;\;\;\;\frac{v}{-t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{u}{v}}\\
\end{array}
\end{array}
if u < -4.3999999999999999e248Initial program 86.2%
associate-/l*86.9%
distribute-lft-neg-out86.9%
distribute-rgt-neg-in86.9%
associate-/r*86.9%
distribute-neg-frac286.9%
Simplified86.9%
Taylor expanded in t1 around 0 86.9%
Taylor expanded in t1 around inf 59.2%
associate-*r/59.2%
mul-1-neg59.2%
Simplified59.2%
if -4.3999999999999999e248 < u < 1.55000000000000003e100Initial program 76.7%
associate-/l*76.1%
distribute-lft-neg-out76.1%
distribute-rgt-neg-in76.1%
associate-/r*84.7%
distribute-neg-frac284.7%
Simplified84.7%
Taylor expanded in t1 around inf 62.9%
associate-*r/62.9%
neg-mul-162.9%
Simplified62.9%
if 1.55000000000000003e100 < u Initial program 79.2%
associate-/l*82.0%
distribute-lft-neg-out82.0%
distribute-rgt-neg-in82.0%
associate-/r*94.9%
distribute-neg-frac294.9%
Simplified94.9%
Taylor expanded in t1 around 0 92.2%
Taylor expanded in u around 0 35.8%
mul-1-neg35.8%
associate-/r*35.5%
distribute-neg-frac235.5%
Simplified35.5%
clear-num35.5%
inv-pow35.5%
div-inv35.5%
add-sqr-sqrt0.0%
sqrt-unprod56.6%
sqr-neg56.6%
sqrt-unprod35.9%
add-sqr-sqrt35.9%
clear-num35.9%
Applied egg-rr35.9%
unpow-135.9%
Simplified35.9%
associate-*r/35.8%
*-commutative35.8%
clear-num35.8%
associate-/l*37.6%
times-frac32.8%
*-inverses32.8%
*-un-lft-identity32.8%
clear-num33.7%
Applied egg-rr33.7%
Final simplification58.5%
(FPCore (u v t1) :precision binary64 (if (or (<= u -4.4e+248) (not (<= u 1.55e+100))) (/ v u) (/ v (- t1))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -4.4e+248) || !(u <= 1.55e+100)) {
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 <= (-4.4d+248)) .or. (.not. (u <= 1.55d+100))) 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 <= -4.4e+248) || !(u <= 1.55e+100)) {
tmp = v / u;
} else {
tmp = v / -t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -4.4e+248) or not (u <= 1.55e+100): tmp = v / u else: tmp = v / -t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -4.4e+248) || !(u <= 1.55e+100)) 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 <= -4.4e+248) || ~((u <= 1.55e+100))) tmp = v / u; else tmp = v / -t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -4.4e+248], N[Not[LessEqual[u, 1.55e+100]], $MachinePrecision]], N[(v / u), $MachinePrecision], N[(v / (-t1)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -4.4 \cdot 10^{+248} \lor \neg \left(u \leq 1.55 \cdot 10^{+100}\right):\\
\;\;\;\;\frac{v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{-t1}\\
\end{array}
\end{array}
if u < -4.3999999999999999e248 or 1.55000000000000003e100 < u Initial program 81.1%
associate-/l*83.4%
distribute-lft-neg-out83.4%
distribute-rgt-neg-in83.4%
associate-/r*92.7%
distribute-neg-frac292.7%
Simplified92.7%
Taylor expanded in t1 around 0 90.8%
associate-/l/83.4%
associate-*r/81.1%
*-commutative81.1%
add-sqr-sqrt25.6%
sqrt-unprod73.7%
sqr-neg73.7%
sqrt-unprod48.1%
add-sqr-sqrt73.7%
Applied egg-rr73.7%
Taylor expanded in t1 around inf 40.0%
if -4.3999999999999999e248 < u < 1.55000000000000003e100Initial program 76.7%
associate-/l*76.1%
distribute-lft-neg-out76.1%
distribute-rgt-neg-in76.1%
associate-/r*84.7%
distribute-neg-frac284.7%
Simplified84.7%
Taylor expanded in t1 around inf 62.9%
associate-*r/62.9%
neg-mul-162.9%
Simplified62.9%
Final simplification58.3%
(FPCore (u v t1) :precision binary64 (if (<= u -4.4e+248) (/ v (- u)) (if (<= u 1.5e+100) (/ v (- t1)) (/ v u))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -4.4e+248) {
tmp = v / -u;
} else if (u <= 1.5e+100) {
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 <= (-4.4d+248)) then
tmp = v / -u
else if (u <= 1.5d+100) 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 <= -4.4e+248) {
tmp = v / -u;
} else if (u <= 1.5e+100) {
tmp = v / -t1;
} else {
tmp = v / u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -4.4e+248: tmp = v / -u elif u <= 1.5e+100: tmp = v / -t1 else: tmp = v / u return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -4.4e+248) tmp = Float64(v / Float64(-u)); elseif (u <= 1.5e+100) tmp = Float64(v / Float64(-t1)); else tmp = Float64(v / u); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -4.4e+248) tmp = v / -u; elseif (u <= 1.5e+100) tmp = v / -t1; else tmp = v / u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -4.4e+248], N[(v / (-u)), $MachinePrecision], If[LessEqual[u, 1.5e+100], N[(v / (-t1)), $MachinePrecision], N[(v / u), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -4.4 \cdot 10^{+248}:\\
\;\;\;\;\frac{v}{-u}\\
\mathbf{elif}\;u \leq 1.5 \cdot 10^{+100}:\\
\;\;\;\;\frac{v}{-t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u}\\
\end{array}
\end{array}
if u < -4.3999999999999999e248Initial program 86.2%
associate-/l*86.9%
distribute-lft-neg-out86.9%
distribute-rgt-neg-in86.9%
associate-/r*86.9%
distribute-neg-frac286.9%
Simplified86.9%
Taylor expanded in t1 around 0 86.9%
Taylor expanded in t1 around inf 59.2%
associate-*r/59.2%
mul-1-neg59.2%
Simplified59.2%
if -4.3999999999999999e248 < u < 1.49999999999999993e100Initial program 76.7%
associate-/l*76.1%
distribute-lft-neg-out76.1%
distribute-rgt-neg-in76.1%
associate-/r*84.7%
distribute-neg-frac284.7%
Simplified84.7%
Taylor expanded in t1 around inf 62.9%
associate-*r/62.9%
neg-mul-162.9%
Simplified62.9%
if 1.49999999999999993e100 < u Initial program 79.2%
associate-/l*82.0%
distribute-lft-neg-out82.0%
distribute-rgt-neg-in82.0%
associate-/r*94.9%
distribute-neg-frac294.9%
Simplified94.9%
Taylor expanded in t1 around 0 92.2%
associate-/l/82.0%
associate-*r/79.2%
*-commutative79.2%
add-sqr-sqrt2.7%
sqrt-unprod68.9%
sqr-neg68.9%
sqrt-unprod66.2%
add-sqr-sqrt68.9%
Applied egg-rr68.9%
Taylor expanded in t1 around inf 32.8%
Final simplification58.3%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -8.8e+105) (not (<= t1 5e+137))) (/ v t1) (/ v u)))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -8.8e+105) || !(t1 <= 5e+137)) {
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 <= (-8.8d+105)) .or. (.not. (t1 <= 5d+137))) 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 <= -8.8e+105) || !(t1 <= 5e+137)) {
tmp = v / t1;
} else {
tmp = v / u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -8.8e+105) or not (t1 <= 5e+137): tmp = v / t1 else: tmp = v / u return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -8.8e+105) || !(t1 <= 5e+137)) 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 <= -8.8e+105) || ~((t1 <= 5e+137))) tmp = v / t1; else tmp = v / u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -8.8e+105], N[Not[LessEqual[t1, 5e+137]], $MachinePrecision]], N[(v / t1), $MachinePrecision], N[(v / u), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -8.8 \cdot 10^{+105} \lor \neg \left(t1 \leq 5 \cdot 10^{+137}\right):\\
\;\;\;\;\frac{v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u}\\
\end{array}
\end{array}
if t1 < -8.80000000000000027e105 or 5.0000000000000002e137 < t1 Initial program 55.2%
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 94.3%
Taylor expanded in u around inf 44.6%
if -8.80000000000000027e105 < t1 < 5.0000000000000002e137Initial program 86.5%
associate-/l*86.4%
distribute-lft-neg-out86.4%
distribute-rgt-neg-in86.4%
associate-/r*91.3%
distribute-neg-frac291.3%
Simplified91.3%
Taylor expanded in t1 around 0 64.7%
associate-/l/60.4%
associate-*r/61.5%
*-commutative61.5%
add-sqr-sqrt31.2%
sqrt-unprod48.5%
sqr-neg48.5%
sqrt-unprod17.3%
add-sqr-sqrt36.7%
Applied egg-rr36.7%
Taylor expanded in t1 around inf 17.9%
Final simplification25.5%
(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(t1 / Float64(t1 + u)) * Float64(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 77.5%
times-frac96.6%
distribute-frac-neg96.6%
distribute-neg-frac296.6%
+-commutative96.6%
distribute-neg-in96.6%
unsub-neg96.6%
Simplified96.6%
Final simplification96.6%
(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(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[(t1 / N[(N[(t1 + u), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision] / N[((-u) - t1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{t1}{\frac{t1 + u}{v}}}{\left(-u\right) - t1}
\end{array}
Initial program 77.5%
associate-/l*77.6%
distribute-lft-neg-out77.6%
distribute-rgt-neg-in77.6%
associate-/r*86.3%
distribute-neg-frac286.3%
Simplified86.3%
distribute-frac-neg286.3%
associate-/r*77.6%
distribute-rgt-neg-in77.6%
distribute-lft-neg-out77.6%
associate-*r/77.5%
times-frac96.6%
frac-2neg96.6%
associate-*r/98.5%
add-sqr-sqrt49.6%
sqrt-unprod44.8%
sqr-neg44.8%
sqrt-unprod18.5%
add-sqr-sqrt39.4%
add-sqr-sqrt21.9%
sqrt-unprod64.2%
sqr-neg64.2%
sqrt-prod49.8%
add-sqr-sqrt98.5%
Applied egg-rr98.5%
associate-*l/87.3%
distribute-rgt-neg-out87.3%
distribute-neg-frac87.3%
associate-*r/98.0%
clear-num97.4%
un-div-inv98.1%
Applied egg-rr98.1%
Final simplification98.1%
(FPCore (u v t1) :precision binary64 (if (<= v 8e+148) (/ (- v) (+ t1 u)) (/ v (- t1))))
double code(double u, double v, double t1) {
double tmp;
if (v <= 8e+148) {
tmp = -v / (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 (v <= 8d+148) then
tmp = -v / (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 (v <= 8e+148) {
tmp = -v / (t1 + u);
} else {
tmp = v / -t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if v <= 8e+148: tmp = -v / (t1 + u) else: tmp = v / -t1 return tmp
function code(u, v, t1) tmp = 0.0 if (v <= 8e+148) tmp = Float64(Float64(-v) / Float64(t1 + u)); else tmp = Float64(v / Float64(-t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (v <= 8e+148) tmp = -v / (t1 + u); else tmp = v / -t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[v, 8e+148], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], N[(v / (-t1)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq 8 \cdot 10^{+148}:\\
\;\;\;\;\frac{-v}{t1 + u}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{-t1}\\
\end{array}
\end{array}
if v < 8.0000000000000004e148Initial program 79.3%
associate-/l*78.4%
distribute-lft-neg-out78.4%
distribute-rgt-neg-in78.4%
associate-/r*86.0%
distribute-neg-frac286.0%
Simplified86.0%
distribute-frac-neg286.0%
associate-/r*78.4%
distribute-rgt-neg-in78.4%
distribute-lft-neg-out78.4%
associate-*r/79.3%
times-frac97.8%
frac-2neg97.8%
associate-*r/98.7%
add-sqr-sqrt50.3%
sqrt-unprod47.3%
sqr-neg47.3%
sqrt-unprod21.2%
add-sqr-sqrt44.3%
add-sqr-sqrt24.7%
sqrt-unprod67.0%
sqr-neg67.0%
sqrt-prod49.8%
add-sqr-sqrt98.7%
Applied egg-rr98.7%
Taylor expanded in t1 around inf 60.7%
mul-1-neg60.7%
Simplified60.7%
if 8.0000000000000004e148 < v Initial program 65.9%
associate-/l*72.0%
distribute-lft-neg-out72.0%
distribute-rgt-neg-in72.0%
associate-/r*88.5%
distribute-neg-frac288.5%
Simplified88.5%
Taylor expanded in t1 around inf 60.5%
associate-*r/60.5%
neg-mul-160.5%
Simplified60.5%
Final simplification60.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 77.5%
times-frac96.6%
distribute-frac-neg96.6%
distribute-neg-frac296.6%
+-commutative96.6%
distribute-neg-in96.6%
unsub-neg96.6%
Simplified96.6%
Taylor expanded in t1 around inf 54.6%
Taylor expanded in u around inf 15.8%
Final simplification15.8%
herbie shell --seed 2024067
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))