
(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 11 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 (if (<= t1 -3.3e+139) (* (/ t1 (- u t1)) (/ v t1)) (if (<= t1 6.9e+168) (* (/ (- t1) (* (+ u t1) (+ u t1))) v) (/ (- v) t1))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -3.3e+139) {
tmp = (t1 / (u - t1)) * (v / t1);
} else if (t1 <= 6.9e+168) {
tmp = (-t1 / ((u + t1) * (u + t1))) * v;
} else {
tmp = -v / t1;
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if (t1 <= (-3.3d+139)) then
tmp = (t1 / (u - t1)) * (v / t1)
else if (t1 <= 6.9d+168) then
tmp = (-t1 / ((u + t1) * (u + t1))) * v
else
tmp = -v / t1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (t1 <= -3.3e+139) {
tmp = (t1 / (u - t1)) * (v / t1);
} else if (t1 <= 6.9e+168) {
tmp = (-t1 / ((u + t1) * (u + t1))) * v;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if t1 <= -3.3e+139: tmp = (t1 / (u - t1)) * (v / t1) elif t1 <= 6.9e+168: tmp = (-t1 / ((u + t1) * (u + t1))) * v else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if (t1 <= -3.3e+139) tmp = Float64(Float64(t1 / Float64(u - t1)) * Float64(v / t1)); elseif (t1 <= 6.9e+168) tmp = Float64(Float64(Float64(-t1) / Float64(Float64(u + t1) * Float64(u + t1))) * v); else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (t1 <= -3.3e+139) tmp = (t1 / (u - t1)) * (v / t1); elseif (t1 <= 6.9e+168) tmp = (-t1 / ((u + t1) * (u + t1))) * v; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[t1, -3.3e+139], N[(N[(t1 / N[(u - t1), $MachinePrecision]), $MachinePrecision] * N[(v / t1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 6.9e+168], N[(N[((-t1) / N[(N[(u + t1), $MachinePrecision] * N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * v), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -3.3 \cdot 10^{+139}:\\
\;\;\;\;\frac{t1}{u - t1} \cdot \frac{v}{t1}\\
\mathbf{elif}\;t1 \leq 6.9 \cdot 10^{+168}:\\
\;\;\;\;\frac{-t1}{\left(u + t1\right) \cdot \left(u + t1\right)} \cdot v\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if t1 < -3.3000000000000002e139Initial program 32.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6443.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6443.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6443.5
Applied rewrites43.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-neg-inN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6494.6
Applied rewrites94.6%
Applied rewrites99.5%
Taylor expanded in u around 0
lower-/.f6490.3
Applied rewrites90.3%
if -3.3000000000000002e139 < 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%
if 6.8999999999999998e168 < t1 Initial program 36.3%
Taylor expanded in u around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6489.1
Applied rewrites89.1%
Final simplification88.5%
(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 u around 0
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) t1)))
(if (<= t1 -4.9e+113)
t_1
(if (<= t1 6.9e+168) (* (/ (- v) (* (+ u t1) (+ u t1))) t1) t_1))))
double code(double u, double v, double t1) {
double t_1 = -v / t1;
double tmp;
if (t1 <= -4.9e+113) {
tmp = t_1;
} else if (t1 <= 6.9e+168) {
tmp = (-v / ((u + t1) * (u + t1))) * 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
if (t1 <= (-4.9d+113)) then
tmp = t_1
else if (t1 <= 6.9d+168) then
tmp = (-v / ((u + t1) * (u + t1))) * 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;
double tmp;
if (t1 <= -4.9e+113) {
tmp = t_1;
} else if (t1 <= 6.9e+168) {
tmp = (-v / ((u + t1) * (u + t1))) * t1;
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -v / t1 tmp = 0 if t1 <= -4.9e+113: tmp = t_1 elif t1 <= 6.9e+168: tmp = (-v / ((u + t1) * (u + t1))) * t1 else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-v) / t1) tmp = 0.0 if (t1 <= -4.9e+113) tmp = t_1; elseif (t1 <= 6.9e+168) tmp = Float64(Float64(Float64(-v) / Float64(Float64(u + t1) * Float64(u + t1))) * t1); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -v / t1; tmp = 0.0; if (t1 <= -4.9e+113) tmp = t_1; elseif (t1 <= 6.9e+168) tmp = (-v / ((u + t1) * (u + t1))) * t1; else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / t1), $MachinePrecision]}, If[LessEqual[t1, -4.9e+113], t$95$1, If[LessEqual[t1, 6.9e+168], N[(N[((-v) / N[(N[(u + t1), $MachinePrecision] * N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t1), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{t1}\\
\mathbf{if}\;t1 \leq -4.9 \cdot 10^{+113}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 6.9 \cdot 10^{+168}:\\
\;\;\;\;\frac{-v}{\left(u + t1\right) \cdot \left(u + t1\right)} \cdot t1\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -4.90000000000000021e113 or 6.8999999999999998e168 < t1 Initial program 37.6%
Taylor expanded in u around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6487.5
Applied rewrites87.5%
if -4.90000000000000021e113 < t1 < 6.8999999999999998e168Initial program 83.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6485.4
lift-+.f64N/A
+-commutativeN/A
lower-+.f6485.4
lift-+.f64N/A
+-commutativeN/A
lower-+.f6485.4
Applied rewrites85.4%
Final simplification86.1%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) (+ u t1))))
(if (<= t1 -2.8e-87)
t_1
(if (<= t1 3.8e+21) (* (/ t1 (* u u)) (- v)) 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 <= 3.8e+21) {
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 <= (-2.8d-87)) then
tmp = t_1
else if (t1 <= 3.8d+21) 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 <= -2.8e-87) {
tmp = t_1;
} else if (t1 <= 3.8e+21) {
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 <= -2.8e-87: tmp = t_1 elif t1 <= 3.8e+21: 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 <= -2.8e-87) tmp = t_1; elseif (t1 <= 3.8e+21) tmp = Float64(Float64(t1 / Float64(u * u)) * Float64(-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 <= -2.8e-87) tmp = t_1; elseif (t1 <= 3.8e+21) 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, -2.8e-87], t$95$1, If[LessEqual[t1, 3.8e+21], 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 -2.8 \cdot 10^{-87}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 3.8 \cdot 10^{+21}:\\
\;\;\;\;\frac{t1}{u \cdot u} \cdot \left(-v\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -2.8000000000000001e-87 or 3.8e21 < 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 u around 0
mul-1-negN/A
lower-neg.f6483.0
Applied rewrites83.0%
if -2.8000000000000001e-87 < t1 < 3.8e21Initial program 84.3%
Taylor expanded in u around inf
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6476.2
Applied rewrites76.2%
Final simplification79.9%
(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
frac-2negN/A
lift-*.f64N/A
distribute-rgt-neg-inN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
times-fracN/A
lift-neg.f64N/A
frac-2negN/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.1e+220) (* (/ t1 (* u u)) v) (if (<= u 2.45e+42) (/ (- v) (+ u t1)) (* (/ v (* u u)) t1))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -2.1e+220) {
tmp = (t1 / (u * u)) * v;
} else if (u <= 2.45e+42) {
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.1d+220)) then
tmp = (t1 / (u * u)) * v
else if (u <= 2.45d+42) 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.1e+220) {
tmp = (t1 / (u * u)) * v;
} else if (u <= 2.45e+42) {
tmp = -v / (u + t1);
} else {
tmp = (v / (u * u)) * t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -2.1e+220: tmp = (t1 / (u * u)) * v elif u <= 2.45e+42: tmp = -v / (u + t1) else: tmp = (v / (u * u)) * t1 return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -2.1e+220) tmp = Float64(Float64(t1 / Float64(u * u)) * v); elseif (u <= 2.45e+42) 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.1e+220) tmp = (t1 / (u * u)) * v; elseif (u <= 2.45e+42) tmp = -v / (u + t1); else tmp = (v / (u * u)) * t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -2.1e+220], N[(N[(t1 / N[(u * u), $MachinePrecision]), $MachinePrecision] * v), $MachinePrecision], If[LessEqual[u, 2.45e+42], 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.1 \cdot 10^{+220}:\\
\;\;\;\;\frac{t1}{u \cdot u} \cdot v\\
\mathbf{elif}\;u \leq 2.45 \cdot 10^{+42}:\\
\;\;\;\;\frac{-v}{u + t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u \cdot u} \cdot t1\\
\end{array}
\end{array}
if u < -2.10000000000000007e220Initial 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%
Applied rewrites92.2%
if -2.10000000000000007e220 < u < 2.4500000000000001e42Initial 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 u around 0
mul-1-negN/A
lower-neg.f6466.2
Applied rewrites66.2%
if 2.4500000000000001e42 < 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
*-commutativeN/A
lift-/.f64N/A
div-invN/A
*-commutativeN/A
associate-*r*N/A
div-invN/A
+-lft-identityN/A
flip3-+N/A
sqr-powN/A
pow-prod-downN/A
lift-neg.f64N/A
lift-neg.f64N/A
sqr-negN/A
pow-prod-downN/A
sqr-powN/A
Applied rewrites54.9%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (* (/ t1 (* u u)) v))) (if (<= u -2.1e+220) t_1 (if (<= u 2.3e+148) (/ (- 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.1e+220) {
tmp = t_1;
} else if (u <= 2.3e+148) {
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.1d+220)) then
tmp = t_1
else if (u <= 2.3d+148) 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.1e+220) {
tmp = t_1;
} else if (u <= 2.3e+148) {
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.1e+220: tmp = t_1 elif u <= 2.3e+148: 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.1e+220) tmp = t_1; elseif (u <= 2.3e+148) 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.1e+220) tmp = t_1; elseif (u <= 2.3e+148) 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.1e+220], t$95$1, If[LessEqual[u, 2.3e+148], 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.1 \cdot 10^{+220}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq 2.3 \cdot 10^{+148}:\\
\;\;\;\;\frac{-v}{u + t1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if u < -2.10000000000000007e220 or 2.3000000000000001e148 < 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%
Applied rewrites67.0%
if -2.10000000000000007e220 < u < 2.3000000000000001e148Initial 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 u around 0
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 u around 0
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 u around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6454.8
Applied rewrites54.8%
(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.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6474.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6474.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6474.6
Applied rewrites74.6%
Taylor expanded in u around inf
unpow2N/A
lower-*.f6445.0
Applied rewrites45.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
Applied rewrites21.9%
Taylor expanded in u around 0
lower-/.f6413.4
Applied rewrites13.4%
herbie shell --seed 2024235
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))