
(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 9 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[(N[(t1 / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * (-v)), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{t1 + u}
\end{array}
Initial program 71.6%
associate-/l*73.0%
distribute-lft-neg-out73.0%
distribute-rgt-neg-in73.0%
associate-/r*82.0%
distribute-neg-frac282.0%
Simplified82.0%
associate-*r/97.4%
+-commutative97.4%
distribute-neg-in97.4%
sub-neg97.4%
associate-*l/97.8%
frac-2neg97.8%
associate-*r/98.3%
remove-double-neg98.3%
sub-neg98.3%
distribute-neg-in98.3%
+-commutative98.3%
frac-2neg98.3%
add-sqr-sqrt50.6%
sqrt-unprod42.4%
sqr-neg42.4%
sqrt-unprod19.5%
add-sqr-sqrt40.8%
add-sqr-sqrt17.8%
sqrt-unprod58.5%
Applied egg-rr98.3%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (* -1.0 (/ v t1))))
(if (<= t1 -7.5e+168)
t_1
(if (<= t1 1.8e+157) (* t1 (/ (/ v (+ t1 u)) (- (+ t1 u)))) t_1))))
double code(double u, double v, double t1) {
double t_1 = -1.0 * (v / t1);
double tmp;
if (t1 <= -7.5e+168) {
tmp = t_1;
} else if (t1 <= 1.8e+157) {
tmp = t1 * ((v / (t1 + u)) / -(t1 + u));
} 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) :: tmp
t_1 = (-1.0d0) * (v / t1)
if (t1 <= (-7.5d+168)) then
tmp = t_1
else if (t1 <= 1.8d+157) then
tmp = t1 * ((v / (t1 + u)) / -(t1 + u))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = -1.0 * (v / t1);
double tmp;
if (t1 <= -7.5e+168) {
tmp = t_1;
} else if (t1 <= 1.8e+157) {
tmp = t1 * ((v / (t1 + u)) / -(t1 + u));
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -1.0 * (v / t1) tmp = 0 if t1 <= -7.5e+168: tmp = t_1 elif t1 <= 1.8e+157: tmp = t1 * ((v / (t1 + u)) / -(t1 + u)) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(-1.0 * Float64(v / t1)) tmp = 0.0 if (t1 <= -7.5e+168) tmp = t_1; elseif (t1 <= 1.8e+157) tmp = Float64(t1 * Float64(Float64(v / Float64(t1 + u)) / Float64(-Float64(t1 + u)))); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -1.0 * (v / t1); tmp = 0.0; if (t1 <= -7.5e+168) tmp = t_1; elseif (t1 <= 1.8e+157) tmp = t1 * ((v / (t1 + u)) / -(t1 + u)); else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(-1.0 * N[(v / t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -7.5e+168], t$95$1, If[LessEqual[t1, 1.8e+157], N[(t1 * N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] / (-N[(t1 + u), $MachinePrecision])), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -1 \cdot \frac{v}{t1}\\
\mathbf{if}\;t1 \leq -7.5 \cdot 10^{+168}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 1.8 \cdot 10^{+157}:\\
\;\;\;\;t1 \cdot \frac{\frac{v}{t1 + u}}{-\left(t1 + u\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -7.4999999999999999e168 or 1.80000000000000012e157 < t1 Initial program 42.5%
associate-/l*43.6%
distribute-lft-neg-out43.6%
distribute-rgt-neg-in43.6%
associate-/r*57.0%
distribute-neg-frac257.0%
Simplified57.0%
Taylor expanded in t1 around inf 87.4%
if -7.4999999999999999e168 < t1 < 1.80000000000000012e157Initial program 83.0%
associate-/l*84.5%
distribute-lft-neg-out84.5%
distribute-rgt-neg-in84.5%
associate-/r*91.8%
distribute-neg-frac291.8%
Simplified91.8%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (- (* (/ v (+ t1 u)) (/ t1 u))))) (if (<= u -5.8e+56) t_1 (if (<= u 1.2e-74) (* -1.0 (/ v t1)) t_1))))
double code(double u, double v, double t1) {
double t_1 = -((v / (t1 + u)) * (t1 / u));
double tmp;
if (u <= -5.8e+56) {
tmp = t_1;
} else if (u <= 1.2e-74) {
tmp = -1.0 * (v / t1);
} 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) :: tmp
t_1 = -((v / (t1 + u)) * (t1 / u))
if (u <= (-5.8d+56)) then
tmp = t_1
else if (u <= 1.2d-74) then
tmp = (-1.0d0) * (v / t1)
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)) * (t1 / u));
double tmp;
if (u <= -5.8e+56) {
tmp = t_1;
} else if (u <= 1.2e-74) {
tmp = -1.0 * (v / t1);
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -((v / (t1 + u)) * (t1 / u)) tmp = 0 if u <= -5.8e+56: tmp = t_1 elif u <= 1.2e-74: tmp = -1.0 * (v / t1) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(-Float64(Float64(v / Float64(t1 + u)) * Float64(t1 / u))) tmp = 0.0 if (u <= -5.8e+56) tmp = t_1; elseif (u <= 1.2e-74) tmp = Float64(-1.0 * Float64(v / t1)); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -((v / (t1 + u)) * (t1 / u)); tmp = 0.0; if (u <= -5.8e+56) tmp = t_1; elseif (u <= 1.2e-74) tmp = -1.0 * (v / t1); else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = (-N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(t1 / u), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[u, -5.8e+56], t$95$1, If[LessEqual[u, 1.2e-74], N[(-1.0 * N[(v / t1), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -\frac{v}{t1 + u} \cdot \frac{t1}{u}\\
\mathbf{if}\;u \leq -5.8 \cdot 10^{+56}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq 1.2 \cdot 10^{-74}:\\
\;\;\;\;-1 \cdot \frac{v}{t1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if u < -5.80000000000000014e56 or 1.1999999999999999e-74 < u Initial program 79.8%
associate-/l*81.1%
distribute-lft-neg-out81.1%
distribute-rgt-neg-in81.1%
associate-/r*90.6%
distribute-neg-frac290.6%
Simplified90.6%
Taylor expanded in t1 around 0 86.8%
distribute-frac-neg286.8%
add-sqr-sqrt52.6%
sqrt-unprod75.3%
sqr-neg75.3%
sqrt-unprod26.9%
add-sqr-sqrt63.8%
associate-/l/64.0%
add-sqr-sqrt26.9%
sqrt-unprod75.3%
sqr-neg75.3%
sqrt-unprod48.3%
add-sqr-sqrt78.9%
Applied egg-rr78.9%
distribute-rgt-neg-out78.9%
associate-*r/77.6%
associate-/l/82.2%
div-inv82.1%
add-sqr-sqrt54.3%
sqrt-unprod66.3%
sqr-neg66.3%
mul-1-neg66.3%
mul-1-neg66.3%
sqrt-unprod50.8%
add-sqr-sqrt58.0%
mul-1-neg58.0%
distribute-neg-frac58.0%
associate-*l/58.0%
Applied egg-rr82.2%
associate-*r/92.9%
*-commutative92.9%
associate-/l*91.9%
Applied egg-rr91.9%
if -5.80000000000000014e56 < u < 1.1999999999999999e-74Initial program 63.2%
associate-/l*64.6%
distribute-lft-neg-out64.6%
distribute-rgt-neg-in64.6%
associate-/r*73.1%
distribute-neg-frac273.1%
Simplified73.1%
Taylor expanded in t1 around inf 79.4%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) (+ t1 u))))
(if (<= t1 -7.5e-37)
t_1
(if (<= t1 1.9e-10) (- (/ (/ (* t1 v) u) u)) t_1))))
double code(double u, double v, double t1) {
double t_1 = -v / (t1 + u);
double tmp;
if (t1 <= -7.5e-37) {
tmp = t_1;
} else if (t1 <= 1.9e-10) {
tmp = -(((t1 * v) / u) / u);
} 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) :: tmp
t_1 = -v / (t1 + u)
if (t1 <= (-7.5d-37)) then
tmp = t_1
else if (t1 <= 1.9d-10) then
tmp = -(((t1 * v) / u) / u)
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 tmp;
if (t1 <= -7.5e-37) {
tmp = t_1;
} else if (t1 <= 1.9e-10) {
tmp = -(((t1 * v) / u) / u);
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -v / (t1 + u) tmp = 0 if t1 <= -7.5e-37: tmp = t_1 elif t1 <= 1.9e-10: tmp = -(((t1 * v) / u) / u) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-v) / Float64(t1 + u)) tmp = 0.0 if (t1 <= -7.5e-37) tmp = t_1; elseif (t1 <= 1.9e-10) tmp = Float64(-Float64(Float64(Float64(t1 * v) / u) / u)); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -v / (t1 + u); tmp = 0.0; if (t1 <= -7.5e-37) tmp = t_1; elseif (t1 <= 1.9e-10) tmp = -(((t1 * v) / u) / u); else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -7.5e-37], t$95$1, If[LessEqual[t1, 1.9e-10], (-N[(N[(N[(t1 * v), $MachinePrecision] / u), $MachinePrecision] / u), $MachinePrecision]), t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{t1 + u}\\
\mathbf{if}\;t1 \leq -7.5 \cdot 10^{-37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 1.9 \cdot 10^{-10}:\\
\;\;\;\;-\frac{\frac{t1 \cdot v}{u}}{u}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -7.5000000000000004e-37 or 1.8999999999999999e-10 < t1 Initial program 56.6%
associate-/l*59.0%
distribute-lft-neg-out59.0%
distribute-rgt-neg-in59.0%
associate-/r*73.2%
distribute-neg-frac273.2%
Simplified73.2%
associate-*r/99.9%
frac-2neg99.9%
remove-double-neg99.9%
Applied egg-rr99.9%
Taylor expanded in t1 around inf 82.9%
if -7.5000000000000004e-37 < t1 < 1.8999999999999999e-10Initial program 86.9%
associate-/l*87.2%
distribute-lft-neg-out87.2%
distribute-rgt-neg-in87.2%
associate-/r*90.9%
distribute-neg-frac290.9%
Simplified90.9%
Taylor expanded in t1 around 0 79.3%
distribute-frac-neg279.3%
add-sqr-sqrt42.0%
sqrt-unprod60.5%
sqr-neg60.5%
sqrt-unprod19.2%
add-sqr-sqrt48.0%
associate-/l/48.0%
add-sqr-sqrt19.2%
sqrt-unprod60.5%
sqr-neg60.5%
sqrt-unprod41.2%
add-sqr-sqrt77.1%
Applied egg-rr77.1%
distribute-rgt-neg-out77.1%
associate-*r/76.4%
associate-/l/79.6%
div-inv79.5%
add-sqr-sqrt58.0%
sqrt-unprod64.3%
sqr-neg64.3%
mul-1-neg64.3%
mul-1-neg64.3%
sqrt-unprod43.5%
add-sqr-sqrt48.2%
mul-1-neg48.2%
distribute-neg-frac48.2%
associate-*l/48.2%
Applied egg-rr79.6%
Taylor expanded in t1 around 0 82.2%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (- (/ v u)))) (if (<= u -3.1e+136) t_1 (if (<= u 9.5e+157) (* -1.0 (/ v t1)) t_1))))
double code(double u, double v, double t1) {
double t_1 = -(v / u);
double tmp;
if (u <= -3.1e+136) {
tmp = t_1;
} else if (u <= 9.5e+157) {
tmp = -1.0 * (v / t1);
} 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) :: tmp
t_1 = -(v / u)
if (u <= (-3.1d+136)) then
tmp = t_1
else if (u <= 9.5d+157) then
tmp = (-1.0d0) * (v / t1)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = -(v / u);
double tmp;
if (u <= -3.1e+136) {
tmp = t_1;
} else if (u <= 9.5e+157) {
tmp = -1.0 * (v / t1);
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -(v / u) tmp = 0 if u <= -3.1e+136: tmp = t_1 elif u <= 9.5e+157: tmp = -1.0 * (v / t1) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(-Float64(v / u)) tmp = 0.0 if (u <= -3.1e+136) tmp = t_1; elseif (u <= 9.5e+157) tmp = Float64(-1.0 * Float64(v / t1)); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -(v / u); tmp = 0.0; if (u <= -3.1e+136) tmp = t_1; elseif (u <= 9.5e+157) tmp = -1.0 * (v / t1); else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = (-N[(v / u), $MachinePrecision])}, If[LessEqual[u, -3.1e+136], t$95$1, If[LessEqual[u, 9.5e+157], N[(-1.0 * N[(v / t1), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -\frac{v}{u}\\
\mathbf{if}\;u \leq -3.1 \cdot 10^{+136}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq 9.5 \cdot 10^{+157}:\\
\;\;\;\;-1 \cdot \frac{v}{t1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if u < -3.09999999999999983e136 or 9.4999999999999996e157 < u Initial program 74.9%
associate-/l*75.3%
distribute-lft-neg-out75.3%
distribute-rgt-neg-in75.3%
associate-/r*88.3%
distribute-neg-frac288.3%
Simplified88.3%
Taylor expanded in t1 around 0 88.0%
Taylor expanded in u around 0 48.2%
mul-1-neg48.2%
distribute-rgt-neg-out48.2%
associate-/r*47.8%
Applied egg-rr47.8%
Taylor expanded in t1 around 0 45.5%
if -3.09999999999999983e136 < u < 9.4999999999999996e157Initial program 70.1%
associate-/l*71.9%
distribute-lft-neg-out71.9%
distribute-rgt-neg-in71.9%
associate-/r*79.1%
distribute-neg-frac279.1%
Simplified79.1%
Taylor expanded in t1 around inf 65.4%
(FPCore (u v t1) :precision binary64 (if (<= t1 -7.7e+121) (/ v t1) (if (<= t1 2.05e+62) (- (/ v u)) (/ v t1))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -7.7e+121) {
tmp = v / t1;
} else if (t1 <= 2.05e+62) {
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 (t1 <= (-7.7d+121)) then
tmp = v / t1
else if (t1 <= 2.05d+62) 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 (t1 <= -7.7e+121) {
tmp = v / t1;
} else if (t1 <= 2.05e+62) {
tmp = -(v / u);
} else {
tmp = v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if t1 <= -7.7e+121: tmp = v / t1 elif t1 <= 2.05e+62: tmp = -(v / u) else: tmp = v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if (t1 <= -7.7e+121) tmp = Float64(v / t1); elseif (t1 <= 2.05e+62) tmp = Float64(-Float64(v / u)); else tmp = Float64(v / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (t1 <= -7.7e+121) tmp = v / t1; elseif (t1 <= 2.05e+62) tmp = -(v / u); else tmp = v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[t1, -7.7e+121], N[(v / t1), $MachinePrecision], If[LessEqual[t1, 2.05e+62], (-N[(v / u), $MachinePrecision]), N[(v / t1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -7.7 \cdot 10^{+121}:\\
\;\;\;\;\frac{v}{t1}\\
\mathbf{elif}\;t1 \leq 2.05 \cdot 10^{+62}:\\
\;\;\;\;-\frac{v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{t1}\\
\end{array}
\end{array}
if t1 < -7.70000000000000028e121 or 2.04999999999999992e62 < t1 Initial program 46.5%
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 85.7%
Taylor expanded in u around inf 39.0%
if -7.70000000000000028e121 < t1 < 2.04999999999999992e62Initial program 85.7%
associate-/l*86.1%
distribute-lft-neg-out86.1%
distribute-rgt-neg-in86.1%
associate-/r*91.3%
distribute-neg-frac291.3%
Simplified91.3%
Taylor expanded in t1 around 0 71.2%
Taylor expanded in u around 0 26.3%
mul-1-neg26.3%
distribute-rgt-neg-out26.3%
associate-/r*26.8%
Applied egg-rr26.8%
Taylor expanded in t1 around 0 26.3%
(FPCore (u v t1) :precision binary64 (* (/ t1 (- (- u) t1)) (/ v (+ t1 u))))
double code(double u, double v, double t1) {
return (t1 / (-u - t1)) * (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 / (-u - t1)) * (v / (t1 + u))
end function
public static double code(double u, double v, double t1) {
return (t1 / (-u - t1)) * (v / (t1 + u));
}
def code(u, v, t1): return (t1 / (-u - t1)) * (v / (t1 + u))
function code(u, v, t1) return Float64(Float64(t1 / Float64(Float64(-u) - t1)) * Float64(v / Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = (t1 / (-u - t1)) * (v / (t1 + u)); end
code[u_, v_, t1_] := N[(N[(t1 / N[((-u) - t1), $MachinePrecision]), $MachinePrecision] * N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}
\end{array}
Initial program 71.6%
times-frac97.8%
distribute-frac-neg97.8%
distribute-neg-frac297.8%
+-commutative97.8%
distribute-neg-in97.8%
unsub-neg97.8%
Simplified97.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 71.6%
associate-/l*73.0%
distribute-lft-neg-out73.0%
distribute-rgt-neg-in73.0%
associate-/r*82.0%
distribute-neg-frac282.0%
Simplified82.0%
associate-*r/97.4%
frac-2neg97.4%
remove-double-neg97.4%
Applied egg-rr97.4%
Taylor expanded in t1 around inf 61.9%
(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 71.6%
times-frac97.8%
distribute-frac-neg97.8%
distribute-neg-frac297.8%
+-commutative97.8%
distribute-neg-in97.8%
unsub-neg97.8%
Simplified97.8%
Taylor expanded in t1 around inf 52.4%
Taylor expanded in u around inf 16.2%
herbie shell --seed 2024076 -o generate:simplify
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))