
(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 70.8%
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.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.2
Applied rewrites98.2%
Final simplification98.2%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) (+ u t1))))
(if (<= t1 -2.25e+61)
t_1
(if (<= t1 3.8e-249)
(/ (* (- t1) v) (* (+ u t1) (+ u t1)))
(if (<= t1 1.66e+55) (/ (- t1) (* (/ (+ u t1) v) (+ u t1))) t_1)))))
double code(double u, double v, double t1) {
double t_1 = -v / (u + t1);
double tmp;
if (t1 <= -2.25e+61) {
tmp = t_1;
} else if (t1 <= 3.8e-249) {
tmp = (-t1 * v) / ((u + t1) * (u + t1));
} else if (t1 <= 1.66e+55) {
tmp = -t1 / (((u + t1) / 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 = -v / (u + t1)
if (t1 <= (-2.25d+61)) then
tmp = t_1
else if (t1 <= 3.8d-249) then
tmp = (-t1 * v) / ((u + t1) * (u + t1))
else if (t1 <= 1.66d+55) then
tmp = -t1 / (((u + t1) / 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 = -v / (u + t1);
double tmp;
if (t1 <= -2.25e+61) {
tmp = t_1;
} else if (t1 <= 3.8e-249) {
tmp = (-t1 * v) / ((u + t1) * (u + t1));
} else if (t1 <= 1.66e+55) {
tmp = -t1 / (((u + t1) / v) * (u + t1));
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -v / (u + t1) tmp = 0 if t1 <= -2.25e+61: tmp = t_1 elif t1 <= 3.8e-249: tmp = (-t1 * v) / ((u + t1) * (u + t1)) elif t1 <= 1.66e+55: tmp = -t1 / (((u + t1) / v) * (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.25e+61) tmp = t_1; elseif (t1 <= 3.8e-249) tmp = Float64(Float64(Float64(-t1) * v) / Float64(Float64(u + t1) * Float64(u + t1))); elseif (t1 <= 1.66e+55) tmp = Float64(Float64(-t1) / Float64(Float64(Float64(u + t1) / v) * Float64(u + 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.25e+61) tmp = t_1; elseif (t1 <= 3.8e-249) tmp = (-t1 * v) / ((u + t1) * (u + t1)); elseif (t1 <= 1.66e+55) tmp = -t1 / (((u + t1) / v) * (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.25e+61], t$95$1, If[LessEqual[t1, 3.8e-249], N[(N[((-t1) * v), $MachinePrecision] / N[(N[(u + t1), $MachinePrecision] * N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 1.66e+55], N[((-t1) / N[(N[(N[(u + t1), $MachinePrecision] / v), $MachinePrecision] * N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{u + t1}\\
\mathbf{if}\;t1 \leq -2.25 \cdot 10^{+61}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 3.8 \cdot 10^{-249}:\\
\;\;\;\;\frac{\left(-t1\right) \cdot v}{\left(u + t1\right) \cdot \left(u + t1\right)}\\
\mathbf{elif}\;t1 \leq 1.66 \cdot 10^{+55}:\\
\;\;\;\;\frac{-t1}{\frac{u + t1}{v} \cdot \left(u + t1\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -2.25e61 or 1.6599999999999999e55 < t1 Initial program 47.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-/.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.f6486.7
Applied rewrites86.7%
if -2.25e61 < t1 < 3.8000000000000001e-249Initial program 93.3%
if 3.8000000000000001e-249 < t1 < 1.6599999999999999e55Initial program 89.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
clear-numN/A
frac-2negN/A
frac-timesN/A
metadata-evalN/A
lift-neg.f64N/A
remove-double-negN/A
distribute-lft-neg-inN/A
neg-mul-1N/A
remove-double-negN/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-neg.f6496.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6496.6
Applied rewrites96.6%
Final simplification91.0%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) (+ u t1))))
(if (<= t1 -2.25e+61)
t_1
(if (<= t1 1.6e+55) (/ (* (- t1) v) (* (+ u t1) (+ u t1))) t_1))))
double code(double u, double v, double t1) {
double t_1 = -v / (u + t1);
double tmp;
if (t1 <= -2.25e+61) {
tmp = t_1;
} else if (t1 <= 1.6e+55) {
tmp = (-t1 * v) / ((u + t1) * (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.25d+61)) then
tmp = t_1
else if (t1 <= 1.6d+55) then
tmp = (-t1 * v) / ((u + t1) * (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.25e+61) {
tmp = t_1;
} else if (t1 <= 1.6e+55) {
tmp = (-t1 * v) / ((u + t1) * (u + t1));
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -v / (u + t1) tmp = 0 if t1 <= -2.25e+61: tmp = t_1 elif t1 <= 1.6e+55: tmp = (-t1 * v) / ((u + t1) * (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.25e+61) tmp = t_1; elseif (t1 <= 1.6e+55) tmp = Float64(Float64(Float64(-t1) * v) / Float64(Float64(u + t1) * Float64(u + 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.25e+61) tmp = t_1; elseif (t1 <= 1.6e+55) tmp = (-t1 * v) / ((u + t1) * (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.25e+61], t$95$1, If[LessEqual[t1, 1.6e+55], N[(N[((-t1) * v), $MachinePrecision] / N[(N[(u + t1), $MachinePrecision] * N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{u + t1}\\
\mathbf{if}\;t1 \leq -2.25 \cdot 10^{+61}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 1.6 \cdot 10^{+55}:\\
\;\;\;\;\frac{\left(-t1\right) \cdot v}{\left(u + t1\right) \cdot \left(u + t1\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -2.25e61 or 1.6000000000000001e55 < t1 Initial program 47.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-/.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.f6486.7
Applied rewrites86.7%
if -2.25e61 < t1 < 1.6000000000000001e55Initial program 91.7%
Final simplification89.4%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) (+ u t1))))
(if (<= t1 -1.8e-128)
t_1
(if (<= t1 2.9e-74) (* (/ (- v) u) (/ t1 u)) t_1))))
double code(double u, double v, double t1) {
double t_1 = -v / (u + t1);
double tmp;
if (t1 <= -1.8e-128) {
tmp = t_1;
} else if (t1 <= 2.9e-74) {
tmp = (-v / 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 = -v / (u + t1)
if (t1 <= (-1.8d-128)) then
tmp = t_1
else if (t1 <= 2.9d-74) then
tmp = (-v / 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 = -v / (u + t1);
double tmp;
if (t1 <= -1.8e-128) {
tmp = t_1;
} else if (t1 <= 2.9e-74) {
tmp = (-v / u) * (t1 / u);
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -v / (u + t1) tmp = 0 if t1 <= -1.8e-128: tmp = t_1 elif t1 <= 2.9e-74: tmp = (-v / u) * (t1 / u) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-v) / Float64(u + t1)) tmp = 0.0 if (t1 <= -1.8e-128) tmp = t_1; elseif (t1 <= 2.9e-74) tmp = Float64(Float64(Float64(-v) / u) * Float64(t1 / u)); 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 <= -1.8e-128) tmp = t_1; elseif (t1 <= 2.9e-74) tmp = (-v / u) * (t1 / u); 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, -1.8e-128], t$95$1, If[LessEqual[t1, 2.9e-74], N[(N[((-v) / u), $MachinePrecision] * N[(t1 / u), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{u + t1}\\
\mathbf{if}\;t1 \leq -1.8 \cdot 10^{-128}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 2.9 \cdot 10^{-74}:\\
\;\;\;\;\frac{-v}{u} \cdot \frac{t1}{u}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -1.80000000000000012e-128 or 2.9e-74 < t1 Initial program 63.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-/.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.f6481.9
Applied rewrites81.9%
if -1.80000000000000012e-128 < t1 < 2.9e-74Initial program 87.5%
Taylor expanded in u around inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
neg-mul-1N/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
lower-/.f6488.3
Applied rewrites88.3%
Final simplification83.9%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) (+ u t1))))
(if (<= t1 -1.8e-128)
t_1
(if (<= t1 2.9e-74) (* (/ (- t1) (* u u)) v) t_1))))
double code(double u, double v, double t1) {
double t_1 = -v / (u + t1);
double tmp;
if (t1 <= -1.8e-128) {
tmp = t_1;
} else if (t1 <= 2.9e-74) {
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 <= (-1.8d-128)) then
tmp = t_1
else if (t1 <= 2.9d-74) 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 <= -1.8e-128) {
tmp = t_1;
} else if (t1 <= 2.9e-74) {
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 <= -1.8e-128: tmp = t_1 elif t1 <= 2.9e-74: 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 <= -1.8e-128) tmp = t_1; elseif (t1 <= 2.9e-74) 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 <= -1.8e-128) tmp = t_1; elseif (t1 <= 2.9e-74) 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, -1.8e-128], t$95$1, If[LessEqual[t1, 2.9e-74], 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 -1.8 \cdot 10^{-128}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 2.9 \cdot 10^{-74}:\\
\;\;\;\;\frac{-t1}{u \cdot u} \cdot v\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -1.80000000000000012e-128 or 2.9e-74 < t1 Initial program 63.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-/.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.f6481.9
Applied rewrites81.9%
if -1.80000000000000012e-128 < t1 < 2.9e-74Initial program 87.5%
Taylor expanded in u around inf
unpow2N/A
lower-*.f6485.7
Applied rewrites85.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6487.2
Applied rewrites87.2%
Final simplification83.6%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (* (/ t1 (* u u)) v))) (if (<= u -1.3e+128) t_1 (if (<= u 6.5e+157) (/ (- v) (+ u t1)) t_1))))
double code(double u, double v, double t1) {
double t_1 = (t1 / (u * u)) * v;
double tmp;
if (u <= -1.3e+128) {
tmp = t_1;
} else if (u <= 6.5e+157) {
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 <= (-1.3d+128)) then
tmp = t_1
else if (u <= 6.5d+157) 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 <= -1.3e+128) {
tmp = t_1;
} else if (u <= 6.5e+157) {
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 <= -1.3e+128: tmp = t_1 elif u <= 6.5e+157: 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 <= -1.3e+128) tmp = t_1; elseif (u <= 6.5e+157) 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 <= -1.3e+128) tmp = t_1; elseif (u <= 6.5e+157) 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, -1.3e+128], t$95$1, If[LessEqual[u, 6.5e+157], 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 -1.3 \cdot 10^{+128}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq 6.5 \cdot 10^{+157}:\\
\;\;\;\;\frac{-v}{u + t1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if u < -1.3e128 or 6.5e157 < u Initial program 71.0%
Taylor expanded in u around inf
unpow2N/A
lower-*.f6471.0
Applied rewrites71.0%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6470.2
Applied rewrites70.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6470.2
Applied rewrites65.9%
if -1.3e128 < u < 6.5e157Initial program 70.7%
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-/.f6497.7
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.7
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.7
Applied rewrites97.7%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6472.8
Applied rewrites72.8%
(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 70.8%
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.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.2
Applied rewrites98.2%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6466.0
Applied rewrites66.0%
(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 70.8%
Taylor expanded in u around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6459.3
Applied rewrites59.3%
(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 70.8%
Taylor expanded in u around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6459.3
Applied rewrites59.3%
Applied rewrites59.1%
Applied rewrites16.2%
herbie shell --seed 2024288
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))