
(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 (+ 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(Float64(t1 / Float64(u + t1)) * v) / Float64(Float64(-t1) - u)) end
function tmp = code(u, v, t1) tmp = ((t1 / (u + t1)) * v) / (-t1 - u); end
code[u_, v_, t1_] := N[(N[(N[(t1 / N[(u + t1), $MachinePrecision]), $MachinePrecision] * v), $MachinePrecision] / N[((-t1) - u), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{t1}{u + t1} \cdot v}{\left(-t1\right) - u}
\end{array}
Initial program 68.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
associate-/l*N/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6498.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.6
Applied rewrites98.6%
Final simplification98.6%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) t1)))
(if (<= t1 -1.35e+139)
t_1
(if (<= t1 6.9e+168) (* (/ (- t1) (* (+ u t1) (+ u t1))) v) t_1))))
double code(double u, double v, double t1) {
double t_1 = -v / t1;
double tmp;
if (t1 <= -1.35e+139) {
tmp = t_1;
} else if (t1 <= 6.9e+168) {
tmp = (-t1 / ((u + t1) * (u + t1))) * v;
} 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
if (t1 <= (-1.35d+139)) then
tmp = t_1
else if (t1 <= 6.9d+168) then
tmp = (-t1 / ((u + t1) * (u + t1))) * v
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;
double tmp;
if (t1 <= -1.35e+139) {
tmp = t_1;
} else if (t1 <= 6.9e+168) {
tmp = (-t1 / ((u + t1) * (u + t1))) * v;
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -v / t1 tmp = 0 if t1 <= -1.35e+139: tmp = t_1 elif t1 <= 6.9e+168: tmp = (-t1 / ((u + t1) * (u + t1))) * v else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-v) / t1) tmp = 0.0 if (t1 <= -1.35e+139) tmp = t_1; elseif (t1 <= 6.9e+168) tmp = Float64(Float64(Float64(-t1) / Float64(Float64(u + t1) * Float64(u + t1))) * v); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -v / t1; tmp = 0.0; if (t1 <= -1.35e+139) tmp = t_1; elseif (t1 <= 6.9e+168) tmp = (-t1 / ((u + t1) * (u + t1))) * v; else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / t1), $MachinePrecision]}, If[LessEqual[t1, -1.35e+139], t$95$1, If[LessEqual[t1, 6.9e+168], N[(N[((-t1) / N[(N[(u + t1), $MachinePrecision] * N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * v), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{t1}\\
\mathbf{if}\;t1 \leq -1.35 \cdot 10^{+139}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 6.9 \cdot 10^{+168}:\\
\;\;\;\;\frac{-t1}{\left(u + t1\right) \cdot \left(u + t1\right)} \cdot v\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -1.3499999999999999e139 or 6.8999999999999998e168 < t1 Initial program 34.3%
Taylor expanded in t1 around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6489.7
Applied rewrites89.7%
if -1.3499999999999999e139 < t1 < 6.8999999999999998e168Initial program 81.9%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6488.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f6488.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f6488.0
Applied rewrites88.0%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) (+ u t1))))
(if (<= t1 -3.9e-88)
t_1
(if (<= t1 2.3e+23) (* (/ (- t1) (* u u)) v) t_1))))
double code(double u, double v, double t1) {
double t_1 = -v / (u + t1);
double tmp;
if (t1 <= -3.9e-88) {
tmp = t_1;
} else if (t1 <= 2.3e+23) {
tmp = (-t1 / (u * u)) * v;
} 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 + t1)
if (t1 <= (-3.9d-88)) then
tmp = t_1
else if (t1 <= 2.3d+23) then
tmp = (-t1 / (u * u)) * v
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 + t1);
double tmp;
if (t1 <= -3.9e-88) {
tmp = t_1;
} else if (t1 <= 2.3e+23) {
tmp = (-t1 / (u * u)) * v;
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -v / (u + t1) tmp = 0 if t1 <= -3.9e-88: tmp = t_1 elif t1 <= 2.3e+23: tmp = (-t1 / (u * u)) * v else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-v) / Float64(u + t1)) tmp = 0.0 if (t1 <= -3.9e-88) tmp = t_1; elseif (t1 <= 2.3e+23) tmp = Float64(Float64(Float64(-t1) / Float64(u * u)) * v); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -v / (u + t1); tmp = 0.0; if (t1 <= -3.9e-88) tmp = t_1; elseif (t1 <= 2.3e+23) tmp = (-t1 / (u * u)) * v; else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -3.9e-88], t$95$1, If[LessEqual[t1, 2.3e+23], N[(N[((-t1) / N[(u * u), $MachinePrecision]), $MachinePrecision] * v), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{u + t1}\\
\mathbf{if}\;t1 \leq -3.9 \cdot 10^{-88}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 2.3 \cdot 10^{+23}:\\
\;\;\;\;\frac{-t1}{u \cdot u} \cdot v\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -3.89999999999999992e-88 or 2.3e23 < t1 Initial program 54.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
associate-/l*N/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
Taylor expanded in t1 around inf
mul-1-negN/A
lower-neg.f6483.0
Applied rewrites83.0%
if -3.89999999999999992e-88 < t1 < 2.3e23Initial program 84.3%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6488.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6488.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6488.8
Applied rewrites88.8%
Taylor expanded in u around inf
unpow2N/A
lower-*.f6476.2
Applied rewrites76.2%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) (+ u t1))))
(if (<= t1 -2.8e-87)
t_1
(if (<= t1 2.3e+23) (* (/ v (* u u)) (- t1)) t_1))))
double code(double u, double v, double t1) {
double t_1 = -v / (u + t1);
double tmp;
if (t1 <= -2.8e-87) {
tmp = t_1;
} else if (t1 <= 2.3e+23) {
tmp = (v / (u * u)) * -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 + t1)
if (t1 <= (-2.8d-87)) then
tmp = t_1
else if (t1 <= 2.3d+23) then
tmp = (v / (u * u)) * -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 + t1);
double tmp;
if (t1 <= -2.8e-87) {
tmp = t_1;
} else if (t1 <= 2.3e+23) {
tmp = (v / (u * u)) * -t1;
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -v / (u + t1) tmp = 0 if t1 <= -2.8e-87: tmp = t_1 elif t1 <= 2.3e+23: tmp = (v / (u * u)) * -t1 else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-v) / Float64(u + t1)) tmp = 0.0 if (t1 <= -2.8e-87) tmp = t_1; elseif (t1 <= 2.3e+23) tmp = Float64(Float64(v / Float64(u * u)) * Float64(-t1)); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -v / (u + t1); tmp = 0.0; if (t1 <= -2.8e-87) tmp = t_1; elseif (t1 <= 2.3e+23) tmp = (v / (u * u)) * -t1; else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -2.8e-87], t$95$1, If[LessEqual[t1, 2.3e+23], N[(N[(v / N[(u * u), $MachinePrecision]), $MachinePrecision] * (-t1)), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{u + t1}\\
\mathbf{if}\;t1 \leq -2.8 \cdot 10^{-87}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 2.3 \cdot 10^{+23}:\\
\;\;\;\;\frac{v}{u \cdot u} \cdot \left(-t1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -2.8000000000000001e-87 or 2.3e23 < t1 Initial program 54.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
associate-/l*N/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
Taylor expanded in t1 around inf
mul-1-negN/A
lower-neg.f6483.0
Applied rewrites83.0%
if -2.8000000000000001e-87 < t1 < 2.3e23Initial program 84.3%
Taylor expanded in t1 around 0
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6475.4
Applied rewrites75.4%
Final simplification79.6%
(FPCore (u v t1) :precision binary64 (* (/ (- v) (+ u t1)) (/ t1 (+ u t1))))
double code(double u, double v, double t1) {
return (-v / (u + t1)) * (t1 / (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)) * (t1 / (u + t1))
end function
public static double code(double u, double v, double t1) {
return (-v / (u + t1)) * (t1 / (u + t1));
}
def code(u, v, t1): return (-v / (u + t1)) * (t1 / (u + t1))
function code(u, v, t1) return Float64(Float64(Float64(-v) / Float64(u + t1)) * Float64(t1 / Float64(u + t1))) end
function tmp = code(u, v, t1) tmp = (-v / (u + t1)) * (t1 / (u + t1)); end
code[u_, v_, t1_] := N[(N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision] * N[(t1 / N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-v}{u + t1} \cdot \frac{t1}{u + t1}
\end{array}
Initial program 68.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-neg.f64N/A
neg-mul-1N/A
associate-*r*N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
neg-mul-1N/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f6498.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.6
Applied rewrites98.6%
(FPCore (u v t1) :precision binary64 (if (<= u -2.02e+220) (* (/ t1 (* u u)) v) (if (<= u 6.5e+43) (/ (- v) (+ u t1)) (* (/ v (* u u)) t1))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -2.02e+220) {
tmp = (t1 / (u * u)) * v;
} else if (u <= 6.5e+43) {
tmp = -v / (u + t1);
} else {
tmp = (v / (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 (u <= (-2.02d+220)) then
tmp = (t1 / (u * u)) * v
else if (u <= 6.5d+43) then
tmp = -v / (u + t1)
else
tmp = (v / (u * u)) * t1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -2.02e+220) {
tmp = (t1 / (u * u)) * v;
} else if (u <= 6.5e+43) {
tmp = -v / (u + t1);
} else {
tmp = (v / (u * u)) * t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -2.02e+220: tmp = (t1 / (u * u)) * v elif u <= 6.5e+43: tmp = -v / (u + t1) else: tmp = (v / (u * u)) * t1 return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -2.02e+220) tmp = Float64(Float64(t1 / Float64(u * u)) * v); elseif (u <= 6.5e+43) tmp = Float64(Float64(-v) / Float64(u + t1)); else tmp = Float64(Float64(v / Float64(u * u)) * t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -2.02e+220) tmp = (t1 / (u * u)) * v; elseif (u <= 6.5e+43) tmp = -v / (u + t1); else tmp = (v / (u * u)) * t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -2.02e+220], N[(N[(t1 / N[(u * u), $MachinePrecision]), $MachinePrecision] * v), $MachinePrecision], If[LessEqual[u, 6.5e+43], N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision], N[(N[(v / N[(u * u), $MachinePrecision]), $MachinePrecision] * t1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.02 \cdot 10^{+220}:\\
\;\;\;\;\frac{t1}{u \cdot u} \cdot v\\
\mathbf{elif}\;u \leq 6.5 \cdot 10^{+43}:\\
\;\;\;\;\frac{-v}{u + t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u \cdot u} \cdot t1\\
\end{array}
\end{array}
if u < -2.02000000000000011e220Initial program 91.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6492.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6492.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6492.2
Applied rewrites92.2%
Taylor expanded in u around inf
unpow2N/A
lower-*.f6492.2
Applied rewrites92.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-neg.f64N/A
distribute-lft-neg-outN/A
*-commutativeN/A
lift-*.f64N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
lower-*.f6491.7
Applied rewrites91.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lift-neg.f64N/A
neg-mul-1N/A
associate-*l/N/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites92.2%
if -2.02000000000000011e220 < u < 6.4999999999999998e43Initial program 67.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
associate-/l*N/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6498.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.1
Applied rewrites98.1%
Taylor expanded in t1 around inf
mul-1-negN/A
lower-neg.f6466.2
Applied rewrites66.2%
if 6.4999999999999998e43 < u Initial program 67.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6464.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6464.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6464.5
Applied rewrites64.5%
Taylor expanded in u around inf
unpow2N/A
lower-*.f6461.0
Applied rewrites61.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-neg.f64N/A
distribute-lft-neg-outN/A
*-commutativeN/A
lift-*.f64N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
lower-*.f6464.1
Applied rewrites64.1%
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lift-*.f64N/A
lift-neg.f64N/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
lift-neg.f64N/A
associate-*r*N/A
lift-neg.f64N/A
neg-sub0N/A
flip3--N/A
metadata-evalN/A
neg-sub0N/A
distribute-neg-fracN/A
Applied rewrites54.9%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (* (/ t1 (* u u)) v))) (if (<= u -2.02e+220) t_1 (if (<= u 5e+149) (/ (- v) (+ u t1)) t_1))))
double code(double u, double v, double t1) {
double t_1 = (t1 / (u * u)) * v;
double tmp;
if (u <= -2.02e+220) {
tmp = t_1;
} else if (u <= 5e+149) {
tmp = -v / (u + 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 = (t1 / (u * u)) * v
if (u <= (-2.02d+220)) then
tmp = t_1
else if (u <= 5d+149) then
tmp = -v / (u + t1)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = (t1 / (u * u)) * v;
double tmp;
if (u <= -2.02e+220) {
tmp = t_1;
} else if (u <= 5e+149) {
tmp = -v / (u + t1);
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = (t1 / (u * u)) * v tmp = 0 if u <= -2.02e+220: tmp = t_1 elif u <= 5e+149: tmp = -v / (u + t1) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(t1 / Float64(u * u)) * v) tmp = 0.0 if (u <= -2.02e+220) tmp = t_1; elseif (u <= 5e+149) tmp = Float64(Float64(-v) / Float64(u + t1)); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = (t1 / (u * u)) * v; tmp = 0.0; if (u <= -2.02e+220) tmp = t_1; elseif (u <= 5e+149) tmp = -v / (u + t1); else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(N[(t1 / N[(u * u), $MachinePrecision]), $MachinePrecision] * v), $MachinePrecision]}, If[LessEqual[u, -2.02e+220], t$95$1, If[LessEqual[u, 5e+149], N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t1}{u \cdot u} \cdot v\\
\mathbf{if}\;u \leq -2.02 \cdot 10^{+220}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq 5 \cdot 10^{+149}:\\
\;\;\;\;\frac{-v}{u + t1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if u < -2.02000000000000011e220 or 4.9999999999999999e149 < u Initial program 69.9%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6470.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f6470.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f6470.0
Applied rewrites70.0%
Taylor expanded in u around inf
unpow2N/A
lower-*.f6470.0
Applied rewrites70.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-neg.f64N/A
distribute-lft-neg-outN/A
*-commutativeN/A
lift-*.f64N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
lower-*.f6469.9
Applied rewrites69.9%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lift-neg.f64N/A
neg-mul-1N/A
associate-*l/N/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites67.0%
if -2.02000000000000011e220 < u < 4.9999999999999999e149Initial program 68.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
associate-/l*N/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6498.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.3
Applied rewrites98.3%
Taylor expanded in t1 around inf
mul-1-negN/A
lower-neg.f6463.9
Applied rewrites63.9%
(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(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.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
associate-/l*N/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6498.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.6
Applied rewrites98.6%
Taylor expanded in t1 around inf
mul-1-negN/A
lower-neg.f6459.4
Applied rewrites59.4%
(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 68.4%
Taylor expanded in t1 around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6454.8
Applied rewrites54.8%
herbie shell --seed 2024235
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))