
(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 (/ (* 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(t1 * Float64(v / Float64(t1 + u))) / Float64(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 * N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[((-t1) - u), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{t1 \cdot \frac{v}{t1 + u}}{\left(-t1\right) - u}
\end{array}
Initial program 76.6%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
lift-neg.f64N/A
distribute-frac-negN/A
distribute-frac-neg2N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f6497.8
Applied rewrites97.8%
Final simplification97.8%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (- (* (/ v (+ t1 u)) (- 1.0 (/ u t1))))))
(if (<= t1 -4.7e+154)
t_1
(if (<= t1 4.5e+156) (* v (/ (- t1) (* (+ t1 u) (+ t1 u)))) t_1))))
double code(double u, double v, double t1) {
double t_1 = -((v / (t1 + u)) * (1.0 - (u / t1)));
double tmp;
if (t1 <= -4.7e+154) {
tmp = t_1;
} else if (t1 <= 4.5e+156) {
tmp = v * (-t1 / ((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 = -((v / (t1 + u)) * (1.0d0 - (u / t1)))
if (t1 <= (-4.7d+154)) then
tmp = t_1
else if (t1 <= 4.5d+156) then
tmp = v * (-t1 / ((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 = -((v / (t1 + u)) * (1.0 - (u / t1)));
double tmp;
if (t1 <= -4.7e+154) {
tmp = t_1;
} else if (t1 <= 4.5e+156) {
tmp = v * (-t1 / ((t1 + u) * (t1 + u)));
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -((v / (t1 + u)) * (1.0 - (u / t1))) tmp = 0 if t1 <= -4.7e+154: tmp = t_1 elif t1 <= 4.5e+156: tmp = v * (-t1 / ((t1 + u) * (t1 + u))) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(-Float64(Float64(v / Float64(t1 + u)) * Float64(1.0 - Float64(u / t1)))) tmp = 0.0 if (t1 <= -4.7e+154) tmp = t_1; elseif (t1 <= 4.5e+156) tmp = Float64(v * Float64(Float64(-t1) / Float64(Float64(t1 + u) * Float64(t1 + u)))); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -((v / (t1 + u)) * (1.0 - (u / t1))); tmp = 0.0; if (t1 <= -4.7e+154) tmp = t_1; elseif (t1 <= 4.5e+156) tmp = v * (-t1 / ((t1 + u) * (t1 + u))); 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[(1.0 - N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[t1, -4.7e+154], t$95$1, If[LessEqual[t1, 4.5e+156], N[(v * N[((-t1) / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -\frac{v}{t1 + u} \cdot \left(1 - \frac{u}{t1}\right)\\
\mathbf{if}\;t1 \leq -4.7 \cdot 10^{+154}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 4.5 \cdot 10^{+156}:\\
\;\;\;\;v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -4.69999999999999983e154 or 4.50000000000000031e156 < t1 Initial program 45.5%
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
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in t1 around inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f6494.9
Applied rewrites94.9%
if -4.69999999999999983e154 < t1 < 4.50000000000000031e156Initial program 87.0%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6489.3
Applied rewrites89.3%
Final simplification90.7%
(FPCore (u v t1)
:precision binary64
(if (<= t1 -4.7e+154)
(* (- 1.0 (/ u t1)) (- (/ v t1)))
(if (<= t1 4.5e+156)
(* v (/ (- t1) (* (+ t1 u) (+ t1 u))))
(* v (/ (fma u (/ 2.0 t1) -1.0) t1)))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -4.7e+154) {
tmp = (1.0 - (u / t1)) * -(v / t1);
} else if (t1 <= 4.5e+156) {
tmp = v * (-t1 / ((t1 + u) * (t1 + u)));
} else {
tmp = v * (fma(u, (2.0 / t1), -1.0) / t1);
}
return tmp;
}
function code(u, v, t1) tmp = 0.0 if (t1 <= -4.7e+154) tmp = Float64(Float64(1.0 - Float64(u / t1)) * Float64(-Float64(v / t1))); elseif (t1 <= 4.5e+156) tmp = Float64(v * Float64(Float64(-t1) / Float64(Float64(t1 + u) * Float64(t1 + u)))); else tmp = Float64(v * Float64(fma(u, Float64(2.0 / t1), -1.0) / t1)); end return tmp end
code[u_, v_, t1_] := If[LessEqual[t1, -4.7e+154], N[(N[(1.0 - N[(u / t1), $MachinePrecision]), $MachinePrecision] * (-N[(v / t1), $MachinePrecision])), $MachinePrecision], If[LessEqual[t1, 4.5e+156], N[(v * N[((-t1) / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(v * N[(N[(u * N[(2.0 / t1), $MachinePrecision] + -1.0), $MachinePrecision] / t1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -4.7 \cdot 10^{+154}:\\
\;\;\;\;\left(1 - \frac{u}{t1}\right) \cdot \left(-\frac{v}{t1}\right)\\
\mathbf{elif}\;t1 \leq 4.5 \cdot 10^{+156}:\\
\;\;\;\;v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\
\mathbf{else}:\\
\;\;\;\;v \cdot \frac{\mathsf{fma}\left(u, \frac{2}{t1}, -1\right)}{t1}\\
\end{array}
\end{array}
if t1 < -4.69999999999999983e154Initial program 47.2%
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
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in t1 around inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6492.4
Applied rewrites92.4%
Taylor expanded in t1 around inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f6492.6
Applied rewrites92.6%
if -4.69999999999999983e154 < t1 < 4.50000000000000031e156Initial program 87.0%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6489.3
Applied rewrites89.3%
if 4.50000000000000031e156 < t1 Initial program 43.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6445.4
Applied rewrites45.4%
Taylor expanded in t1 around inf
lower-/.f64N/A
sub-negN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f6495.9
Applied rewrites95.9%
Final simplification90.6%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (* (- 1.0 (/ u t1)) (- (/ v t1)))))
(if (<= t1 -4.7e+154)
t_1
(if (<= t1 4.5e+156) (* v (/ (- t1) (* (+ t1 u) (+ t1 u)))) t_1))))
double code(double u, double v, double t1) {
double t_1 = (1.0 - (u / t1)) * -(v / t1);
double tmp;
if (t1 <= -4.7e+154) {
tmp = t_1;
} else if (t1 <= 4.5e+156) {
tmp = v * (-t1 / ((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 - (u / t1)) * -(v / t1)
if (t1 <= (-4.7d+154)) then
tmp = t_1
else if (t1 <= 4.5d+156) then
tmp = v * (-t1 / ((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 - (u / t1)) * -(v / t1);
double tmp;
if (t1 <= -4.7e+154) {
tmp = t_1;
} else if (t1 <= 4.5e+156) {
tmp = v * (-t1 / ((t1 + u) * (t1 + u)));
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = (1.0 - (u / t1)) * -(v / t1) tmp = 0 if t1 <= -4.7e+154: tmp = t_1 elif t1 <= 4.5e+156: tmp = v * (-t1 / ((t1 + u) * (t1 + u))) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(1.0 - Float64(u / t1)) * Float64(-Float64(v / t1))) tmp = 0.0 if (t1 <= -4.7e+154) tmp = t_1; elseif (t1 <= 4.5e+156) tmp = Float64(v * Float64(Float64(-t1) / Float64(Float64(t1 + u) * Float64(t1 + u)))); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = (1.0 - (u / t1)) * -(v / t1); tmp = 0.0; if (t1 <= -4.7e+154) tmp = t_1; elseif (t1 <= 4.5e+156) tmp = v * (-t1 / ((t1 + u) * (t1 + u))); else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(N[(1.0 - N[(u / t1), $MachinePrecision]), $MachinePrecision] * (-N[(v / t1), $MachinePrecision])), $MachinePrecision]}, If[LessEqual[t1, -4.7e+154], t$95$1, If[LessEqual[t1, 4.5e+156], N[(v * N[((-t1) / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(1 - \frac{u}{t1}\right) \cdot \left(-\frac{v}{t1}\right)\\
\mathbf{if}\;t1 \leq -4.7 \cdot 10^{+154}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 4.5 \cdot 10^{+156}:\\
\;\;\;\;v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -4.69999999999999983e154 or 4.50000000000000031e156 < t1 Initial program 45.5%
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
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in t1 around inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6493.8
Applied rewrites93.8%
Taylor expanded in t1 around inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f6494.0
Applied rewrites94.0%
if -4.69999999999999983e154 < t1 < 4.50000000000000031e156Initial program 87.0%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6489.3
Applied rewrites89.3%
Final simplification90.5%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (- (/ v t1))))
(if (<= t1 -7e+153)
t_1
(if (<= t1 4.5e+156) (* v (/ (- t1) (* (+ t1 u) (+ t1 u)))) t_1))))
double code(double u, double v, double t1) {
double t_1 = -(v / t1);
double tmp;
if (t1 <= -7e+153) {
tmp = t_1;
} else if (t1 <= 4.5e+156) {
tmp = v * (-t1 / ((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 = -(v / t1)
if (t1 <= (-7d+153)) then
tmp = t_1
else if (t1 <= 4.5d+156) then
tmp = v * (-t1 / ((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 = -(v / t1);
double tmp;
if (t1 <= -7e+153) {
tmp = t_1;
} else if (t1 <= 4.5e+156) {
tmp = v * (-t1 / ((t1 + u) * (t1 + u)));
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -(v / t1) tmp = 0 if t1 <= -7e+153: tmp = t_1 elif t1 <= 4.5e+156: tmp = v * (-t1 / ((t1 + u) * (t1 + u))) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(-Float64(v / t1)) tmp = 0.0 if (t1 <= -7e+153) tmp = t_1; elseif (t1 <= 4.5e+156) tmp = Float64(v * Float64(Float64(-t1) / Float64(Float64(t1 + u) * Float64(t1 + u)))); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -(v / t1); tmp = 0.0; if (t1 <= -7e+153) tmp = t_1; elseif (t1 <= 4.5e+156) tmp = v * (-t1 / ((t1 + u) * (t1 + u))); else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = (-N[(v / t1), $MachinePrecision])}, If[LessEqual[t1, -7e+153], t$95$1, If[LessEqual[t1, 4.5e+156], N[(v * N[((-t1) / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -\frac{v}{t1}\\
\mathbf{if}\;t1 \leq -7 \cdot 10^{+153}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 4.5 \cdot 10^{+156}:\\
\;\;\;\;v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -6.9999999999999998e153 or 4.50000000000000031e156 < t1 Initial program 45.6%
Taylor expanded in t1 around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6492.7
Applied rewrites92.7%
if -6.9999999999999998e153 < t1 < 4.50000000000000031e156Initial program 87.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6489.7
Applied rewrites89.7%
Final simplification90.5%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (* (/ v (+ t1 u)) (- 1.0)))) (if (<= t1 -4e-9) t_1 (if (<= t1 1.12e-116) (* v (/ (- t1) (* u u))) t_1))))
double code(double u, double v, double t1) {
double t_1 = (v / (t1 + u)) * -1.0;
double tmp;
if (t1 <= -4e-9) {
tmp = t_1;
} else if (t1 <= 1.12e-116) {
tmp = v * (-t1 / (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)) * -1.0d0
if (t1 <= (-4d-9)) then
tmp = t_1
else if (t1 <= 1.12d-116) then
tmp = v * (-t1 / (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)) * -1.0;
double tmp;
if (t1 <= -4e-9) {
tmp = t_1;
} else if (t1 <= 1.12e-116) {
tmp = v * (-t1 / (u * u));
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = (v / (t1 + u)) * -1.0 tmp = 0 if t1 <= -4e-9: tmp = t_1 elif t1 <= 1.12e-116: tmp = v * (-t1 / (u * u)) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(v / Float64(t1 + u)) * Float64(-1.0)) tmp = 0.0 if (t1 <= -4e-9) tmp = t_1; elseif (t1 <= 1.12e-116) tmp = Float64(v * Float64(Float64(-t1) / Float64(u * u))); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = (v / (t1 + u)) * -1.0; tmp = 0.0; if (t1 <= -4e-9) tmp = t_1; elseif (t1 <= 1.12e-116) tmp = v * (-t1 / (u * u)); 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] * (-1.0)), $MachinePrecision]}, If[LessEqual[t1, -4e-9], t$95$1, If[LessEqual[t1, 1.12e-116], N[(v * N[((-t1) / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{v}{t1 + u} \cdot \left(-1\right)\\
\mathbf{if}\;t1 \leq -4 \cdot 10^{-9}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 1.12 \cdot 10^{-116}:\\
\;\;\;\;v \cdot \frac{-t1}{u \cdot u}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -4.00000000000000025e-9 or 1.12e-116 < t1 Initial program 70.7%
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
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in t1 around inf
Applied rewrites82.8%
if -4.00000000000000025e-9 < t1 < 1.12e-116Initial program 85.8%
Taylor expanded in t1 around 0
unpow2N/A
lower-*.f6479.2
Applied rewrites79.2%
lift-/.f64N/A
frac-2negN/A
lift-*.f64N/A
lift-neg.f64N/A
distribute-lft-neg-outN/A
remove-double-negN/A
*-commutativeN/A
neg-mul-1N/A
times-fracN/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
neg-mul-1N/A
lift-neg.f64N/A
lower-*.f64N/A
lower-/.f6479.8
Applied rewrites79.8%
Final simplification81.6%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (* (/ v (+ t1 u)) (- 1.0)))) (if (<= t1 -4e-9) t_1 (if (<= t1 1.12e-116) (* t1 (/ v (* u (- u)))) t_1))))
double code(double u, double v, double t1) {
double t_1 = (v / (t1 + u)) * -1.0;
double tmp;
if (t1 <= -4e-9) {
tmp = t_1;
} else if (t1 <= 1.12e-116) {
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)) * -1.0d0
if (t1 <= (-4d-9)) then
tmp = t_1
else if (t1 <= 1.12d-116) 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)) * -1.0;
double tmp;
if (t1 <= -4e-9) {
tmp = t_1;
} else if (t1 <= 1.12e-116) {
tmp = t1 * (v / (u * -u));
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = (v / (t1 + u)) * -1.0 tmp = 0 if t1 <= -4e-9: tmp = t_1 elif t1 <= 1.12e-116: tmp = t1 * (v / (u * -u)) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(v / Float64(t1 + u)) * Float64(-1.0)) tmp = 0.0 if (t1 <= -4e-9) tmp = t_1; elseif (t1 <= 1.12e-116) tmp = Float64(t1 * Float64(v / Float64(u * Float64(-u)))); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = (v / (t1 + u)) * -1.0; tmp = 0.0; if (t1 <= -4e-9) tmp = t_1; elseif (t1 <= 1.12e-116) tmp = t1 * (v / (u * -u)); 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] * (-1.0)), $MachinePrecision]}, If[LessEqual[t1, -4e-9], t$95$1, If[LessEqual[t1, 1.12e-116], N[(t1 * N[(v / N[(u * (-u)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{v}{t1 + u} \cdot \left(-1\right)\\
\mathbf{if}\;t1 \leq -4 \cdot 10^{-9}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 1.12 \cdot 10^{-116}:\\
\;\;\;\;t1 \cdot \frac{v}{u \cdot \left(-u\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -4.00000000000000025e-9 or 1.12e-116 < t1 Initial program 70.7%
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
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in t1 around inf
Applied rewrites82.8%
if -4.00000000000000025e-9 < t1 < 1.12e-116Initial program 85.8%
Taylor expanded in t1 around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
unpow2N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6476.2
Applied rewrites76.2%
Final simplification80.2%
(FPCore (u v t1) :precision binary64 (- (/ (* v (/ t1 (+ t1 u))) (+ t1 u))))
double code(double u, double v, double t1) {
return -((v * (t1 / (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 = -((v * (t1 / (t1 + u))) / (t1 + u))
end function
public static double code(double u, double v, double t1) {
return -((v * (t1 / (t1 + u))) / (t1 + u));
}
def code(u, v, t1): return -((v * (t1 / (t1 + u))) / (t1 + u))
function code(u, v, t1) return Float64(-Float64(Float64(v * Float64(t1 / Float64(t1 + u))) / Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = -((v * (t1 / (t1 + u))) / (t1 + u)); end
code[u_, v_, t1_] := (-N[(N[(v * N[(t1 / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision])
\begin{array}{l}
\\
-\frac{v \cdot \frac{t1}{t1 + u}}{t1 + u}
\end{array}
Initial program 76.6%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
lift-neg.f64N/A
distribute-frac-negN/A
distribute-frac-neg2N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f6497.8
Applied rewrites97.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lift-/.f64N/A
lower-*.f6497.6
Applied rewrites97.6%
Final simplification97.6%
(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 + u)) * Float64(-Float64(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 + u), $MachinePrecision]), $MachinePrecision] * (-N[(t1 / N[(t1 + u), $MachinePrecision]), $MachinePrecision])), $MachinePrecision]
\begin{array}{l}
\\
\frac{v}{t1 + u} \cdot \left(-\frac{t1}{t1 + u}\right)
\end{array}
Initial program 76.6%
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
lower-/.f6497.6
Applied rewrites97.6%
Final simplification97.6%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (/ (* v 1.0) (- u)))) (if (<= u -5.6e+106) t_1 (if (<= u 2.25e+201) (- (/ v t1)) t_1))))
double code(double u, double v, double t1) {
double t_1 = (v * 1.0) / -u;
double tmp;
if (u <= -5.6e+106) {
tmp = t_1;
} else if (u <= 2.25e+201) {
tmp = -(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 * 1.0d0) / -u
if (u <= (-5.6d+106)) then
tmp = t_1
else if (u <= 2.25d+201) then
tmp = -(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 * 1.0) / -u;
double tmp;
if (u <= -5.6e+106) {
tmp = t_1;
} else if (u <= 2.25e+201) {
tmp = -(v / t1);
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = (v * 1.0) / -u tmp = 0 if u <= -5.6e+106: tmp = t_1 elif u <= 2.25e+201: tmp = -(v / t1) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(v * 1.0) / Float64(-u)) tmp = 0.0 if (u <= -5.6e+106) tmp = t_1; elseif (u <= 2.25e+201) tmp = Float64(-Float64(v / t1)); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = (v * 1.0) / -u; tmp = 0.0; if (u <= -5.6e+106) tmp = t_1; elseif (u <= 2.25e+201) tmp = -(v / t1); else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(N[(v * 1.0), $MachinePrecision] / (-u)), $MachinePrecision]}, If[LessEqual[u, -5.6e+106], t$95$1, If[LessEqual[u, 2.25e+201], (-N[(v / t1), $MachinePrecision]), t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{v \cdot 1}{-u}\\
\mathbf{if}\;u \leq -5.6 \cdot 10^{+106}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq 2.25 \cdot 10^{+201}:\\
\;\;\;\;-\frac{v}{t1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if u < -5.59999999999999986e106 or 2.25000000000000005e201 < u Initial program 79.2%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
lift-neg.f64N/A
distribute-frac-negN/A
distribute-frac-neg2N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lift-/.f64N/A
lower-*.f6496.5
Applied rewrites96.5%
Taylor expanded in t1 around inf
Applied rewrites53.6%
Taylor expanded in t1 around 0
mul-1-negN/A
lower-neg.f6445.0
Applied rewrites45.0%
if -5.59999999999999986e106 < u < 2.25000000000000005e201Initial program 75.7%
Taylor expanded in t1 around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6465.7
Applied rewrites65.7%
Final simplification60.3%
(FPCore (u v t1) :precision binary64 (* (/ v (+ t1 u)) (- 1.0)))
double code(double u, double v, double t1) {
return (v / (t1 + u)) * -1.0;
}
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)) * -1.0d0
end function
public static double code(double u, double v, double t1) {
return (v / (t1 + u)) * -1.0;
}
def code(u, v, t1): return (v / (t1 + u)) * -1.0
function code(u, v, t1) return Float64(Float64(v / Float64(t1 + u)) * Float64(-1.0)) end
function tmp = code(u, v, t1) tmp = (v / (t1 + u)) * -1.0; end
code[u_, v_, t1_] := N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * (-1.0)), $MachinePrecision]
\begin{array}{l}
\\
\frac{v}{t1 + u} \cdot \left(-1\right)
\end{array}
Initial program 76.6%
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
lower-/.f6497.6
Applied rewrites97.6%
Taylor expanded in t1 around inf
Applied rewrites62.3%
Final simplification62.3%
(FPCore (u v t1) :precision binary64 (* (- v) (/ 1.0 (+ t1 u))))
double code(double u, double v, double t1) {
return -v * (1.0 / (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 * (1.0d0 / (t1 + u))
end function
public static double code(double u, double v, double t1) {
return -v * (1.0 / (t1 + u));
}
def code(u, v, t1): return -v * (1.0 / (t1 + u))
function code(u, v, t1) return Float64(Float64(-v) * Float64(1.0 / Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = -v * (1.0 / (t1 + u)); end
code[u_, v_, t1_] := N[((-v) * N[(1.0 / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-v\right) \cdot \frac{1}{t1 + u}
\end{array}
Initial program 76.6%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
lift-neg.f64N/A
distribute-frac-negN/A
distribute-frac-neg2N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f6497.8
Applied rewrites97.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lift-/.f64N/A
lower-*.f6497.6
Applied rewrites97.6%
Taylor expanded in t1 around inf
Applied rewrites62.3%
lift-/.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
neg-mul-1N/A
*-commutativeN/A
times-fracN/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
neg-mul-1N/A
lift-neg.f64N/A
lower-*.f64N/A
lower-/.f6462.2
Applied rewrites62.2%
Final simplification62.2%
(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 76.6%
Taylor expanded in t1 around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6454.2
Applied rewrites54.2%
Final simplification54.2%
herbie shell --seed 2024226
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))