
(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 13 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 74.0%
associate-*l/75.1%
*-commutative75.1%
Simplified75.1%
associate-*r/74.0%
times-frac97.9%
*-commutative97.9%
frac-2neg97.9%
+-commutative97.9%
distribute-neg-in97.9%
sub-neg97.9%
associate-*r/98.5%
add-sqr-sqrt50.3%
sqrt-unprod42.9%
sqr-neg42.9%
sqrt-unprod20.1%
add-sqr-sqrt38.4%
sub-neg38.4%
+-commutative38.4%
add-sqr-sqrt18.3%
sqrt-unprod49.9%
sqr-neg49.9%
sqrt-unprod36.4%
add-sqr-sqrt19.9%
sqrt-unprod39.9%
sqr-neg39.9%
sqrt-unprod22.9%
Applied egg-rr98.5%
Final simplification98.5%
(FPCore (u v t1)
:precision binary64
(if (<= t1 -6e+43)
(/ (- v) (+ t1 u))
(if (<= t1 7.5e+40)
(/ (/ (/ t1 u) (/ -1.0 v)) u)
(* (/ (- t1) (+ t1 u)) (/ v t1)))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -6e+43) {
tmp = -v / (t1 + u);
} else if (t1 <= 7.5e+40) {
tmp = ((t1 / u) / (-1.0 / v)) / u;
} else {
tmp = (-t1 / (t1 + u)) * (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 (t1 <= (-6d+43)) then
tmp = -v / (t1 + u)
else if (t1 <= 7.5d+40) then
tmp = ((t1 / u) / ((-1.0d0) / v)) / u
else
tmp = (-t1 / (t1 + u)) * (v / t1)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (t1 <= -6e+43) {
tmp = -v / (t1 + u);
} else if (t1 <= 7.5e+40) {
tmp = ((t1 / u) / (-1.0 / v)) / u;
} else {
tmp = (-t1 / (t1 + u)) * (v / t1);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if t1 <= -6e+43: tmp = -v / (t1 + u) elif t1 <= 7.5e+40: tmp = ((t1 / u) / (-1.0 / v)) / u else: tmp = (-t1 / (t1 + u)) * (v / t1) return tmp
function code(u, v, t1) tmp = 0.0 if (t1 <= -6e+43) tmp = Float64(Float64(-v) / Float64(t1 + u)); elseif (t1 <= 7.5e+40) tmp = Float64(Float64(Float64(t1 / u) / Float64(-1.0 / v)) / u); else tmp = Float64(Float64(Float64(-t1) / Float64(t1 + u)) * Float64(v / t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (t1 <= -6e+43) tmp = -v / (t1 + u); elseif (t1 <= 7.5e+40) tmp = ((t1 / u) / (-1.0 / v)) / u; else tmp = (-t1 / (t1 + u)) * (v / t1); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[t1, -6e+43], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 7.5e+40], N[(N[(N[(t1 / u), $MachinePrecision] / N[(-1.0 / v), $MachinePrecision]), $MachinePrecision] / u), $MachinePrecision], N[(N[((-t1) / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(v / t1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -6 \cdot 10^{+43}:\\
\;\;\;\;\frac{-v}{t1 + u}\\
\mathbf{elif}\;t1 \leq 7.5 \cdot 10^{+40}:\\
\;\;\;\;\frac{\frac{\frac{t1}{u}}{\frac{-1}{v}}}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-t1}{t1 + u} \cdot \frac{v}{t1}\\
\end{array}
\end{array}
if t1 < -6.00000000000000033e43Initial program 51.9%
associate-*l/56.3%
*-commutative56.3%
Simplified56.3%
associate-*r/51.9%
times-frac99.9%
*-commutative99.9%
frac-2neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
sub-neg99.9%
associate-*r/99.9%
add-sqr-sqrt99.3%
sqrt-unprod40.2%
sqr-neg40.2%
sqrt-unprod0.0%
add-sqr-sqrt24.1%
sub-neg24.1%
+-commutative24.1%
add-sqr-sqrt24.1%
sqrt-unprod24.8%
sqr-neg24.8%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
Applied egg-rr99.9%
Taylor expanded in t1 around inf 90.2%
mul-1-neg90.2%
Simplified90.2%
if -6.00000000000000033e43 < t1 < 7.4999999999999996e40Initial program 85.2%
times-frac96.3%
distribute-frac-neg96.3%
distribute-neg-frac296.3%
+-commutative96.3%
distribute-neg-in96.3%
unsub-neg96.3%
Simplified96.3%
Taylor expanded in t1 around 0 75.5%
Taylor expanded in t1 around 0 78.0%
associate-*r/78.0%
mul-1-neg78.0%
Simplified78.0%
distribute-frac-neg78.0%
distribute-frac-neg278.0%
associate-*l/78.9%
add-sqr-sqrt39.6%
sqrt-unprod56.1%
sqr-neg56.1%
sqrt-unprod19.0%
add-sqr-sqrt40.1%
Applied egg-rr40.1%
clear-num40.1%
un-div-inv40.1%
add-sqr-sqrt17.8%
sqrt-unprod48.1%
sqr-neg48.1%
sqrt-unprod42.4%
add-sqr-sqrt79.1%
div-inv79.1%
associate-/r*79.2%
add-sqr-sqrt42.5%
sqrt-unprod48.8%
sqr-neg48.8%
sqrt-unprod17.8%
add-sqr-sqrt40.2%
frac-2neg40.2%
metadata-eval40.2%
add-sqr-sqrt17.0%
sqrt-unprod48.0%
sqr-neg48.0%
sqrt-unprod41.9%
add-sqr-sqrt79.2%
Applied egg-rr79.2%
if 7.4999999999999996e40 < t1 Initial program 65.7%
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 89.0%
Final simplification83.6%
(FPCore (u v t1)
:precision binary64
(if (<= t1 -1.8e+43)
(* (+ -1.0 (/ u t1)) (/ v (+ t1 u)))
(if (<= t1 3.35e+38)
(/ (/ (/ t1 u) (/ -1.0 v)) u)
(* (/ (- t1) (+ t1 u)) (/ v t1)))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -1.8e+43) {
tmp = (-1.0 + (u / t1)) * (v / (t1 + u));
} else if (t1 <= 3.35e+38) {
tmp = ((t1 / u) / (-1.0 / v)) / u;
} else {
tmp = (-t1 / (t1 + u)) * (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 (t1 <= (-1.8d+43)) then
tmp = ((-1.0d0) + (u / t1)) * (v / (t1 + u))
else if (t1 <= 3.35d+38) then
tmp = ((t1 / u) / ((-1.0d0) / v)) / u
else
tmp = (-t1 / (t1 + u)) * (v / t1)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (t1 <= -1.8e+43) {
tmp = (-1.0 + (u / t1)) * (v / (t1 + u));
} else if (t1 <= 3.35e+38) {
tmp = ((t1 / u) / (-1.0 / v)) / u;
} else {
tmp = (-t1 / (t1 + u)) * (v / t1);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if t1 <= -1.8e+43: tmp = (-1.0 + (u / t1)) * (v / (t1 + u)) elif t1 <= 3.35e+38: tmp = ((t1 / u) / (-1.0 / v)) / u else: tmp = (-t1 / (t1 + u)) * (v / t1) return tmp
function code(u, v, t1) tmp = 0.0 if (t1 <= -1.8e+43) tmp = Float64(Float64(-1.0 + Float64(u / t1)) * Float64(v / Float64(t1 + u))); elseif (t1 <= 3.35e+38) tmp = Float64(Float64(Float64(t1 / u) / Float64(-1.0 / v)) / u); else tmp = Float64(Float64(Float64(-t1) / Float64(t1 + u)) * Float64(v / t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (t1 <= -1.8e+43) tmp = (-1.0 + (u / t1)) * (v / (t1 + u)); elseif (t1 <= 3.35e+38) tmp = ((t1 / u) / (-1.0 / v)) / u; else tmp = (-t1 / (t1 + u)) * (v / t1); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[t1, -1.8e+43], N[(N[(-1.0 + N[(u / t1), $MachinePrecision]), $MachinePrecision] * N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 3.35e+38], N[(N[(N[(t1 / u), $MachinePrecision] / N[(-1.0 / v), $MachinePrecision]), $MachinePrecision] / u), $MachinePrecision], N[(N[((-t1) / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(v / t1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.8 \cdot 10^{+43}:\\
\;\;\;\;\left(-1 + \frac{u}{t1}\right) \cdot \frac{v}{t1 + u}\\
\mathbf{elif}\;t1 \leq 3.35 \cdot 10^{+38}:\\
\;\;\;\;\frac{\frac{\frac{t1}{u}}{\frac{-1}{v}}}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-t1}{t1 + u} \cdot \frac{v}{t1}\\
\end{array}
\end{array}
if t1 < -1.80000000000000005e43Initial program 51.9%
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 90.4%
if -1.80000000000000005e43 < t1 < 3.35000000000000012e38Initial program 85.2%
times-frac96.3%
distribute-frac-neg96.3%
distribute-neg-frac296.3%
+-commutative96.3%
distribute-neg-in96.3%
unsub-neg96.3%
Simplified96.3%
Taylor expanded in t1 around 0 75.5%
Taylor expanded in t1 around 0 78.0%
associate-*r/78.0%
mul-1-neg78.0%
Simplified78.0%
distribute-frac-neg78.0%
distribute-frac-neg278.0%
associate-*l/78.9%
add-sqr-sqrt39.6%
sqrt-unprod56.1%
sqr-neg56.1%
sqrt-unprod19.0%
add-sqr-sqrt40.1%
Applied egg-rr40.1%
clear-num40.1%
un-div-inv40.1%
add-sqr-sqrt17.8%
sqrt-unprod48.1%
sqr-neg48.1%
sqrt-unprod42.4%
add-sqr-sqrt79.1%
div-inv79.1%
associate-/r*79.2%
add-sqr-sqrt42.5%
sqrt-unprod48.8%
sqr-neg48.8%
sqrt-unprod17.8%
add-sqr-sqrt40.2%
frac-2neg40.2%
metadata-eval40.2%
add-sqr-sqrt17.0%
sqrt-unprod48.0%
sqr-neg48.0%
sqrt-unprod41.9%
add-sqr-sqrt79.2%
Applied egg-rr79.2%
if 3.35000000000000012e38 < t1 Initial program 65.7%
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 89.0%
Final simplification83.7%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -1.8e+43) (not (<= t1 2.4e+41))) (/ (- v) (+ t1 u)) (/ (/ (/ t1 u) (/ -1.0 v)) u)))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.8e+43) || !(t1 <= 2.4e+41)) {
tmp = -v / (t1 + u);
} else {
tmp = ((t1 / u) / (-1.0 / 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 <= (-1.8d+43)) .or. (.not. (t1 <= 2.4d+41))) then
tmp = -v / (t1 + u)
else
tmp = ((t1 / u) / ((-1.0d0) / v)) / u
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.8e+43) || !(t1 <= 2.4e+41)) {
tmp = -v / (t1 + u);
} else {
tmp = ((t1 / u) / (-1.0 / v)) / u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -1.8e+43) or not (t1 <= 2.4e+41): tmp = -v / (t1 + u) else: tmp = ((t1 / u) / (-1.0 / v)) / u return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -1.8e+43) || !(t1 <= 2.4e+41)) tmp = Float64(Float64(-v) / Float64(t1 + u)); else tmp = Float64(Float64(Float64(t1 / u) / Float64(-1.0 / v)) / u); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -1.8e+43) || ~((t1 <= 2.4e+41))) tmp = -v / (t1 + u); else tmp = ((t1 / u) / (-1.0 / v)) / u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -1.8e+43], N[Not[LessEqual[t1, 2.4e+41]], $MachinePrecision]], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t1 / u), $MachinePrecision] / N[(-1.0 / v), $MachinePrecision]), $MachinePrecision] / u), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.8 \cdot 10^{+43} \lor \neg \left(t1 \leq 2.4 \cdot 10^{+41}\right):\\
\;\;\;\;\frac{-v}{t1 + u}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{t1}{u}}{\frac{-1}{v}}}{u}\\
\end{array}
\end{array}
if t1 < -1.80000000000000005e43 or 2.4000000000000002e41 < t1 Initial program 58.8%
associate-*l/64.7%
*-commutative64.7%
Simplified64.7%
associate-*r/58.8%
times-frac99.9%
*-commutative99.9%
frac-2neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
sub-neg99.9%
associate-*r/99.9%
add-sqr-sqrt49.2%
sqrt-unprod25.1%
sqr-neg25.1%
sqrt-unprod23.1%
add-sqr-sqrt35.0%
sub-neg35.0%
+-commutative35.0%
add-sqr-sqrt11.9%
sqrt-unprod47.9%
sqr-neg47.9%
sqrt-unprod45.3%
add-sqr-sqrt18.7%
sqrt-unprod44.5%
sqr-neg44.5%
sqrt-unprod31.0%
Applied egg-rr99.9%
Taylor expanded in t1 around inf 89.6%
mul-1-neg89.6%
Simplified89.6%
if -1.80000000000000005e43 < t1 < 2.4000000000000002e41Initial program 85.2%
times-frac96.3%
distribute-frac-neg96.3%
distribute-neg-frac296.3%
+-commutative96.3%
distribute-neg-in96.3%
unsub-neg96.3%
Simplified96.3%
Taylor expanded in t1 around 0 75.5%
Taylor expanded in t1 around 0 78.0%
associate-*r/78.0%
mul-1-neg78.0%
Simplified78.0%
distribute-frac-neg78.0%
distribute-frac-neg278.0%
associate-*l/78.9%
add-sqr-sqrt39.6%
sqrt-unprod56.1%
sqr-neg56.1%
sqrt-unprod19.0%
add-sqr-sqrt40.1%
Applied egg-rr40.1%
clear-num40.1%
un-div-inv40.1%
add-sqr-sqrt17.8%
sqrt-unprod48.1%
sqr-neg48.1%
sqrt-unprod42.4%
add-sqr-sqrt79.1%
div-inv79.1%
associate-/r*79.2%
add-sqr-sqrt42.5%
sqrt-unprod48.8%
sqr-neg48.8%
sqrt-unprod17.8%
add-sqr-sqrt40.2%
frac-2neg40.2%
metadata-eval40.2%
add-sqr-sqrt17.0%
sqrt-unprod48.0%
sqr-neg48.0%
sqrt-unprod41.9%
add-sqr-sqrt79.2%
Applied egg-rr79.2%
Final simplification83.6%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -3.3e+43) (not (<= t1 9.5e+38))) (/ (- v) (+ t1 u)) (* (/ t1 u) (/ (- v) u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -3.3e+43) || !(t1 <= 9.5e+38)) {
tmp = -v / (t1 + u);
} 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 <= (-3.3d+43)) .or. (.not. (t1 <= 9.5d+38))) then
tmp = -v / (t1 + u)
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 <= -3.3e+43) || !(t1 <= 9.5e+38)) {
tmp = -v / (t1 + u);
} else {
tmp = (t1 / u) * (-v / u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -3.3e+43) or not (t1 <= 9.5e+38): tmp = -v / (t1 + u) else: tmp = (t1 / u) * (-v / u) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -3.3e+43) || !(t1 <= 9.5e+38)) tmp = Float64(Float64(-v) / Float64(t1 + u)); else tmp = Float64(Float64(t1 / u) * Float64(Float64(-v) / u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -3.3e+43) || ~((t1 <= 9.5e+38))) tmp = -v / (t1 + u); else tmp = (t1 / u) * (-v / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -3.3e+43], N[Not[LessEqual[t1, 9.5e+38]], $MachinePrecision]], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], N[(N[(t1 / u), $MachinePrecision] * N[((-v) / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -3.3 \cdot 10^{+43} \lor \neg \left(t1 \leq 9.5 \cdot 10^{+38}\right):\\
\;\;\;\;\frac{-v}{t1 + u}\\
\mathbf{else}:\\
\;\;\;\;\frac{t1}{u} \cdot \frac{-v}{u}\\
\end{array}
\end{array}
if t1 < -3.3000000000000001e43 or 9.4999999999999995e38 < t1 Initial program 58.8%
associate-*l/64.7%
*-commutative64.7%
Simplified64.7%
associate-*r/58.8%
times-frac99.9%
*-commutative99.9%
frac-2neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
sub-neg99.9%
associate-*r/99.9%
add-sqr-sqrt49.2%
sqrt-unprod25.1%
sqr-neg25.1%
sqrt-unprod23.1%
add-sqr-sqrt35.0%
sub-neg35.0%
+-commutative35.0%
add-sqr-sqrt11.9%
sqrt-unprod47.9%
sqr-neg47.9%
sqrt-unprod45.3%
add-sqr-sqrt18.7%
sqrt-unprod44.5%
sqr-neg44.5%
sqrt-unprod31.0%
Applied egg-rr99.9%
Taylor expanded in t1 around inf 89.6%
mul-1-neg89.6%
Simplified89.6%
if -3.3000000000000001e43 < t1 < 9.4999999999999995e38Initial program 85.2%
times-frac96.3%
distribute-frac-neg96.3%
distribute-neg-frac296.3%
+-commutative96.3%
distribute-neg-in96.3%
unsub-neg96.3%
Simplified96.3%
Taylor expanded in t1 around 0 75.5%
Taylor expanded in t1 around 0 78.0%
associate-*r/78.0%
mul-1-neg78.0%
Simplified78.0%
Final simplification83.0%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -5.2e+43) (not (<= t1 6e+38))) (/ (- v) (+ t1 u)) (/ (* t1 (/ v u)) (- u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -5.2e+43) || !(t1 <= 6e+38)) {
tmp = -v / (t1 + u);
} else {
tmp = (t1 * (v / u)) / -u;
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if ((t1 <= (-5.2d+43)) .or. (.not. (t1 <= 6d+38))) then
tmp = -v / (t1 + u)
else
tmp = (t1 * (v / u)) / -u
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -5.2e+43) || !(t1 <= 6e+38)) {
tmp = -v / (t1 + u);
} else {
tmp = (t1 * (v / u)) / -u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -5.2e+43) or not (t1 <= 6e+38): tmp = -v / (t1 + u) else: tmp = (t1 * (v / u)) / -u return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -5.2e+43) || !(t1 <= 6e+38)) tmp = Float64(Float64(-v) / Float64(t1 + u)); else tmp = Float64(Float64(t1 * Float64(v / u)) / Float64(-u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -5.2e+43) || ~((t1 <= 6e+38))) tmp = -v / (t1 + u); else tmp = (t1 * (v / u)) / -u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -5.2e+43], N[Not[LessEqual[t1, 6e+38]], $MachinePrecision]], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], N[(N[(t1 * N[(v / u), $MachinePrecision]), $MachinePrecision] / (-u)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -5.2 \cdot 10^{+43} \lor \neg \left(t1 \leq 6 \cdot 10^{+38}\right):\\
\;\;\;\;\frac{-v}{t1 + u}\\
\mathbf{else}:\\
\;\;\;\;\frac{t1 \cdot \frac{v}{u}}{-u}\\
\end{array}
\end{array}
if t1 < -5.20000000000000042e43 or 6.0000000000000002e38 < t1 Initial program 58.8%
associate-*l/64.7%
*-commutative64.7%
Simplified64.7%
associate-*r/58.8%
times-frac99.9%
*-commutative99.9%
frac-2neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
sub-neg99.9%
associate-*r/99.9%
add-sqr-sqrt49.2%
sqrt-unprod25.1%
sqr-neg25.1%
sqrt-unprod23.1%
add-sqr-sqrt35.0%
sub-neg35.0%
+-commutative35.0%
add-sqr-sqrt11.9%
sqrt-unprod47.9%
sqr-neg47.9%
sqrt-unprod45.3%
add-sqr-sqrt18.7%
sqrt-unprod44.5%
sqr-neg44.5%
sqrt-unprod31.0%
Applied egg-rr99.9%
Taylor expanded in t1 around inf 89.6%
mul-1-neg89.6%
Simplified89.6%
if -5.20000000000000042e43 < t1 < 6.0000000000000002e38Initial program 85.2%
times-frac96.3%
distribute-frac-neg96.3%
distribute-neg-frac296.3%
+-commutative96.3%
distribute-neg-in96.3%
unsub-neg96.3%
Simplified96.3%
Taylor expanded in t1 around 0 75.5%
Taylor expanded in t1 around 0 78.0%
associate-*r/78.0%
mul-1-neg78.0%
Simplified78.0%
distribute-frac-neg78.0%
distribute-frac-neg278.0%
associate-*l/78.9%
add-sqr-sqrt39.6%
sqrt-unprod56.1%
sqr-neg56.1%
sqrt-unprod19.0%
add-sqr-sqrt40.1%
Applied egg-rr40.1%
add-sqr-sqrt17.8%
sqrt-unprod48.1%
sqr-neg48.1%
sqrt-unprod42.3%
add-sqr-sqrt78.9%
distribute-lft-neg-in78.9%
Applied egg-rr78.9%
Final simplification83.5%
(FPCore (u v t1) :precision binary64 (if (or (<= u -4.2e+64) (not (<= u 1e+138))) (/ v (* u (/ u t1))) (/ (- v) (+ t1 u))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -4.2e+64) || !(u <= 1e+138)) {
tmp = v / (u * (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) :: tmp
if ((u <= (-4.2d+64)) .or. (.not. (u <= 1d+138))) then
tmp = v / (u * (u / t1))
else
tmp = -v / (t1 + u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((u <= -4.2e+64) || !(u <= 1e+138)) {
tmp = v / (u * (u / t1));
} else {
tmp = -v / (t1 + u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -4.2e+64) or not (u <= 1e+138): tmp = v / (u * (u / t1)) else: tmp = -v / (t1 + u) return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -4.2e+64) || !(u <= 1e+138)) tmp = Float64(v / Float64(u * Float64(u / t1))); else tmp = Float64(Float64(-v) / Float64(t1 + u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -4.2e+64) || ~((u <= 1e+138))) tmp = v / (u * (u / t1)); else tmp = -v / (t1 + u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -4.2e+64], N[Not[LessEqual[u, 1e+138]], $MachinePrecision]], N[(v / N[(u * N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -4.2 \cdot 10^{+64} \lor \neg \left(u \leq 10^{+138}\right):\\
\;\;\;\;\frac{v}{u \cdot \frac{u}{t1}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1 + u}\\
\end{array}
\end{array}
if u < -4.2000000000000001e64 or 1e138 < u Initial program 78.6%
times-frac97.4%
distribute-frac-neg97.4%
distribute-neg-frac297.4%
+-commutative97.4%
distribute-neg-in97.4%
unsub-neg97.4%
Simplified97.4%
Taylor expanded in t1 around 0 84.6%
Taylor expanded in t1 around 0 84.2%
associate-*r/84.2%
mul-1-neg84.2%
Simplified84.2%
clear-num83.7%
frac-times74.1%
*-un-lft-identity74.1%
add-sqr-sqrt38.2%
sqrt-unprod61.9%
sqr-neg61.9%
sqrt-unprod30.9%
add-sqr-sqrt63.6%
Applied egg-rr63.6%
if -4.2000000000000001e64 < u < 1e138Initial program 71.2%
associate-*l/76.3%
*-commutative76.3%
Simplified76.3%
associate-*r/71.2%
times-frac98.1%
*-commutative98.1%
frac-2neg98.1%
+-commutative98.1%
distribute-neg-in98.1%
sub-neg98.1%
associate-*r/99.2%
add-sqr-sqrt50.8%
sqrt-unprod30.1%
sqr-neg30.1%
sqrt-unprod12.7%
add-sqr-sqrt22.1%
sub-neg22.1%
+-commutative22.1%
add-sqr-sqrt9.4%
sqrt-unprod40.1%
sqr-neg40.1%
sqrt-unprod36.7%
add-sqr-sqrt18.1%
sqrt-unprod43.3%
sqr-neg43.3%
sqrt-unprod25.2%
Applied egg-rr99.2%
Taylor expanded in t1 around inf 69.7%
mul-1-neg69.7%
Simplified69.7%
Final simplification67.5%
(FPCore (u v t1) :precision binary64 (/ (/ v (- -1.0 (/ u t1))) (+ t1 u)))
double code(double u, double v, double t1) {
return (v / (-1.0 - (u / t1))) / (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 / ((-1.0d0) - (u / t1))) / (t1 + u)
end function
public static double code(double u, double v, double t1) {
return (v / (-1.0 - (u / t1))) / (t1 + u);
}
def code(u, v, t1): return (v / (-1.0 - (u / t1))) / (t1 + u)
function code(u, v, t1) return Float64(Float64(v / Float64(-1.0 - Float64(u / t1))) / Float64(t1 + u)) end
function tmp = code(u, v, t1) tmp = (v / (-1.0 - (u / t1))) / (t1 + u); end
code[u_, v_, t1_] := N[(N[(v / N[(-1.0 - N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{v}{-1 - \frac{u}{t1}}}{t1 + u}
\end{array}
Initial program 74.0%
associate-*l/75.1%
*-commutative75.1%
Simplified75.1%
associate-*r/74.0%
times-frac97.9%
*-commutative97.9%
frac-2neg97.9%
+-commutative97.9%
distribute-neg-in97.9%
sub-neg97.9%
associate-*r/98.5%
add-sqr-sqrt50.3%
sqrt-unprod42.9%
sqr-neg42.9%
sqrt-unprod20.1%
add-sqr-sqrt38.4%
sub-neg38.4%
+-commutative38.4%
add-sqr-sqrt18.3%
sqrt-unprod49.9%
sqr-neg49.9%
sqrt-unprod36.4%
add-sqr-sqrt19.9%
sqrt-unprod39.9%
sqr-neg39.9%
sqrt-unprod22.9%
Applied egg-rr98.5%
clear-num98.3%
inv-pow98.3%
Applied egg-rr98.3%
unpow-198.3%
Simplified98.3%
Taylor expanded in v around 0 84.0%
mul-1-neg84.0%
associate-*r/98.4%
*-commutative98.4%
associate-/r/98.4%
distribute-neg-frac298.4%
neg-sub098.4%
*-lft-identity98.4%
associate-*l/98.3%
distribute-lft-in98.3%
lft-mult-inverse98.4%
associate--r+98.4%
metadata-eval98.4%
associate-*l/98.4%
*-lft-identity98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (u v t1) :precision binary64 (if (<= v 1.45e-197) (/ v (+ t1 u)) (/ v (- t1))))
double code(double u, double v, double t1) {
double tmp;
if (v <= 1.45e-197) {
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 <= 1.45d-197) 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 <= 1.45e-197) {
tmp = v / (t1 + u);
} else {
tmp = v / -t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if v <= 1.45e-197: tmp = v / (t1 + u) else: tmp = v / -t1 return tmp
function code(u, v, t1) tmp = 0.0 if (v <= 1.45e-197) tmp = 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 <= 1.45e-197) tmp = v / (t1 + u); else tmp = v / -t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[v, 1.45e-197], N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision], N[(v / (-t1)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq 1.45 \cdot 10^{-197}:\\
\;\;\;\;\frac{v}{t1 + u}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{-t1}\\
\end{array}
\end{array}
if v < 1.45000000000000011e-197Initial program 78.2%
times-frac98.7%
distribute-frac-neg98.7%
distribute-neg-frac298.7%
+-commutative98.7%
distribute-neg-in98.7%
unsub-neg98.7%
Simplified98.7%
Taylor expanded in t1 around inf 67.7%
clear-num68.3%
clear-num67.1%
frac-times67.7%
metadata-eval67.7%
sub-neg67.7%
distribute-neg-in67.7%
+-commutative67.7%
add-sqr-sqrt34.5%
sqrt-unprod32.1%
sqr-neg32.1%
sqrt-unprod15.6%
add-sqr-sqrt34.2%
frac-2neg34.2%
Applied egg-rr34.2%
*-commutative34.2%
associate-/r*33.6%
associate-/r/33.5%
associate-*r/37.9%
associate-/r/36.0%
*-commutative36.0%
associate-*r*28.1%
lft-mult-inverse28.1%
*-lft-identity28.1%
Simplified28.1%
if 1.45000000000000011e-197 < v Initial program 67.2%
associate-*l/65.8%
*-commutative65.8%
Simplified65.8%
Taylor expanded in t1 around inf 44.6%
associate-*r/44.6%
neg-mul-144.6%
Simplified44.6%
Final simplification34.5%
(FPCore (u v t1) :precision binary64 (if (<= u -1.15e+215) (/ (- v) u) (/ v (- t1))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -1.15e+215) {
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.15d+215)) 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.15e+215) {
tmp = -v / u;
} else {
tmp = v / -t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -1.15e+215: tmp = -v / u else: tmp = v / -t1 return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -1.15e+215) tmp = Float64(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.15e+215) tmp = -v / u; else tmp = v / -t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -1.15e+215], N[((-v) / u), $MachinePrecision], N[(v / (-t1)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.15 \cdot 10^{+215}:\\
\;\;\;\;\frac{-v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{-t1}\\
\end{array}
\end{array}
if u < -1.1500000000000001e215Initial program 92.8%
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 100.0%
Taylor expanded in t1 around inf 41.8%
associate-*r/41.8%
mul-1-neg41.8%
Simplified41.8%
if -1.1500000000000001e215 < u Initial program 73.0%
associate-*l/74.2%
*-commutative74.2%
Simplified74.2%
Taylor expanded in t1 around inf 54.5%
associate-*r/54.5%
neg-mul-154.5%
Simplified54.5%
Final simplification53.8%
(FPCore (u v t1) :precision binary64 (/ (- v) (+ t1 u)))
double code(double u, double v, double t1) {
return -v / (t1 + u);
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = -v / (t1 + u)
end function
public static double code(double u, double v, double t1) {
return -v / (t1 + u);
}
def code(u, v, t1): return -v / (t1 + u)
function code(u, v, t1) return Float64(Float64(-v) / Float64(t1 + u)) end
function tmp = code(u, v, t1) tmp = -v / (t1 + u); end
code[u_, v_, t1_] := N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-v}{t1 + u}
\end{array}
Initial program 74.0%
associate-*l/75.1%
*-commutative75.1%
Simplified75.1%
associate-*r/74.0%
times-frac97.9%
*-commutative97.9%
frac-2neg97.9%
+-commutative97.9%
distribute-neg-in97.9%
sub-neg97.9%
associate-*r/98.5%
add-sqr-sqrt50.3%
sqrt-unprod42.9%
sqr-neg42.9%
sqrt-unprod20.1%
add-sqr-sqrt38.4%
sub-neg38.4%
+-commutative38.4%
add-sqr-sqrt18.3%
sqrt-unprod49.9%
sqr-neg49.9%
sqrt-unprod36.4%
add-sqr-sqrt19.9%
sqrt-unprod39.9%
sqr-neg39.9%
sqrt-unprod22.9%
Applied egg-rr98.5%
Taylor expanded in t1 around inf 57.7%
mul-1-neg57.7%
Simplified57.7%
Final simplification57.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 / Float64(-t1)) end
function tmp = code(u, v, t1) tmp = v / -t1; end
code[u_, v_, t1_] := N[(v / (-t1)), $MachinePrecision]
\begin{array}{l}
\\
\frac{v}{-t1}
\end{array}
Initial program 74.0%
associate-*l/75.1%
*-commutative75.1%
Simplified75.1%
Taylor expanded in t1 around inf 52.2%
associate-*r/52.2%
neg-mul-152.2%
Simplified52.2%
Final simplification52.2%
(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 74.0%
times-frac97.9%
distribute-frac-neg97.9%
distribute-neg-frac297.9%
+-commutative97.9%
distribute-neg-in97.9%
unsub-neg97.9%
Simplified97.9%
Taylor expanded in t1 around inf 52.6%
Taylor expanded in u around inf 15.3%
Final simplification15.3%
herbie shell --seed 2024130
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))