
(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 (* (/ (- 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 71.6%
times-frac98.1%
Simplified98.1%
Final simplification98.1%
(FPCore (u v t1) :precision binary64 (if (<= u 3.8e+155) (/ v (* (+ t1 u) (- -1.0 (/ u t1)))) (* (/ v (+ t1 u)) (/ (- t1) u))))
double code(double u, double v, double t1) {
double tmp;
if (u <= 3.8e+155) {
tmp = v / ((t1 + u) * (-1.0 - (u / t1)));
} else {
tmp = (v / (t1 + 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 (u <= 3.8d+155) then
tmp = v / ((t1 + u) * ((-1.0d0) - (u / t1)))
else
tmp = (v / (t1 + u)) * (-t1 / u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= 3.8e+155) {
tmp = v / ((t1 + u) * (-1.0 - (u / t1)));
} else {
tmp = (v / (t1 + u)) * (-t1 / u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= 3.8e+155: tmp = v / ((t1 + u) * (-1.0 - (u / t1))) else: tmp = (v / (t1 + u)) * (-t1 / u) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= 3.8e+155) tmp = Float64(v / Float64(Float64(t1 + u) * Float64(-1.0 - Float64(u / t1)))); else tmp = Float64(Float64(v / Float64(t1 + u)) * Float64(Float64(-t1) / u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= 3.8e+155) tmp = v / ((t1 + u) * (-1.0 - (u / t1))); else tmp = (v / (t1 + u)) * (-t1 / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, 3.8e+155], N[(v / N[(N[(t1 + u), $MachinePrecision] * N[(-1.0 - N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[((-t1) / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq 3.8 \cdot 10^{+155}:\\
\;\;\;\;\frac{v}{\left(t1 + u\right) \cdot \left(-1 - \frac{u}{t1}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{t1 + u} \cdot \frac{-t1}{u}\\
\end{array}
\end{array}
if u < 3.8000000000000001e155Initial program 69.9%
*-commutative69.9%
times-frac97.8%
neg-mul-197.8%
associate-/l*97.8%
associate-*r/97.8%
associate-/l*97.8%
associate-/l/97.8%
neg-mul-197.8%
*-lft-identity97.8%
metadata-eval97.8%
times-frac97.8%
neg-mul-197.8%
remove-double-neg97.8%
neg-mul-197.8%
sub0-neg97.8%
associate--r+97.8%
neg-sub097.8%
div-sub97.8%
distribute-frac-neg97.8%
*-inverses97.8%
metadata-eval97.8%
Simplified97.8%
expm1-log1p-u84.0%
expm1-udef44.5%
associate-/l/44.9%
Applied egg-rr44.9%
expm1-def82.2%
expm1-log1p97.3%
*-commutative97.3%
Simplified97.3%
if 3.8000000000000001e155 < u Initial program 81.8%
times-frac99.9%
Simplified99.9%
Taylor expanded in t1 around 0 99.4%
mul-1-neg99.4%
distribute-neg-frac99.4%
Simplified99.4%
Final simplification97.6%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -90000.0) (not (<= t1 7.1e-62))) (/ v (- (* u -2.0) t1)) (* (- t1) (/ v (* u u)))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -90000.0) || !(t1 <= 7.1e-62)) {
tmp = v / ((u * -2.0) - 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 <= (-90000.0d0)) .or. (.not. (t1 <= 7.1d-62))) then
tmp = v / ((u * (-2.0d0)) - 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 <= -90000.0) || !(t1 <= 7.1e-62)) {
tmp = v / ((u * -2.0) - t1);
} else {
tmp = -t1 * (v / (u * u));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -90000.0) or not (t1 <= 7.1e-62): tmp = v / ((u * -2.0) - t1) else: tmp = -t1 * (v / (u * u)) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -90000.0) || !(t1 <= 7.1e-62)) tmp = Float64(v / Float64(Float64(u * -2.0) - t1)); else tmp = Float64(Float64(-t1) * Float64(v / Float64(u * u))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -90000.0) || ~((t1 <= 7.1e-62))) tmp = v / ((u * -2.0) - t1); else tmp = -t1 * (v / (u * u)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -90000.0], N[Not[LessEqual[t1, 7.1e-62]], $MachinePrecision]], N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision], N[((-t1) * N[(v / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -90000 \lor \neg \left(t1 \leq 7.1 \cdot 10^{-62}\right):\\
\;\;\;\;\frac{v}{u \cdot -2 - t1}\\
\mathbf{else}:\\
\;\;\;\;\left(-t1\right) \cdot \frac{v}{u \cdot u}\\
\end{array}
\end{array}
if t1 < -9e4 or 7.1000000000000001e-62 < t1 Initial program 60.3%
*-commutative60.3%
times-frac99.9%
neg-mul-199.9%
associate-/l*99.9%
associate-*r/99.9%
associate-/l*99.9%
associate-/l/99.9%
neg-mul-199.9%
*-lft-identity99.9%
metadata-eval99.9%
times-frac99.9%
neg-mul-199.9%
remove-double-neg99.9%
neg-mul-199.9%
sub0-neg99.9%
associate--r+99.9%
neg-sub099.9%
div-sub99.9%
distribute-frac-neg99.9%
*-inverses99.9%
metadata-eval99.9%
Simplified99.9%
expm1-log1p-u90.8%
expm1-udef43.9%
associate-/l/43.9%
Applied egg-rr43.9%
expm1-def86.8%
expm1-log1p95.9%
*-commutative95.9%
Simplified95.9%
Taylor expanded in t1 around inf 82.2%
+-commutative82.2%
mul-1-neg82.2%
unsub-neg82.2%
*-commutative82.2%
Simplified82.2%
if -9e4 < t1 < 7.1000000000000001e-62Initial program 85.5%
distribute-lft-neg-out85.5%
distribute-rgt-neg-in85.5%
associate-*r/81.4%
neg-mul-181.4%
*-commutative81.4%
associate-/l*81.4%
*-rgt-identity81.4%
associate-*r/81.4%
*-inverses81.4%
associate-*r*81.4%
times-frac75.5%
*-commutative75.5%
neg-mul-175.5%
associate-/l*80.5%
associate-/r/81.4%
neg-mul-181.4%
*-commutative81.4%
associate-/r*81.4%
*-inverses81.4%
metadata-eval81.4%
neg-mul-181.4%
distribute-neg-in81.4%
sub-neg81.4%
Simplified81.4%
Taylor expanded in t1 around 0 77.2%
associate-*r/77.2%
neg-mul-177.2%
unpow277.2%
Simplified77.2%
Final simplification79.9%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -90000.0) (not (<= t1 7.2e-62))) (/ v (- (* u -2.0) t1)) (* t1 (/ (/ v (- u)) u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -90000.0) || !(t1 <= 7.2e-62)) {
tmp = v / ((u * -2.0) - 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 <= (-90000.0d0)) .or. (.not. (t1 <= 7.2d-62))) then
tmp = v / ((u * (-2.0d0)) - 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 <= -90000.0) || !(t1 <= 7.2e-62)) {
tmp = v / ((u * -2.0) - t1);
} else {
tmp = t1 * ((v / -u) / u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -90000.0) or not (t1 <= 7.2e-62): tmp = v / ((u * -2.0) - t1) else: tmp = t1 * ((v / -u) / u) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -90000.0) || !(t1 <= 7.2e-62)) tmp = Float64(v / Float64(Float64(u * -2.0) - 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 <= -90000.0) || ~((t1 <= 7.2e-62))) tmp = v / ((u * -2.0) - t1); else tmp = t1 * ((v / -u) / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -90000.0], N[Not[LessEqual[t1, 7.2e-62]], $MachinePrecision]], N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision], N[(t1 * N[(N[(v / (-u)), $MachinePrecision] / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -90000 \lor \neg \left(t1 \leq 7.2 \cdot 10^{-62}\right):\\
\;\;\;\;\frac{v}{u \cdot -2 - t1}\\
\mathbf{else}:\\
\;\;\;\;t1 \cdot \frac{\frac{v}{-u}}{u}\\
\end{array}
\end{array}
if t1 < -9e4 or 7.1999999999999999e-62 < t1 Initial program 60.3%
*-commutative60.3%
times-frac99.9%
neg-mul-199.9%
associate-/l*99.9%
associate-*r/99.9%
associate-/l*99.9%
associate-/l/99.9%
neg-mul-199.9%
*-lft-identity99.9%
metadata-eval99.9%
times-frac99.9%
neg-mul-199.9%
remove-double-neg99.9%
neg-mul-199.9%
sub0-neg99.9%
associate--r+99.9%
neg-sub099.9%
div-sub99.9%
distribute-frac-neg99.9%
*-inverses99.9%
metadata-eval99.9%
Simplified99.9%
expm1-log1p-u90.8%
expm1-udef43.9%
associate-/l/43.9%
Applied egg-rr43.9%
expm1-def86.8%
expm1-log1p95.9%
*-commutative95.9%
Simplified95.9%
Taylor expanded in t1 around inf 82.2%
+-commutative82.2%
mul-1-neg82.2%
unsub-neg82.2%
*-commutative82.2%
Simplified82.2%
if -9e4 < t1 < 7.1999999999999999e-62Initial program 85.5%
*-commutative85.5%
times-frac95.8%
neg-mul-195.8%
associate-/l*95.8%
associate-*r/95.8%
associate-/l*95.8%
associate-/l/95.8%
neg-mul-195.8%
*-lft-identity95.8%
metadata-eval95.8%
times-frac95.8%
neg-mul-195.8%
remove-double-neg95.8%
neg-mul-195.8%
sub0-neg95.8%
associate--r+95.8%
neg-sub095.8%
div-sub95.8%
distribute-frac-neg95.8%
*-inverses95.8%
metadata-eval95.8%
Simplified95.8%
expm1-log1p-u80.7%
expm1-udef57.3%
associate-/l/58.0%
Applied egg-rr58.0%
expm1-def78.2%
expm1-log1p95.7%
*-commutative95.7%
Simplified95.7%
Taylor expanded in t1 around 0 78.7%
mul-1-neg78.7%
unpow278.7%
Simplified78.7%
Taylor expanded in v around 0 77.6%
mul-1-neg77.6%
unpow277.6%
associate-*r/77.2%
distribute-rgt-neg-in77.2%
distribute-frac-neg77.2%
sqr-neg77.2%
associate-/r*83.0%
neg-mul-183.0%
neg-mul-183.0%
times-frac83.0%
metadata-eval83.0%
*-lft-identity83.0%
associate-/r*77.2%
associate-/l/83.0%
Simplified83.0%
Final simplification82.6%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -95000.0) (not (<= t1 1.5e-61))) (/ v (- (* u -2.0) t1)) (* (/ (- t1) u) (/ v u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -95000.0) || !(t1 <= 1.5e-61)) {
tmp = v / ((u * -2.0) - t1);
} else {
tmp = (-t1 / u) * (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 <= (-95000.0d0)) .or. (.not. (t1 <= 1.5d-61))) then
tmp = v / ((u * (-2.0d0)) - t1)
else
tmp = (-t1 / u) * (v / u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -95000.0) || !(t1 <= 1.5e-61)) {
tmp = v / ((u * -2.0) - t1);
} else {
tmp = (-t1 / u) * (v / u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -95000.0) or not (t1 <= 1.5e-61): tmp = v / ((u * -2.0) - t1) else: tmp = (-t1 / u) * (v / u) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -95000.0) || !(t1 <= 1.5e-61)) tmp = Float64(v / Float64(Float64(u * -2.0) - t1)); else tmp = Float64(Float64(Float64(-t1) / u) * Float64(v / u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -95000.0) || ~((t1 <= 1.5e-61))) tmp = v / ((u * -2.0) - t1); else tmp = (-t1 / u) * (v / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -95000.0], N[Not[LessEqual[t1, 1.5e-61]], $MachinePrecision]], N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision], N[(N[((-t1) / u), $MachinePrecision] * N[(v / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -95000 \lor \neg \left(t1 \leq 1.5 \cdot 10^{-61}\right):\\
\;\;\;\;\frac{v}{u \cdot -2 - t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\
\end{array}
\end{array}
if t1 < -95000 or 1.50000000000000006e-61 < t1 Initial program 60.3%
*-commutative60.3%
times-frac99.9%
neg-mul-199.9%
associate-/l*99.9%
associate-*r/99.9%
associate-/l*99.9%
associate-/l/99.9%
neg-mul-199.9%
*-lft-identity99.9%
metadata-eval99.9%
times-frac99.9%
neg-mul-199.9%
remove-double-neg99.9%
neg-mul-199.9%
sub0-neg99.9%
associate--r+99.9%
neg-sub099.9%
div-sub99.9%
distribute-frac-neg99.9%
*-inverses99.9%
metadata-eval99.9%
Simplified99.9%
expm1-log1p-u90.8%
expm1-udef43.9%
associate-/l/43.9%
Applied egg-rr43.9%
expm1-def86.8%
expm1-log1p95.9%
*-commutative95.9%
Simplified95.9%
Taylor expanded in t1 around inf 82.2%
+-commutative82.2%
mul-1-neg82.2%
unsub-neg82.2%
*-commutative82.2%
Simplified82.2%
if -95000 < t1 < 1.50000000000000006e-61Initial program 85.5%
*-commutative85.5%
times-frac95.8%
neg-mul-195.8%
associate-/l*95.8%
associate-*r/95.8%
associate-/l*95.8%
associate-/l/95.8%
neg-mul-195.8%
*-lft-identity95.8%
metadata-eval95.8%
times-frac95.8%
neg-mul-195.8%
remove-double-neg95.8%
neg-mul-195.8%
sub0-neg95.8%
associate--r+95.8%
neg-sub095.8%
div-sub95.8%
distribute-frac-neg95.8%
*-inverses95.8%
metadata-eval95.8%
Simplified95.8%
clear-num95.7%
inv-pow95.7%
Applied egg-rr95.7%
unpow-195.7%
Simplified95.7%
Taylor expanded in t1 around 0 77.6%
*-commutative77.6%
unpow277.6%
times-frac84.9%
associate-*r*84.9%
associate-*r/84.9%
neg-mul-184.9%
Simplified84.9%
Final simplification83.4%
(FPCore (u v t1) :precision binary64 (if (or (<= u -7.6e+129) (not (<= u 2.7e+82))) (* v (/ t1 (* u u))) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -7.6e+129) || !(u <= 2.7e+82)) {
tmp = v * (t1 / (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 <= (-7.6d+129)) .or. (.not. (u <= 2.7d+82))) then
tmp = v * (t1 / (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 <= -7.6e+129) || !(u <= 2.7e+82)) {
tmp = v * (t1 / (u * u));
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -7.6e+129) or not (u <= 2.7e+82): tmp = v * (t1 / (u * u)) else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -7.6e+129) || !(u <= 2.7e+82)) tmp = Float64(v * Float64(t1 / 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 <= -7.6e+129) || ~((u <= 2.7e+82))) tmp = v * (t1 / (u * u)); else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -7.6e+129], N[Not[LessEqual[u, 2.7e+82]], $MachinePrecision]], N[(v * N[(t1 / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -7.6 \cdot 10^{+129} \lor \neg \left(u \leq 2.7 \cdot 10^{+82}\right):\\
\;\;\;\;v \cdot \frac{t1}{u \cdot u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -7.60000000000000011e129 or 2.6999999999999999e82 < u Initial program 80.6%
distribute-lft-neg-out80.6%
distribute-rgt-neg-in80.6%
associate-*r/79.1%
neg-mul-179.1%
*-commutative79.1%
associate-/l*79.1%
*-rgt-identity79.1%
associate-*r/79.1%
*-inverses79.1%
associate-*r*79.1%
times-frac79.1%
*-commutative79.1%
neg-mul-179.1%
associate-/l*79.1%
associate-/r/79.1%
neg-mul-179.1%
*-commutative79.1%
associate-/r*79.1%
*-inverses79.1%
metadata-eval79.1%
neg-mul-179.1%
distribute-neg-in79.1%
sub-neg79.1%
Simplified79.1%
Taylor expanded in t1 around 0 78.0%
associate-*r/78.0%
neg-mul-178.0%
unpow278.0%
Simplified78.0%
*-commutative78.0%
associate-*l/79.2%
add-sqr-sqrt43.0%
sqrt-unprod68.3%
sqr-neg68.3%
sqrt-unprod33.9%
add-sqr-sqrt72.7%
Applied egg-rr72.7%
*-commutative72.7%
associate-/l*73.1%
add-sqr-sqrt34.1%
sqrt-unprod65.0%
sqr-neg65.0%
sqrt-unprod42.3%
add-sqr-sqrt77.7%
associate-/r/77.3%
add-sqr-sqrt41.9%
sqrt-unprod66.8%
sqr-neg66.8%
sqrt-unprod34.1%
add-sqr-sqrt73.1%
Applied egg-rr73.1%
if -7.60000000000000011e129 < u < 2.6999999999999999e82Initial program 67.2%
times-frac97.2%
Simplified97.2%
Taylor expanded in t1 around inf 68.6%
associate-*r/68.6%
neg-mul-168.6%
Simplified68.6%
Final simplification70.1%
(FPCore (u v t1) :precision binary64 (if (or (<= u -1.4e+99) (not (<= u 3.8e+85))) (/ t1 (/ (* u u) v)) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -1.4e+99) || !(u <= 3.8e+85)) {
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.4d+99)) .or. (.not. (u <= 3.8d+85))) 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.4e+99) || !(u <= 3.8e+85)) {
tmp = t1 / ((u * u) / v);
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -1.4e+99) or not (u <= 3.8e+85): tmp = t1 / ((u * u) / v) else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -1.4e+99) || !(u <= 3.8e+85)) tmp = Float64(t1 / Float64(Float64(u * u) / v)); else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -1.4e+99) || ~((u <= 3.8e+85))) tmp = t1 / ((u * u) / v); else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -1.4e+99], N[Not[LessEqual[u, 3.8e+85]], $MachinePrecision]], N[(t1 / N[(N[(u * u), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.4 \cdot 10^{+99} \lor \neg \left(u \leq 3.8 \cdot 10^{+85}\right):\\
\;\;\;\;\frac{t1}{\frac{u \cdot u}{v}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -1.4e99 or 3.79999999999999992e85 < u Initial program 80.1%
distribute-lft-neg-out80.1%
distribute-rgt-neg-in80.1%
associate-*r/79.8%
neg-mul-179.8%
*-commutative79.8%
associate-/l*79.8%
*-rgt-identity79.8%
associate-*r/79.8%
*-inverses79.8%
associate-*r*79.8%
times-frac79.8%
*-commutative79.8%
neg-mul-179.8%
associate-/l*78.8%
associate-/r/79.8%
neg-mul-179.8%
*-commutative79.8%
associate-/r*79.8%
*-inverses79.8%
metadata-eval79.8%
neg-mul-179.8%
distribute-neg-in79.8%
sub-neg79.8%
Simplified79.8%
Taylor expanded in t1 around 0 77.1%
associate-*r/77.1%
neg-mul-177.1%
unpow277.1%
Simplified77.1%
clear-num77.7%
un-div-inv77.7%
add-sqr-sqrt42.8%
sqrt-unprod67.5%
sqr-neg67.5%
sqrt-unprod32.4%
add-sqr-sqrt71.2%
Applied egg-rr71.2%
if -1.4e99 < u < 3.79999999999999992e85Initial program 66.5%
times-frac97.6%
Simplified97.6%
Taylor expanded in t1 around inf 69.9%
associate-*r/69.9%
neg-mul-169.9%
Simplified69.9%
Final simplification70.4%
(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 71.6%
*-commutative71.6%
times-frac98.1%
neg-mul-198.1%
associate-/l*98.1%
associate-*r/98.1%
associate-/l*98.1%
associate-/l/98.1%
neg-mul-198.1%
*-lft-identity98.1%
metadata-eval98.1%
times-frac98.1%
neg-mul-198.1%
remove-double-neg98.1%
neg-mul-198.1%
sub0-neg98.1%
associate--r+98.1%
neg-sub098.1%
div-sub98.1%
distribute-frac-neg98.1%
*-inverses98.1%
metadata-eval98.1%
Simplified98.1%
Final simplification98.1%
(FPCore (u v t1) :precision binary64 (if (or (<= u -4.5e+242) (not (<= u 4.7e+85))) (* -0.5 (/ v u)) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -4.5e+242) || !(u <= 4.7e+85)) {
tmp = -0.5 * (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.5d+242)) .or. (.not. (u <= 4.7d+85))) then
tmp = (-0.5d0) * (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.5e+242) || !(u <= 4.7e+85)) {
tmp = -0.5 * (v / u);
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -4.5e+242) or not (u <= 4.7e+85): tmp = -0.5 * (v / u) else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -4.5e+242) || !(u <= 4.7e+85)) tmp = Float64(-0.5 * 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 <= -4.5e+242) || ~((u <= 4.7e+85))) tmp = -0.5 * (v / u); else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -4.5e+242], N[Not[LessEqual[u, 4.7e+85]], $MachinePrecision]], N[(-0.5 * N[(v / u), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -4.5 \cdot 10^{+242} \lor \neg \left(u \leq 4.7 \cdot 10^{+85}\right):\\
\;\;\;\;-0.5 \cdot \frac{v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -4.4999999999999996e242 or 4.7000000000000002e85 < u Initial program 85.6%
*-commutative85.6%
times-frac99.8%
neg-mul-199.8%
associate-/l*99.9%
associate-*r/99.9%
associate-/l*99.9%
associate-/l/99.9%
neg-mul-199.9%
*-lft-identity99.9%
metadata-eval99.9%
times-frac99.9%
neg-mul-199.9%
remove-double-neg99.9%
neg-mul-199.9%
sub0-neg99.9%
associate--r+99.9%
neg-sub099.9%
div-sub99.9%
distribute-frac-neg99.9%
*-inverses99.9%
metadata-eval99.9%
Simplified99.9%
expm1-log1p-u99.9%
expm1-udef76.8%
associate-/l/76.8%
Applied egg-rr76.8%
expm1-def89.2%
expm1-log1p89.2%
*-commutative89.2%
Simplified89.2%
Taylor expanded in t1 around inf 39.3%
+-commutative39.3%
mul-1-neg39.3%
unsub-neg39.3%
*-commutative39.3%
Simplified39.3%
Taylor expanded in u around inf 35.0%
if -4.4999999999999996e242 < u < 4.7000000000000002e85Initial program 67.3%
times-frac97.5%
Simplified97.5%
Taylor expanded in t1 around inf 64.2%
associate-*r/64.2%
neg-mul-164.2%
Simplified64.2%
Final simplification57.2%
(FPCore (u v t1) :precision binary64 (if (or (<= u -2.9e+243) (not (<= u 4.7e+85))) (/ (- v) u) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -2.9e+243) || !(u <= 4.7e+85)) {
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.9d+243)) .or. (.not. (u <= 4.7d+85))) 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.9e+243) || !(u <= 4.7e+85)) {
tmp = -v / u;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -2.9e+243) or not (u <= 4.7e+85): tmp = -v / u else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -2.9e+243) || !(u <= 4.7e+85)) 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.9e+243) || ~((u <= 4.7e+85))) tmp = -v / u; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -2.9e+243], N[Not[LessEqual[u, 4.7e+85]], $MachinePrecision]], N[((-v) / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.9 \cdot 10^{+243} \lor \neg \left(u \leq 4.7 \cdot 10^{+85}\right):\\
\;\;\;\;\frac{-v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -2.90000000000000006e243 or 4.7000000000000002e85 < u Initial program 85.6%
*-commutative85.6%
times-frac99.8%
neg-mul-199.8%
associate-/l*99.9%
associate-*r/99.9%
associate-/l*99.9%
associate-/l/99.9%
neg-mul-199.9%
*-lft-identity99.9%
metadata-eval99.9%
times-frac99.9%
neg-mul-199.9%
remove-double-neg99.9%
neg-mul-199.9%
sub0-neg99.9%
associate--r+99.9%
neg-sub099.9%
div-sub99.9%
distribute-frac-neg99.9%
*-inverses99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in t1 around 0 94.5%
Taylor expanded in u around 0 35.0%
associate-*r/35.0%
neg-mul-135.0%
Simplified35.0%
if -2.90000000000000006e243 < u < 4.7000000000000002e85Initial program 67.3%
times-frac97.5%
Simplified97.5%
Taylor expanded in t1 around inf 64.2%
associate-*r/64.2%
neg-mul-164.2%
Simplified64.2%
Final simplification57.2%
(FPCore (u v t1) :precision binary64 (/ (- v) (+ t1 u)))
double code(double u, double v, double t1) {
return -v / (t1 + u);
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = -v / (t1 + u)
end function
public static double code(double u, double v, double t1) {
return -v / (t1 + u);
}
def code(u, v, t1): return -v / (t1 + u)
function code(u, v, t1) return Float64(Float64(-v) / Float64(t1 + u)) end
function tmp = code(u, v, t1) tmp = -v / (t1 + u); end
code[u_, v_, t1_] := N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-v}{t1 + u}
\end{array}
Initial program 71.6%
times-frac98.1%
Simplified98.1%
Taylor expanded in t1 around inf 59.5%
Final simplification59.5%
(FPCore (u v t1) :precision binary64 (/ (- v) t1))
double code(double u, double v, double t1) {
return -v / t1;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = -v / t1
end function
public static double code(double u, double v, double t1) {
return -v / t1;
}
def code(u, v, t1): return -v / t1
function code(u, v, t1) return Float64(Float64(-v) / t1) end
function tmp = code(u, v, t1) tmp = -v / t1; end
code[u_, v_, t1_] := N[((-v) / t1), $MachinePrecision]
\begin{array}{l}
\\
\frac{-v}{t1}
\end{array}
Initial program 71.6%
times-frac98.1%
Simplified98.1%
Taylor expanded in t1 around inf 51.6%
associate-*r/51.6%
neg-mul-151.6%
Simplified51.6%
Final simplification51.6%
herbie shell --seed 2023171
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))