
(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 (/ (* (/ 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(Float64(v / Float64(t1 + u)) * t1) / Float64(-Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = ((v / (t1 + u)) * t1) / -(t1 + u); end
code[u_, v_, t1_] := N[(N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * t1), $MachinePrecision] / (-N[(t1 + u), $MachinePrecision])), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{v}{t1 + u} \cdot t1}{-\left(t1 + u\right)}
\end{array}
Initial program 72.0%
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
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-neg.f6499.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.0
Applied rewrites99.0%
Final simplification99.0%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (* (/ v (+ t1 u)) t1) (- u))))
(if (<= u -1.02e+141)
t_1
(if (<= u 1.05e+199) (/ (- v) (fma (+ 2.0 (/ u t1)) u t1)) t_1))))
double code(double u, double v, double t1) {
double t_1 = ((v / (t1 + u)) * t1) / -u;
double tmp;
if (u <= -1.02e+141) {
tmp = t_1;
} else if (u <= 1.05e+199) {
tmp = -v / fma((2.0 + (u / t1)), u, t1);
} else {
tmp = t_1;
}
return tmp;
}
function code(u, v, t1) t_1 = Float64(Float64(Float64(v / Float64(t1 + u)) * t1) / Float64(-u)) tmp = 0.0 if (u <= -1.02e+141) tmp = t_1; elseif (u <= 1.05e+199) tmp = Float64(Float64(-v) / fma(Float64(2.0 + Float64(u / t1)), u, t1)); else tmp = t_1; end return tmp end
code[u_, v_, t1_] := Block[{t$95$1 = N[(N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * t1), $MachinePrecision] / (-u)), $MachinePrecision]}, If[LessEqual[u, -1.02e+141], t$95$1, If[LessEqual[u, 1.05e+199], N[((-v) / N[(N[(2.0 + N[(u / t1), $MachinePrecision]), $MachinePrecision] * u + t1), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\frac{v}{t1 + u} \cdot t1}{-u}\\
\mathbf{if}\;u \leq -1.02 \cdot 10^{+141}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq 1.05 \cdot 10^{+199}:\\
\;\;\;\;\frac{-v}{\mathsf{fma}\left(2 + \frac{u}{t1}, u, t1\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if u < -1.02e141 or 1.05e199 < u Initial program 77.7%
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
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-neg.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
Taylor expanded in u around inf
mul-1-negN/A
lower-neg.f6497.0
Applied rewrites97.0%
if -1.02e141 < u < 1.05e199Initial program 70.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
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-neg.f6498.7
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.7
Applied rewrites98.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
frac-timesN/A
*-commutativeN/A
remove-double-negN/A
lift-neg.f64N/A
frac-timesN/A
clear-numN/A
lift-neg.f64N/A
frac-2negN/A
frac-timesN/A
*-lft-identityN/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6496.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6496.5
lift-+.f64N/A
+-commutativeN/A
Applied rewrites96.5%
Taylor expanded in u around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f6496.5
Applied rewrites96.5%
Final simplification96.6%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) (fma u 2.0 t1))))
(if (<= t1 -4.8e+140)
t_1
(if (<= t1 4.4e+68) (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))) t_1))))
double code(double u, double v, double t1) {
double t_1 = -v / fma(u, 2.0, t1);
double tmp;
if (t1 <= -4.8e+140) {
tmp = t_1;
} else if (t1 <= 4.4e+68) {
tmp = (-t1 * v) / ((t1 + u) * (t1 + u));
} else {
tmp = t_1;
}
return tmp;
}
function code(u, v, t1) t_1 = Float64(Float64(-v) / fma(u, 2.0, t1)) tmp = 0.0 if (t1 <= -4.8e+140) tmp = t_1; elseif (t1 <= 4.4e+68) tmp = Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u))); else tmp = t_1; end return tmp end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(u * 2.0 + t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -4.8e+140], t$95$1, If[LessEqual[t1, 4.4e+68], N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{\mathsf{fma}\left(u, 2, t1\right)}\\
\mathbf{if}\;t1 \leq -4.8 \cdot 10^{+140}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 4.4 \cdot 10^{+68}:\\
\;\;\;\;\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -4.7999999999999999e140 or 4.39999999999999974e68 < t1 Initial program 52.9%
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
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-neg.f64100.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f64100.0
Applied rewrites100.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
frac-timesN/A
*-commutativeN/A
remove-double-negN/A
lift-neg.f64N/A
frac-timesN/A
clear-numN/A
lift-neg.f64N/A
frac-2negN/A
frac-timesN/A
*-lft-identityN/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6497.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.8
lift-+.f64N/A
+-commutativeN/A
Applied rewrites97.8%
Taylor expanded in u around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f6495.5
Applied rewrites95.5%
if -4.7999999999999999e140 < t1 < 4.39999999999999974e68Initial program 81.9%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) (fma u 2.0 t1))))
(if (<= t1 -3.4e-85)
t_1
(if (<= t1 1.6e+68) (/ (- t1) (* (/ u v) u)) t_1))))
double code(double u, double v, double t1) {
double t_1 = -v / fma(u, 2.0, t1);
double tmp;
if (t1 <= -3.4e-85) {
tmp = t_1;
} else if (t1 <= 1.6e+68) {
tmp = -t1 / ((u / v) * u);
} else {
tmp = t_1;
}
return tmp;
}
function code(u, v, t1) t_1 = Float64(Float64(-v) / fma(u, 2.0, t1)) tmp = 0.0 if (t1 <= -3.4e-85) tmp = t_1; elseif (t1 <= 1.6e+68) tmp = Float64(Float64(-t1) / Float64(Float64(u / v) * u)); else tmp = t_1; end return tmp end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(u * 2.0 + t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -3.4e-85], t$95$1, If[LessEqual[t1, 1.6e+68], N[((-t1) / N[(N[(u / v), $MachinePrecision] * u), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{\mathsf{fma}\left(u, 2, t1\right)}\\
\mathbf{if}\;t1 \leq -3.4 \cdot 10^{-85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 1.6 \cdot 10^{+68}:\\
\;\;\;\;\frac{-t1}{\frac{u}{v} \cdot u}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -3.4e-85 or 1.59999999999999997e68 < t1 Initial program 63.4%
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
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-neg.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
frac-timesN/A
*-commutativeN/A
remove-double-negN/A
lift-neg.f64N/A
frac-timesN/A
clear-numN/A
lift-neg.f64N/A
frac-2negN/A
frac-timesN/A
*-lft-identityN/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6496.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6496.3
lift-+.f64N/A
+-commutativeN/A
Applied rewrites96.3%
Taylor expanded in u around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f6487.2
Applied rewrites87.2%
if -3.4e-85 < t1 < 1.59999999999999997e68Initial program 80.6%
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-/.f6481.2
Applied rewrites81.2%
Applied rewrites81.4%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) (fma u 2.0 t1))))
(if (<= t1 -3.4e-85)
t_1
(if (<= t1 1.6e+68) (* (/ (- v) u) (/ t1 u)) t_1))))
double code(double u, double v, double t1) {
double t_1 = -v / fma(u, 2.0, t1);
double tmp;
if (t1 <= -3.4e-85) {
tmp = t_1;
} else if (t1 <= 1.6e+68) {
tmp = (-v / u) * (t1 / u);
} else {
tmp = t_1;
}
return tmp;
}
function code(u, v, t1) t_1 = Float64(Float64(-v) / fma(u, 2.0, t1)) tmp = 0.0 if (t1 <= -3.4e-85) tmp = t_1; elseif (t1 <= 1.6e+68) tmp = Float64(Float64(Float64(-v) / u) * Float64(t1 / u)); else tmp = t_1; end return tmp end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(u * 2.0 + t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -3.4e-85], t$95$1, If[LessEqual[t1, 1.6e+68], N[(N[((-v) / u), $MachinePrecision] * N[(t1 / u), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{\mathsf{fma}\left(u, 2, t1\right)}\\
\mathbf{if}\;t1 \leq -3.4 \cdot 10^{-85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 1.6 \cdot 10^{+68}:\\
\;\;\;\;\frac{-v}{u} \cdot \frac{t1}{u}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -3.4e-85 or 1.59999999999999997e68 < t1 Initial program 63.4%
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
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-neg.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
frac-timesN/A
*-commutativeN/A
remove-double-negN/A
lift-neg.f64N/A
frac-timesN/A
clear-numN/A
lift-neg.f64N/A
frac-2negN/A
frac-timesN/A
*-lft-identityN/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6496.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6496.3
lift-+.f64N/A
+-commutativeN/A
Applied rewrites96.3%
Taylor expanded in u around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f6487.2
Applied rewrites87.2%
if -3.4e-85 < t1 < 1.59999999999999997e68Initial program 80.6%
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-/.f6481.2
Applied rewrites81.2%
Final simplification84.2%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) (fma u 2.0 t1))))
(if (<= t1 -6.5e-86)
t_1
(if (<= t1 1.6e+68) (* (/ (- v) (* u u)) t1) t_1))))
double code(double u, double v, double t1) {
double t_1 = -v / fma(u, 2.0, t1);
double tmp;
if (t1 <= -6.5e-86) {
tmp = t_1;
} else if (t1 <= 1.6e+68) {
tmp = (-v / (u * u)) * t1;
} else {
tmp = t_1;
}
return tmp;
}
function code(u, v, t1) t_1 = Float64(Float64(-v) / fma(u, 2.0, t1)) tmp = 0.0 if (t1 <= -6.5e-86) tmp = t_1; elseif (t1 <= 1.6e+68) tmp = Float64(Float64(Float64(-v) / Float64(u * u)) * t1); else tmp = t_1; end return tmp end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(u * 2.0 + t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -6.5e-86], t$95$1, If[LessEqual[t1, 1.6e+68], N[(N[((-v) / N[(u * u), $MachinePrecision]), $MachinePrecision] * t1), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{\mathsf{fma}\left(u, 2, t1\right)}\\
\mathbf{if}\;t1 \leq -6.5 \cdot 10^{-86}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 1.6 \cdot 10^{+68}:\\
\;\;\;\;\frac{-v}{u \cdot u} \cdot t1\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -6.50000000000000028e-86 or 1.59999999999999997e68 < t1 Initial program 63.4%
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
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-neg.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
frac-timesN/A
*-commutativeN/A
remove-double-negN/A
lift-neg.f64N/A
frac-timesN/A
clear-numN/A
lift-neg.f64N/A
frac-2negN/A
frac-timesN/A
*-lft-identityN/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6496.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6496.3
lift-+.f64N/A
+-commutativeN/A
Applied rewrites96.3%
Taylor expanded in u around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f6487.2
Applied rewrites87.2%
if -6.50000000000000028e-86 < t1 < 1.59999999999999997e68Initial program 80.6%
Taylor expanded in u around inf
unpow2N/A
lower-*.f6471.7
Applied rewrites71.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6475.6
Applied rewrites75.6%
Final simplification81.4%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) (fma u 2.0 t1))))
(if (<= t1 -3.4e-85)
t_1
(if (<= t1 1.6e+68) (* (/ (- t1) (* u u)) v) t_1))))
double code(double u, double v, double t1) {
double t_1 = -v / fma(u, 2.0, t1);
double tmp;
if (t1 <= -3.4e-85) {
tmp = t_1;
} else if (t1 <= 1.6e+68) {
tmp = (-t1 / (u * u)) * v;
} else {
tmp = t_1;
}
return tmp;
}
function code(u, v, t1) t_1 = Float64(Float64(-v) / fma(u, 2.0, t1)) tmp = 0.0 if (t1 <= -3.4e-85) tmp = t_1; elseif (t1 <= 1.6e+68) tmp = Float64(Float64(Float64(-t1) / Float64(u * u)) * v); else tmp = t_1; end return tmp end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(u * 2.0 + t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -3.4e-85], t$95$1, If[LessEqual[t1, 1.6e+68], N[(N[((-t1) / N[(u * u), $MachinePrecision]), $MachinePrecision] * v), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{\mathsf{fma}\left(u, 2, t1\right)}\\
\mathbf{if}\;t1 \leq -3.4 \cdot 10^{-85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 1.6 \cdot 10^{+68}:\\
\;\;\;\;\frac{-t1}{u \cdot u} \cdot v\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -3.4e-85 or 1.59999999999999997e68 < t1 Initial program 63.4%
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
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-neg.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
frac-timesN/A
*-commutativeN/A
remove-double-negN/A
lift-neg.f64N/A
frac-timesN/A
clear-numN/A
lift-neg.f64N/A
frac-2negN/A
frac-timesN/A
*-lft-identityN/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6496.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6496.3
lift-+.f64N/A
+-commutativeN/A
Applied rewrites96.3%
Taylor expanded in u around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f6487.2
Applied rewrites87.2%
if -3.4e-85 < t1 < 1.59999999999999997e68Initial program 80.6%
Taylor expanded in u around inf
unpow2N/A
lower-*.f6471.7
Applied rewrites71.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6471.8
Applied rewrites71.8%
Final simplification79.5%
(FPCore (u v t1) :precision binary64 (* (/ t1 (+ t1 u)) (/ (- v) (+ t1 u))))
double code(double u, double v, double t1) {
return (t1 / (t1 + u)) * (-v / (t1 + u));
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = (t1 / (t1 + u)) * (-v / (t1 + u))
end function
public static double code(double u, double v, double t1) {
return (t1 / (t1 + u)) * (-v / (t1 + u));
}
def code(u, v, t1): return (t1 / (t1 + u)) * (-v / (t1 + u))
function code(u, v, t1) return Float64(Float64(t1 / Float64(t1 + u)) * Float64(Float64(-v) / Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = (t1 / (t1 + u)) * (-v / (t1 + u)); end
code[u_, v_, t1_] := N[(N[(t1 / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{t1}{t1 + u} \cdot \frac{-v}{t1 + u}
\end{array}
Initial program 72.0%
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.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.1
Applied rewrites98.1%
Final simplification98.1%
(FPCore (u v t1) :precision binary64 (if (<= u -1.4e+195) (/ (- v) (* 2.0 u)) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if (u <= -1.4e+195) {
tmp = -v / (2.0 * u);
} else {
tmp = -v / t1;
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if (u <= (-1.4d+195)) then
tmp = -v / (2.0d0 * u)
else
tmp = -v / t1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -1.4e+195) {
tmp = -v / (2.0 * u);
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -1.4e+195: tmp = -v / (2.0 * u) else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -1.4e+195) tmp = Float64(Float64(-v) / Float64(2.0 * u)); else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -1.4e+195) tmp = -v / (2.0 * u); else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -1.4e+195], N[((-v) / N[(2.0 * u), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.4 \cdot 10^{+195}:\\
\;\;\;\;\frac{-v}{2 \cdot u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -1.3999999999999999e195Initial program 72.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
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-neg.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
frac-timesN/A
*-commutativeN/A
remove-double-negN/A
lift-neg.f64N/A
frac-timesN/A
clear-numN/A
lift-neg.f64N/A
frac-2negN/A
frac-timesN/A
*-lft-identityN/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6481.7
lift-+.f64N/A
+-commutativeN/A
lower-+.f6481.7
lift-+.f64N/A
+-commutativeN/A
Applied rewrites81.7%
Taylor expanded in u around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f6447.8
Applied rewrites47.8%
Taylor expanded in u around inf
Applied rewrites43.7%
if -1.3999999999999999e195 < u Initial program 72.0%
Taylor expanded in u around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6457.7
Applied rewrites57.7%
Final simplification56.5%
(FPCore (u v t1) :precision binary64 (/ (- v) (fma u 2.0 t1)))
double code(double u, double v, double t1) {
return -v / fma(u, 2.0, t1);
}
function code(u, v, t1) return Float64(Float64(-v) / fma(u, 2.0, t1)) end
code[u_, v_, t1_] := N[((-v) / N[(u * 2.0 + t1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-v}{\mathsf{fma}\left(u, 2, t1\right)}
\end{array}
Initial program 72.0%
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
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-neg.f6499.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.0
Applied rewrites99.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
frac-timesN/A
*-commutativeN/A
remove-double-negN/A
lift-neg.f64N/A
frac-timesN/A
clear-numN/A
lift-neg.f64N/A
frac-2negN/A
frac-timesN/A
*-lft-identityN/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6493.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.0
lift-+.f64N/A
+-commutativeN/A
Applied rewrites93.0%
Taylor expanded in u around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.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(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 72.0%
Taylor expanded in u around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6454.4
Applied rewrites54.4%
herbie shell --seed 2024273
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))