
(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 12 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 68.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.f6497.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.8
Applied rewrites97.8%
Final simplification97.8%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ v (fma -2.0 u (- t1)))))
(if (<= t1 -2.05e+97)
t_1
(if (<= t1 1.6e+58) (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))) t_1))))
double code(double u, double v, double t1) {
double t_1 = v / fma(-2.0, u, -t1);
double tmp;
if (t1 <= -2.05e+97) {
tmp = t_1;
} else if (t1 <= 1.6e+58) {
tmp = (-t1 * v) / ((t1 + u) * (t1 + u));
} else {
tmp = t_1;
}
return tmp;
}
function code(u, v, t1) t_1 = Float64(v / fma(-2.0, u, Float64(-t1))) tmp = 0.0 if (t1 <= -2.05e+97) tmp = t_1; elseif (t1 <= 1.6e+58) 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[(-2.0 * u + (-t1)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -2.05e+97], t$95$1, If[LessEqual[t1, 1.6e+58], 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(-2, u, -t1\right)}\\
\mathbf{if}\;t1 \leq -2.05 \cdot 10^{+97}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 1.6 \cdot 10^{+58}:\\
\;\;\;\;\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 < -2.04999999999999994e97 or 1.60000000000000008e58 < t1 Initial program 47.2%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
clear-numN/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
frac-2negN/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f64N/A
lower-neg.f6495.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6495.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6495.5
Applied rewrites95.5%
lift-*.f64N/A
*-lft-identity95.5
Applied rewrites95.5%
Taylor expanded in u around 0
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6492.0
Applied rewrites92.0%
if -2.04999999999999994e97 < t1 < 1.60000000000000008e58Initial program 83.4%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ v (fma -2.0 u (- t1)))))
(if (<= t1 -3.4e+22)
t_1
(if (<= t1 2.6e+54) (/ (* (/ (- v) u) t1) u) t_1))))
double code(double u, double v, double t1) {
double t_1 = v / fma(-2.0, u, -t1);
double tmp;
if (t1 <= -3.4e+22) {
tmp = t_1;
} else if (t1 <= 2.6e+54) {
tmp = ((-v / u) * t1) / u;
} else {
tmp = t_1;
}
return tmp;
}
function code(u, v, t1) t_1 = Float64(v / fma(-2.0, u, Float64(-t1))) tmp = 0.0 if (t1 <= -3.4e+22) tmp = t_1; elseif (t1 <= 2.6e+54) tmp = Float64(Float64(Float64(Float64(-v) / u) * t1) / u); else tmp = t_1; end return tmp end
code[u_, v_, t1_] := Block[{t$95$1 = N[(v / N[(-2.0 * u + (-t1)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -3.4e+22], t$95$1, If[LessEqual[t1, 2.6e+54], N[(N[(N[((-v) / u), $MachinePrecision] * t1), $MachinePrecision] / u), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{v}{\mathsf{fma}\left(-2, u, -t1\right)}\\
\mathbf{if}\;t1 \leq -3.4 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 2.6 \cdot 10^{+54}:\\
\;\;\;\;\frac{\frac{-v}{u} \cdot t1}{u}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -3.4e22 or 2.60000000000000007e54 < t1 Initial program 51.1%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
clear-numN/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
frac-2negN/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f64N/A
lower-neg.f6495.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6495.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6495.3
Applied rewrites95.3%
lift-*.f64N/A
*-lft-identity95.3
Applied rewrites95.3%
Taylor expanded in u around 0
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6491.8
Applied rewrites91.8%
if -3.4e22 < t1 < 2.60000000000000007e54Initial program 82.7%
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-/.f6475.2
Applied rewrites75.2%
Applied rewrites75.4%
Applied rewrites75.8%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ v (fma -2.0 u (- t1)))))
(if (<= t1 -3.4e+22)
t_1
(if (<= t1 2.6e+54) (/ (* (/ t1 u) v) (- u)) t_1))))
double code(double u, double v, double t1) {
double t_1 = v / fma(-2.0, u, -t1);
double tmp;
if (t1 <= -3.4e+22) {
tmp = t_1;
} else if (t1 <= 2.6e+54) {
tmp = ((t1 / u) * v) / -u;
} else {
tmp = t_1;
}
return tmp;
}
function code(u, v, t1) t_1 = Float64(v / fma(-2.0, u, Float64(-t1))) tmp = 0.0 if (t1 <= -3.4e+22) tmp = t_1; elseif (t1 <= 2.6e+54) tmp = Float64(Float64(Float64(t1 / u) * v) / Float64(-u)); else tmp = t_1; end return tmp end
code[u_, v_, t1_] := Block[{t$95$1 = N[(v / N[(-2.0 * u + (-t1)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -3.4e+22], t$95$1, If[LessEqual[t1, 2.6e+54], N[(N[(N[(t1 / u), $MachinePrecision] * v), $MachinePrecision] / (-u)), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{v}{\mathsf{fma}\left(-2, u, -t1\right)}\\
\mathbf{if}\;t1 \leq -3.4 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 2.6 \cdot 10^{+54}:\\
\;\;\;\;\frac{\frac{t1}{u} \cdot v}{-u}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -3.4e22 or 2.60000000000000007e54 < t1 Initial program 51.1%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
clear-numN/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
frac-2negN/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f64N/A
lower-neg.f6495.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6495.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6495.3
Applied rewrites95.3%
lift-*.f64N/A
*-lft-identity95.3
Applied rewrites95.3%
Taylor expanded in u around 0
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6491.8
Applied rewrites91.8%
if -3.4e22 < t1 < 2.60000000000000007e54Initial program 82.7%
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-/.f6475.2
Applied rewrites75.2%
Applied rewrites75.4%
Final simplification82.8%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ v (fma -2.0 u (- t1)))))
(if (<= t1 -3.4e+22)
t_1
(if (<= t1 2.6e+54) (* (/ t1 u) (/ (- v) u)) t_1))))
double code(double u, double v, double t1) {
double t_1 = v / fma(-2.0, u, -t1);
double tmp;
if (t1 <= -3.4e+22) {
tmp = t_1;
} else if (t1 <= 2.6e+54) {
tmp = (t1 / u) * (-v / u);
} else {
tmp = t_1;
}
return tmp;
}
function code(u, v, t1) t_1 = Float64(v / fma(-2.0, u, Float64(-t1))) tmp = 0.0 if (t1 <= -3.4e+22) tmp = t_1; elseif (t1 <= 2.6e+54) tmp = Float64(Float64(t1 / u) * Float64(Float64(-v) / u)); else tmp = t_1; end return tmp end
code[u_, v_, t1_] := Block[{t$95$1 = N[(v / N[(-2.0 * u + (-t1)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -3.4e+22], t$95$1, If[LessEqual[t1, 2.6e+54], N[(N[(t1 / u), $MachinePrecision] * N[((-v) / u), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{v}{\mathsf{fma}\left(-2, u, -t1\right)}\\
\mathbf{if}\;t1 \leq -3.4 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 2.6 \cdot 10^{+54}:\\
\;\;\;\;\frac{t1}{u} \cdot \frac{-v}{u}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -3.4e22 or 2.60000000000000007e54 < t1 Initial program 51.1%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
clear-numN/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
frac-2negN/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f64N/A
lower-neg.f6495.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6495.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6495.3
Applied rewrites95.3%
lift-*.f64N/A
*-lft-identity95.3
Applied rewrites95.3%
Taylor expanded in u around 0
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6491.8
Applied rewrites91.8%
if -3.4e22 < t1 < 2.60000000000000007e54Initial program 82.7%
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-/.f6475.2
Applied rewrites75.2%
Final simplification82.7%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ v (fma -2.0 u (- t1)))))
(if (<= t1 -3.4e+22)
t_1
(if (<= t1 2.6e+54) (* (/ (/ (- v) u) u) t1) t_1))))
double code(double u, double v, double t1) {
double t_1 = v / fma(-2.0, u, -t1);
double tmp;
if (t1 <= -3.4e+22) {
tmp = t_1;
} else if (t1 <= 2.6e+54) {
tmp = ((-v / u) / u) * t1;
} else {
tmp = t_1;
}
return tmp;
}
function code(u, v, t1) t_1 = Float64(v / fma(-2.0, u, Float64(-t1))) tmp = 0.0 if (t1 <= -3.4e+22) tmp = t_1; elseif (t1 <= 2.6e+54) tmp = Float64(Float64(Float64(Float64(-v) / u) / u) * t1); else tmp = t_1; end return tmp end
code[u_, v_, t1_] := Block[{t$95$1 = N[(v / N[(-2.0 * u + (-t1)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -3.4e+22], t$95$1, If[LessEqual[t1, 2.6e+54], N[(N[(N[((-v) / u), $MachinePrecision] / u), $MachinePrecision] * t1), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{v}{\mathsf{fma}\left(-2, u, -t1\right)}\\
\mathbf{if}\;t1 \leq -3.4 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 2.6 \cdot 10^{+54}:\\
\;\;\;\;\frac{\frac{-v}{u}}{u} \cdot t1\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -3.4e22 or 2.60000000000000007e54 < t1 Initial program 51.1%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
clear-numN/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
frac-2negN/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f64N/A
lower-neg.f6495.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6495.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6495.3
Applied rewrites95.3%
lift-*.f64N/A
*-lft-identity95.3
Applied rewrites95.3%
Taylor expanded in u around 0
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6491.8
Applied rewrites91.8%
if -3.4e22 < t1 < 2.60000000000000007e54Initial program 82.7%
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-/.f6475.2
Applied rewrites75.2%
Applied rewrites72.7%
Final simplification81.4%
(FPCore (u v t1) :precision binary64 (if (<= u 6.6e+211) (/ v (fma (- -2.0 (/ u t1)) u (- t1))) (/ (* (/ v u) (- t1)) (+ t1 u))))
double code(double u, double v, double t1) {
double tmp;
if (u <= 6.6e+211) {
tmp = v / fma((-2.0 - (u / t1)), u, -t1);
} else {
tmp = ((v / u) * -t1) / (t1 + u);
}
return tmp;
}
function code(u, v, t1) tmp = 0.0 if (u <= 6.6e+211) tmp = Float64(v / fma(Float64(-2.0 - Float64(u / t1)), u, Float64(-t1))); else tmp = Float64(Float64(Float64(v / u) * Float64(-t1)) / Float64(t1 + u)); end return tmp end
code[u_, v_, t1_] := If[LessEqual[u, 6.6e+211], N[(v / N[(N[(-2.0 - N[(u / t1), $MachinePrecision]), $MachinePrecision] * u + (-t1)), $MachinePrecision]), $MachinePrecision], N[(N[(N[(v / u), $MachinePrecision] * (-t1)), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq 6.6 \cdot 10^{+211}:\\
\;\;\;\;\frac{v}{\mathsf{fma}\left(-2 - \frac{u}{t1}, u, -t1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{v}{u} \cdot \left(-t1\right)}{t1 + u}\\
\end{array}
\end{array}
if u < 6.59999999999999966e211Initial program 68.9%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
clear-numN/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
frac-2negN/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f64N/A
lower-neg.f6496.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6496.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6496.2
Applied rewrites96.2%
lift-*.f64N/A
*-lft-identity96.2
Applied rewrites96.2%
Taylor expanded in u around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6496.2
Applied rewrites96.2%
if 6.59999999999999966e211 < u Initial program 63.5%
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
lower-/.f6495.3
Applied rewrites95.3%
Final simplification96.1%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ v (fma -2.0 u (- t1)))))
(if (<= t1 -6.6e+21)
t_1
(if (<= t1 2.6e+54) (* (/ v (* (- u) u)) t1) t_1))))
double code(double u, double v, double t1) {
double t_1 = v / fma(-2.0, u, -t1);
double tmp;
if (t1 <= -6.6e+21) {
tmp = t_1;
} else if (t1 <= 2.6e+54) {
tmp = (v / (-u * u)) * t1;
} else {
tmp = t_1;
}
return tmp;
}
function code(u, v, t1) t_1 = Float64(v / fma(-2.0, u, Float64(-t1))) tmp = 0.0 if (t1 <= -6.6e+21) tmp = t_1; elseif (t1 <= 2.6e+54) tmp = Float64(Float64(v / Float64(Float64(-u) * u)) * t1); else tmp = t_1; end return tmp end
code[u_, v_, t1_] := Block[{t$95$1 = N[(v / N[(-2.0 * u + (-t1)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -6.6e+21], t$95$1, If[LessEqual[t1, 2.6e+54], 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(-2, u, -t1\right)}\\
\mathbf{if}\;t1 \leq -6.6 \cdot 10^{+21}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 2.6 \cdot 10^{+54}:\\
\;\;\;\;\frac{v}{\left(-u\right) \cdot u} \cdot t1\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -6.6e21 or 2.60000000000000007e54 < t1 Initial program 51.1%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
clear-numN/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
frac-2negN/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f64N/A
lower-neg.f6495.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6495.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6495.3
Applied rewrites95.3%
lift-*.f64N/A
*-lft-identity95.3
Applied rewrites95.3%
Taylor expanded in u around 0
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6491.8
Applied rewrites91.8%
if -6.6e21 < t1 < 2.60000000000000007e54Initial program 82.7%
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-/.f6475.2
Applied rewrites75.2%
Applied rewrites69.2%
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(Float64(t1 / Float64(t1 + u)) * v) / Float64(-Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = ((t1 / (t1 + u)) * v) / -(t1 + u); end
code[u_, v_, t1_] := N[(N[(N[(t1 / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * v), $MachinePrecision] / (-N[(t1 + u), $MachinePrecision])), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{t1}{t1 + u} \cdot v}{-\left(t1 + u\right)}
\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-/.f6497.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.6
Applied rewrites97.6%
Final simplification97.6%
(FPCore (u v t1) :precision binary64 (/ v (fma -2.0 u (- t1))))
double code(double u, double v, double t1) {
return v / fma(-2.0, u, -t1);
}
function code(u, v, t1) return Float64(v / fma(-2.0, u, Float64(-t1))) end
code[u_, v_, t1_] := N[(v / N[(-2.0 * u + (-t1)), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{v}{\mathsf{fma}\left(-2, u, -t1\right)}
\end{array}
Initial program 68.4%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
clear-numN/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
frac-2negN/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f64N/A
lower-neg.f6494.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6494.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6494.5
Applied rewrites94.5%
lift-*.f64N/A
*-lft-identity94.5
Applied rewrites94.5%
Taylor expanded in u around 0
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6462.9
Applied rewrites62.9%
(FPCore (u v t1) :precision binary64 (/ (- v) (+ t1 u)))
double code(double u, double v, double t1) {
return -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 = -v / (t1 + u)
end function
public static double code(double u, double v, double t1) {
return -v / (t1 + u);
}
def code(u, v, t1): return -v / (t1 + u)
function code(u, v, t1) return Float64(Float64(-v) / Float64(t1 + u)) end
function tmp = code(u, v, t1) tmp = -v / (t1 + u); end
code[u_, v_, t1_] := N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-v}{t1 + 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-/.f6497.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.6
Applied rewrites97.6%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6462.3
Applied rewrites62.3%
Final simplification62.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 68.4%
Taylor expanded in u around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6456.4
Applied rewrites56.4%
herbie shell --seed 2024296
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))