
(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 (- (- u) t1))) (+ t1 u)))
double code(double u, double v, double t1) {
return (v * (t1 / (-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 * (t1 / (-u - t1))) / (t1 + u)
end function
public static double code(double u, double v, double t1) {
return (v * (t1 / (-u - t1))) / (t1 + u);
}
def code(u, v, t1): return (v * (t1 / (-u - t1))) / (t1 + u)
function code(u, v, t1) return Float64(Float64(v * Float64(t1 / Float64(Float64(-u) - t1))) / Float64(t1 + u)) end
function tmp = code(u, v, t1) tmp = (v * (t1 / (-u - t1))) / (t1 + u); end
code[u_, v_, t1_] := N[(N[(v * N[(t1 / N[((-u) - t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{v \cdot \frac{t1}{\left(-u\right) - t1}}{t1 + u}
\end{array}
Initial program 68.9%
times-frac97.3%
distribute-frac-neg97.3%
distribute-neg-frac297.3%
+-commutative97.3%
distribute-neg-in97.3%
unsub-neg97.3%
Simplified97.3%
frac-2neg97.3%
frac-2neg97.3%
frac-times68.9%
sub-neg68.9%
distribute-neg-in68.9%
+-commutative68.9%
remove-double-neg68.9%
frac-times97.3%
associate-*r/98.2%
add-sqr-sqrt50.3%
sqrt-unprod43.5%
sqr-neg43.5%
sqrt-unprod15.5%
add-sqr-sqrt33.0%
add-sqr-sqrt13.9%
sqrt-unprod53.2%
Applied egg-rr98.2%
Final simplification98.2%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -4.5e+136) (not (<= t1 1.85e+118))) (/ v (- u t1)) (* t1 (/ (/ v (+ t1 u)) (- (- u) t1)))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -4.5e+136) || !(t1 <= 1.85e+118)) {
tmp = v / (u - t1);
} else {
tmp = t1 * ((v / (t1 + u)) / (-u - t1));
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if ((t1 <= (-4.5d+136)) .or. (.not. (t1 <= 1.85d+118))) then
tmp = v / (u - t1)
else
tmp = t1 * ((v / (t1 + u)) / (-u - t1))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -4.5e+136) || !(t1 <= 1.85e+118)) {
tmp = v / (u - t1);
} else {
tmp = t1 * ((v / (t1 + u)) / (-u - t1));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -4.5e+136) or not (t1 <= 1.85e+118): tmp = v / (u - t1) else: tmp = t1 * ((v / (t1 + u)) / (-u - t1)) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -4.5e+136) || !(t1 <= 1.85e+118)) tmp = Float64(v / Float64(u - t1)); else tmp = Float64(t1 * Float64(Float64(v / Float64(t1 + u)) / Float64(Float64(-u) - t1))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -4.5e+136) || ~((t1 <= 1.85e+118))) tmp = v / (u - t1); else tmp = t1 * ((v / (t1 + u)) / (-u - t1)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -4.5e+136], N[Not[LessEqual[t1, 1.85e+118]], $MachinePrecision]], N[(v / N[(u - t1), $MachinePrecision]), $MachinePrecision], N[(t1 * N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] / N[((-u) - t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -4.5 \cdot 10^{+136} \lor \neg \left(t1 \leq 1.85 \cdot 10^{+118}\right):\\
\;\;\;\;\frac{v}{u - t1}\\
\mathbf{else}:\\
\;\;\;\;t1 \cdot \frac{\frac{v}{t1 + u}}{\left(-u\right) - t1}\\
\end{array}
\end{array}
if t1 < -4.4999999999999999e136 or 1.84999999999999993e118 < t1 Initial program 42.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.8%
add-sqr-sqrt34.8%
add-sqr-sqrt18.6%
difference-of-squares18.6%
add-sqr-sqrt18.6%
sqrt-unprod17.4%
sqr-neg17.4%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
add-sqr-sqrt0.0%
sqrt-unprod26.8%
sqr-neg26.8%
sqrt-unprod30.6%
add-sqr-sqrt30.6%
Applied egg-rr30.6%
difference-of-squares30.6%
rem-square-sqrt49.3%
rem-square-sqrt91.0%
Simplified91.0%
Taylor expanded in v around 0 91.0%
if -4.4999999999999999e136 < t1 < 1.84999999999999993e118Initial program 79.7%
associate-/l*78.1%
distribute-lft-neg-out78.1%
distribute-rgt-neg-in78.1%
associate-/r*89.1%
distribute-neg-frac289.1%
Simplified89.1%
Final simplification89.7%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -9.5e-51) (not (<= t1 1.15e-15))) (/ v (- u t1)) (/ (* v (/ t1 (- u))) (+ t1 u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -9.5e-51) || !(t1 <= 1.15e-15)) {
tmp = v / (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 ((t1 <= (-9.5d-51)) .or. (.not. (t1 <= 1.15d-15))) then
tmp = v / (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 ((t1 <= -9.5e-51) || !(t1 <= 1.15e-15)) {
tmp = v / (u - t1);
} else {
tmp = (v * (t1 / -u)) / (t1 + u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -9.5e-51) or not (t1 <= 1.15e-15): tmp = v / (u - t1) else: tmp = (v * (t1 / -u)) / (t1 + u) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -9.5e-51) || !(t1 <= 1.15e-15)) tmp = Float64(v / Float64(u - t1)); else tmp = Float64(Float64(v * Float64(t1 / Float64(-u))) / Float64(t1 + u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -9.5e-51) || ~((t1 <= 1.15e-15))) tmp = v / (u - t1); else tmp = (v * (t1 / -u)) / (t1 + u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -9.5e-51], N[Not[LessEqual[t1, 1.15e-15]], $MachinePrecision]], N[(v / N[(u - t1), $MachinePrecision]), $MachinePrecision], N[(N[(v * N[(t1 / (-u)), $MachinePrecision]), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -9.5 \cdot 10^{-51} \lor \neg \left(t1 \leq 1.15 \cdot 10^{-15}\right):\\
\;\;\;\;\frac{v}{u - t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v \cdot \frac{t1}{-u}}{t1 + u}\\
\end{array}
\end{array}
if t1 < -9.4999999999999998e-51 or 1.14999999999999995e-15 < t1 Initial program 56.3%
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 77.9%
add-sqr-sqrt31.7%
add-sqr-sqrt16.7%
difference-of-squares16.7%
add-sqr-sqrt16.7%
sqrt-unprod16.8%
sqr-neg16.8%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
add-sqr-sqrt0.0%
sqrt-unprod18.2%
sqr-neg18.2%
sqrt-unprod20.1%
add-sqr-sqrt20.1%
Applied egg-rr20.1%
difference-of-squares20.1%
rem-square-sqrt37.0%
rem-square-sqrt78.2%
Simplified78.2%
Taylor expanded in v around 0 78.2%
if -9.4999999999999998e-51 < t1 < 1.14999999999999995e-15Initial program 85.0%
times-frac93.9%
distribute-frac-neg93.9%
distribute-neg-frac293.9%
+-commutative93.9%
distribute-neg-in93.9%
unsub-neg93.9%
Simplified93.9%
frac-2neg93.9%
frac-2neg93.9%
frac-times85.0%
sub-neg85.0%
distribute-neg-in85.0%
+-commutative85.0%
remove-double-neg85.0%
frac-times93.9%
associate-*r/96.0%
add-sqr-sqrt45.1%
sqrt-unprod49.6%
sqr-neg49.6%
sqrt-unprod18.9%
add-sqr-sqrt41.1%
add-sqr-sqrt15.8%
sqrt-unprod67.2%
Applied egg-rr96.0%
Taylor expanded in t1 around 0 80.7%
Final simplification79.3%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -3.6e-44) (not (<= t1 1.42e-14))) (/ v (- u t1)) (* t1 (/ (/ v u) (- u)))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -3.6e-44) || !(t1 <= 1.42e-14)) {
tmp = v / (u - 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 <= (-3.6d-44)) .or. (.not. (t1 <= 1.42d-14))) then
tmp = v / (u - 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 <= -3.6e-44) || !(t1 <= 1.42e-14)) {
tmp = v / (u - t1);
} else {
tmp = t1 * ((v / u) / -u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -3.6e-44) or not (t1 <= 1.42e-14): tmp = v / (u - t1) else: tmp = t1 * ((v / u) / -u) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -3.6e-44) || !(t1 <= 1.42e-14)) tmp = Float64(v / Float64(u - t1)); else tmp = Float64(t1 * Float64(Float64(v / u) / Float64(-u))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -3.6e-44) || ~((t1 <= 1.42e-14))) tmp = v / (u - t1); else tmp = t1 * ((v / u) / -u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -3.6e-44], N[Not[LessEqual[t1, 1.42e-14]], $MachinePrecision]], N[(v / N[(u - t1), $MachinePrecision]), $MachinePrecision], N[(t1 * N[(N[(v / u), $MachinePrecision] / (-u)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -3.6 \cdot 10^{-44} \lor \neg \left(t1 \leq 1.42 \cdot 10^{-14}\right):\\
\;\;\;\;\frac{v}{u - t1}\\
\mathbf{else}:\\
\;\;\;\;t1 \cdot \frac{\frac{v}{u}}{-u}\\
\end{array}
\end{array}
if t1 < -3.5999999999999999e-44 or 1.42000000000000004e-14 < t1 Initial program 55.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 78.3%
add-sqr-sqrt32.2%
add-sqr-sqrt16.9%
difference-of-squares16.9%
add-sqr-sqrt16.9%
sqrt-unprod17.0%
sqr-neg17.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
add-sqr-sqrt0.0%
sqrt-unprod18.5%
sqr-neg18.5%
sqrt-unprod20.4%
add-sqr-sqrt20.4%
Applied egg-rr20.4%
difference-of-squares20.4%
rem-square-sqrt37.5%
rem-square-sqrt78.5%
Simplified78.5%
Taylor expanded in v around 0 78.5%
if -3.5999999999999999e-44 < t1 < 1.42000000000000004e-14Initial program 85.3%
associate-/l*81.3%
distribute-lft-neg-out81.3%
distribute-rgt-neg-in81.3%
associate-/r*90.7%
distribute-neg-frac290.7%
Simplified90.7%
Taylor expanded in t1 around 0 78.1%
Taylor expanded in t1 around 0 80.0%
Final simplification79.2%
(FPCore (u v t1) :precision binary64 (if (or (<= u -3.4e+112) (not (<= u 4e+131))) (* v (/ (/ t1 u) u)) (/ v (- t1))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -3.4e+112) || !(u <= 4e+131)) {
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 <= (-3.4d+112)) .or. (.not. (u <= 4d+131))) 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 <= -3.4e+112) || !(u <= 4e+131)) {
tmp = v * ((t1 / u) / u);
} else {
tmp = v / -t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -3.4e+112) or not (u <= 4e+131): tmp = v * ((t1 / u) / u) else: tmp = v / -t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -3.4e+112) || !(u <= 4e+131)) tmp = Float64(v * Float64(Float64(t1 / u) / u)); else tmp = Float64(v / Float64(-t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -3.4e+112) || ~((u <= 4e+131))) tmp = v * ((t1 / u) / u); else tmp = v / -t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -3.4e+112], N[Not[LessEqual[u, 4e+131]], $MachinePrecision]], N[(v * N[(N[(t1 / u), $MachinePrecision] / u), $MachinePrecision]), $MachinePrecision], N[(v / (-t1)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -3.4 \cdot 10^{+112} \lor \neg \left(u \leq 4 \cdot 10^{+131}\right):\\
\;\;\;\;v \cdot \frac{\frac{t1}{u}}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{-t1}\\
\end{array}
\end{array}
if u < -3.39999999999999993e112 or 3.9999999999999996e131 < u Initial program 65.4%
associate-*l/63.8%
*-commutative63.8%
Simplified63.8%
Taylor expanded in t1 around 0 63.2%
Taylor expanded in t1 around 0 63.2%
associate-/r*71.4%
div-inv71.4%
add-sqr-sqrt41.6%
sqrt-unprod53.0%
sqr-neg53.0%
sqrt-unprod21.2%
add-sqr-sqrt56.4%
Applied egg-rr56.4%
associate-*r/56.4%
*-rgt-identity56.4%
Simplified56.4%
if -3.39999999999999993e112 < u < 3.9999999999999996e131Initial program 70.9%
times-frac96.9%
distribute-frac-neg96.9%
distribute-neg-frac296.9%
+-commutative96.9%
distribute-neg-in96.9%
unsub-neg96.9%
Simplified96.9%
Taylor expanded in t1 around inf 70.2%
associate-*r/70.2%
neg-mul-170.2%
Simplified70.2%
Final simplification65.1%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -3.9e+49) (not (<= t1 2.7e+125))) (/ v t1) (/ v u)))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -3.9e+49) || !(t1 <= 2.7e+125)) {
tmp = v / t1;
} else {
tmp = v / u;
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if ((t1 <= (-3.9d+49)) .or. (.not. (t1 <= 2.7d+125))) then
tmp = v / t1
else
tmp = v / u
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -3.9e+49) || !(t1 <= 2.7e+125)) {
tmp = v / t1;
} else {
tmp = v / u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -3.9e+49) or not (t1 <= 2.7e+125): tmp = v / t1 else: tmp = v / u return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -3.9e+49) || !(t1 <= 2.7e+125)) tmp = Float64(v / t1); else tmp = Float64(v / u); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -3.9e+49) || ~((t1 <= 2.7e+125))) tmp = v / t1; else tmp = v / u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -3.9e+49], N[Not[LessEqual[t1, 2.7e+125]], $MachinePrecision]], N[(v / t1), $MachinePrecision], N[(v / u), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -3.9 \cdot 10^{+49} \lor \neg \left(t1 \leq 2.7 \cdot 10^{+125}\right):\\
\;\;\;\;\frac{v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u}\\
\end{array}
\end{array}
if t1 < -3.9000000000000001e49 or 2.6999999999999999e125 < t1 Initial program 43.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 82.0%
associate-*r/82.0%
neg-mul-182.0%
Simplified82.0%
distribute-frac-neg82.0%
div-inv81.9%
distribute-rgt-neg-in81.9%
frac-2neg81.9%
metadata-eval81.9%
add-sqr-sqrt46.5%
sqrt-unprod43.4%
sqr-neg43.4%
sqrt-unprod12.7%
add-sqr-sqrt26.1%
Applied egg-rr26.1%
distribute-rgt-neg-out26.1%
*-commutative26.1%
associate-*l/26.1%
mul-1-neg26.1%
distribute-neg-frac26.1%
remove-double-neg26.1%
Simplified26.1%
if -3.9000000000000001e49 < t1 < 2.6999999999999999e125Initial program 83.6%
times-frac95.7%
distribute-frac-neg95.7%
distribute-neg-frac295.7%
+-commutative95.7%
distribute-neg-in95.7%
unsub-neg95.7%
Simplified95.7%
Taylor expanded in t1 around inf 45.8%
add-sqr-sqrt22.8%
add-sqr-sqrt13.9%
difference-of-squares13.9%
add-sqr-sqrt13.9%
sqrt-unprod14.5%
sqr-neg14.5%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
add-sqr-sqrt0.0%
sqrt-unprod12.8%
sqr-neg12.8%
sqrt-unprod10.9%
add-sqr-sqrt10.9%
Applied egg-rr10.9%
difference-of-squares10.9%
rem-square-sqrt25.1%
rem-square-sqrt45.2%
Simplified45.2%
Taylor expanded in t1 around 0 15.1%
Final simplification19.2%
(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(t1 + u)) * Float64(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[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(v / N[((-u) - t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{t1}{t1 + u} \cdot \frac{v}{\left(-u\right) - t1}
\end{array}
Initial program 68.9%
times-frac97.3%
distribute-frac-neg97.3%
distribute-neg-frac297.3%
+-commutative97.3%
distribute-neg-in97.3%
unsub-neg97.3%
Simplified97.3%
Final simplification97.3%
(FPCore (u v t1) :precision binary64 (if (<= u 2.7e+195) (/ v (- t1)) (/ v (+ t1 u))))
double code(double u, double v, double t1) {
double tmp;
if (u <= 2.7e+195) {
tmp = v / -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 <= 2.7d+195) then
tmp = v / -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 <= 2.7e+195) {
tmp = v / -t1;
} else {
tmp = v / (t1 + u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= 2.7e+195: tmp = v / -t1 else: tmp = v / (t1 + u) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= 2.7e+195) tmp = Float64(v / Float64(-t1)); else tmp = Float64(v / Float64(t1 + u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= 2.7e+195) tmp = v / -t1; else tmp = v / (t1 + u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, 2.7e+195], N[(v / (-t1)), $MachinePrecision], N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq 2.7 \cdot 10^{+195}:\\
\;\;\;\;\frac{v}{-t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{t1 + u}\\
\end{array}
\end{array}
if u < 2.7000000000000002e195Initial program 68.2%
times-frac96.9%
distribute-frac-neg96.9%
distribute-neg-frac296.9%
+-commutative96.9%
distribute-neg-in96.9%
unsub-neg96.9%
Simplified96.9%
Taylor expanded in t1 around inf 55.4%
associate-*r/55.4%
neg-mul-155.4%
Simplified55.4%
if 2.7000000000000002e195 < u Initial program 74.0%
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 45.9%
add-sqr-sqrt39.7%
sqrt-unprod57.6%
mul-1-neg57.6%
mul-1-neg57.6%
sqr-neg57.6%
sqrt-unprod37.8%
add-sqr-sqrt39.5%
Applied egg-rr39.5%
Final simplification53.6%
(FPCore (u v t1) :precision binary64 (if (<= u 3e+195) (/ v (- t1)) (/ v (- u))))
double code(double u, double v, double t1) {
double tmp;
if (u <= 3e+195) {
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 <= 3d+195) 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 <= 3e+195) {
tmp = v / -t1;
} else {
tmp = v / -u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= 3e+195: tmp = v / -t1 else: tmp = v / -u return tmp
function code(u, v, t1) tmp = 0.0 if (u <= 3e+195) tmp = Float64(v / Float64(-t1)); else tmp = Float64(v / Float64(-u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= 3e+195) tmp = v / -t1; else tmp = v / -u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, 3e+195], N[(v / (-t1)), $MachinePrecision], N[(v / (-u)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq 3 \cdot 10^{+195}:\\
\;\;\;\;\frac{v}{-t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{-u}\\
\end{array}
\end{array}
if u < 3.0000000000000001e195Initial program 68.2%
times-frac96.9%
distribute-frac-neg96.9%
distribute-neg-frac296.9%
+-commutative96.9%
distribute-neg-in96.9%
unsub-neg96.9%
Simplified96.9%
Taylor expanded in t1 around inf 55.4%
associate-*r/55.4%
neg-mul-155.4%
Simplified55.4%
if 3.0000000000000001e195 < u Initial program 74.0%
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 45.9%
Taylor expanded in t1 around 0 39.4%
associate-*r/39.4%
mul-1-neg39.4%
Simplified39.4%
Final simplification53.6%
(FPCore (u v t1) :precision binary64 (if (<= u 2.8e+195) (/ v (- t1)) (/ v u)))
double code(double u, double v, double t1) {
double tmp;
if (u <= 2.8e+195) {
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 <= 2.8d+195) 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 <= 2.8e+195) {
tmp = v / -t1;
} else {
tmp = v / u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= 2.8e+195: tmp = v / -t1 else: tmp = v / u return tmp
function code(u, v, t1) tmp = 0.0 if (u <= 2.8e+195) 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 <= 2.8e+195) tmp = v / -t1; else tmp = v / u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, 2.8e+195], N[(v / (-t1)), $MachinePrecision], N[(v / u), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq 2.8 \cdot 10^{+195}:\\
\;\;\;\;\frac{v}{-t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u}\\
\end{array}
\end{array}
if u < 2.7999999999999998e195Initial program 68.2%
times-frac96.9%
distribute-frac-neg96.9%
distribute-neg-frac296.9%
+-commutative96.9%
distribute-neg-in96.9%
unsub-neg96.9%
Simplified96.9%
Taylor expanded in t1 around inf 55.4%
associate-*r/55.4%
neg-mul-155.4%
Simplified55.4%
if 2.7999999999999998e195 < u Initial program 74.0%
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 56.9%
add-sqr-sqrt0.0%
add-sqr-sqrt0.0%
difference-of-squares0.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
add-sqr-sqrt0.0%
sqrt-unprod21.0%
sqr-neg21.0%
sqrt-unprod17.7%
add-sqr-sqrt17.7%
Applied egg-rr17.7%
difference-of-squares17.7%
rem-square-sqrt17.7%
rem-square-sqrt57.0%
Simplified57.0%
Taylor expanded in t1 around 0 39.4%
Final simplification53.6%
(FPCore (u v t1) :precision binary64 (/ v (- (- u) t1)))
double code(double u, double v, double t1) {
return v / (-u - t1);
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = v / (-u - t1)
end function
public static double code(double u, double v, double t1) {
return v / (-u - t1);
}
def code(u, v, t1): return v / (-u - t1)
function code(u, v, t1) return Float64(v / Float64(Float64(-u) - t1)) end
function tmp = code(u, v, t1) tmp = v / (-u - t1); end
code[u_, v_, t1_] := N[(v / N[((-u) - t1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{v}{\left(-u\right) - t1}
\end{array}
Initial program 68.9%
times-frac97.3%
distribute-frac-neg97.3%
distribute-neg-frac297.3%
+-commutative97.3%
distribute-neg-in97.3%
unsub-neg97.3%
Simplified97.3%
frac-2neg97.3%
frac-2neg97.3%
frac-times68.9%
sub-neg68.9%
distribute-neg-in68.9%
+-commutative68.9%
remove-double-neg68.9%
frac-times97.3%
associate-*r/98.2%
add-sqr-sqrt50.3%
sqrt-unprod43.5%
sqr-neg43.5%
sqrt-unprod15.5%
add-sqr-sqrt33.0%
add-sqr-sqrt13.9%
sqrt-unprod53.2%
Applied egg-rr98.2%
Taylor expanded in t1 around inf 57.0%
mul-1-neg57.0%
Simplified57.0%
Final simplification57.0%
(FPCore (u v t1) :precision binary64 (/ v (- u t1)))
double code(double u, double v, double t1) {
return v / (u - t1);
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = v / (u - t1)
end function
public static double code(double u, double v, double t1) {
return v / (u - t1);
}
def code(u, v, t1): return v / (u - t1)
function code(u, v, t1) return Float64(v / Float64(u - t1)) end
function tmp = code(u, v, t1) tmp = v / (u - t1); end
code[u_, v_, t1_] := N[(v / N[(u - t1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{v}{u - t1}
\end{array}
Initial program 68.9%
times-frac97.3%
distribute-frac-neg97.3%
distribute-neg-frac297.3%
+-commutative97.3%
distribute-neg-in97.3%
unsub-neg97.3%
Simplified97.3%
Taylor expanded in t1 around inf 59.9%
add-sqr-sqrt26.2%
add-sqr-sqrt13.8%
difference-of-squares13.8%
add-sqr-sqrt13.8%
sqrt-unprod13.8%
sqr-neg13.8%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
add-sqr-sqrt0.0%
sqrt-unprod15.1%
sqr-neg15.1%
sqrt-unprod15.0%
add-sqr-sqrt15.0%
Applied egg-rr15.0%
difference-of-squares15.0%
rem-square-sqrt29.1%
rem-square-sqrt59.6%
Simplified59.6%
Taylor expanded in v around 0 56.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 68.9%
times-frac97.3%
distribute-frac-neg97.3%
distribute-neg-frac297.3%
+-commutative97.3%
distribute-neg-in97.3%
unsub-neg97.3%
Simplified97.3%
Taylor expanded in t1 around inf 51.8%
associate-*r/51.8%
neg-mul-151.8%
Simplified51.8%
distribute-frac-neg51.8%
div-inv51.7%
distribute-rgt-neg-in51.7%
frac-2neg51.7%
metadata-eval51.7%
add-sqr-sqrt26.3%
sqrt-unprod25.7%
sqr-neg25.7%
sqrt-unprod5.8%
add-sqr-sqrt11.3%
Applied egg-rr11.3%
distribute-rgt-neg-out11.3%
*-commutative11.3%
associate-*l/11.3%
mul-1-neg11.3%
distribute-neg-frac11.3%
remove-double-neg11.3%
Simplified11.3%
herbie shell --seed 2024132
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))