
(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 (* (/ v (+ u t1)) (/ t1 (- (- u) t1))))
double code(double u, double v, double t1) {
return (v / (u + t1)) * (t1 / (-u - t1));
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = (v / (u + t1)) * (t1 / (-u - t1))
end function
public static double code(double u, double v, double t1) {
return (v / (u + t1)) * (t1 / (-u - t1));
}
def code(u, v, t1): return (v / (u + t1)) * (t1 / (-u - t1))
function code(u, v, t1) return Float64(Float64(v / Float64(u + t1)) * Float64(t1 / Float64(Float64(-u) - t1))) end
function tmp = code(u, v, t1) tmp = (v / (u + t1)) * (t1 / (-u - t1)); end
code[u_, v_, t1_] := N[(N[(v / N[(u + t1), $MachinePrecision]), $MachinePrecision] * N[(t1 / N[((-u) - t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{v}{u + t1} \cdot \frac{t1}{\left(-u\right) - t1}
\end{array}
Initial program 69.9%
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
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f6499.4
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.4
Applied rewrites99.4%
Final simplification99.4%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
(t_2 (/ (- v) (fma 2.0 u t1))))
(if (<= t1 -1.9e+48)
t_2
(if (<= t1 -5e-138)
t_1
(if (<= t1 5.2e-225)
(* (/ (- t1) u) (/ v u))
(if (<= t1 4.4e+54) t_1 t_2))))))
double code(double u, double v, double t1) {
double t_1 = (-t1 * v) / ((t1 + u) * (t1 + u));
double t_2 = -v / fma(2.0, u, t1);
double tmp;
if (t1 <= -1.9e+48) {
tmp = t_2;
} else if (t1 <= -5e-138) {
tmp = t_1;
} else if (t1 <= 5.2e-225) {
tmp = (-t1 / u) * (v / u);
} else if (t1 <= 4.4e+54) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(u, v, t1) t_1 = Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u))) t_2 = Float64(Float64(-v) / fma(2.0, u, t1)) tmp = 0.0 if (t1 <= -1.9e+48) tmp = t_2; elseif (t1 <= -5e-138) tmp = t_1; elseif (t1 <= 5.2e-225) tmp = Float64(Float64(Float64(-t1) / u) * Float64(v / u)); elseif (t1 <= 4.4e+54) tmp = t_1; else tmp = t_2; end return tmp end
code[u_, v_, t1_] := Block[{t$95$1 = N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-v) / N[(2.0 * u + t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -1.9e+48], t$95$2, If[LessEqual[t1, -5e-138], t$95$1, If[LessEqual[t1, 5.2e-225], N[(N[((-t1) / u), $MachinePrecision] * N[(v / u), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 4.4e+54], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\
t_2 := \frac{-v}{\mathsf{fma}\left(2, u, t1\right)}\\
\mathbf{if}\;t1 \leq -1.9 \cdot 10^{+48}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t1 \leq -5 \cdot 10^{-138}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 5.2 \cdot 10^{-225}:\\
\;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\
\mathbf{elif}\;t1 \leq 4.4 \cdot 10^{+54}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t1 < -1.9e48 or 4.3999999999999998e54 < t1 Initial program 55.3%
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
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
frac-timesN/A
*-lft-identityN/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6495.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6495.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6495.3
Applied rewrites95.3%
Taylor expanded in u around 0
+-commutativeN/A
lower-fma.f6487.5
Applied rewrites87.5%
if -1.9e48 < t1 < -4.99999999999999989e-138 or 5.20000000000000027e-225 < t1 < 4.3999999999999998e54Initial program 89.2%
if -4.99999999999999989e-138 < t1 < 5.20000000000000027e-225Initial program 73.4%
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-/.f6492.8
Applied rewrites92.8%
Final simplification89.1%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -5.2e-108) (not (<= t1 2.4e-158))) (/ (- v) (fma 2.0 u t1)) (* (/ (- t1) u) (/ v u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -5.2e-108) || !(t1 <= 2.4e-158)) {
tmp = -v / fma(2.0, u, t1);
} else {
tmp = (-t1 / u) * (v / u);
}
return tmp;
}
function code(u, v, t1) tmp = 0.0 if ((t1 <= -5.2e-108) || !(t1 <= 2.4e-158)) tmp = Float64(Float64(-v) / fma(2.0, u, t1)); else tmp = Float64(Float64(Float64(-t1) / u) * Float64(v / u)); end return tmp end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -5.2e-108], N[Not[LessEqual[t1, 2.4e-158]], $MachinePrecision]], N[((-v) / N[(2.0 * u + t1), $MachinePrecision]), $MachinePrecision], N[(N[((-t1) / u), $MachinePrecision] * N[(v / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -5.2 \cdot 10^{-108} \lor \neg \left(t1 \leq 2.4 \cdot 10^{-158}\right):\\
\;\;\;\;\frac{-v}{\mathsf{fma}\left(2, u, t1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\
\end{array}
\end{array}
if t1 < -5.19999999999999968e-108 or 2.40000000000000007e-158 < t1 Initial program 66.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
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
frac-timesN/A
*-lft-identityN/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6494.4
lift-+.f64N/A
+-commutativeN/A
lower-+.f6494.4
lift-+.f64N/A
+-commutativeN/A
lower-+.f6494.4
Applied rewrites94.4%
Taylor expanded in u around 0
+-commutativeN/A
lower-fma.f6478.4
Applied rewrites78.4%
if -5.19999999999999968e-108 < t1 < 2.40000000000000007e-158Initial program 78.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-/.f6491.8
Applied rewrites91.8%
Final simplification82.1%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -5.2e-108) (not (<= t1 2.4e-158))) (/ (- v) (fma 2.0 u t1)) (* v (/ (/ (- t1) u) u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -5.2e-108) || !(t1 <= 2.4e-158)) {
tmp = -v / fma(2.0, u, t1);
} else {
tmp = v * ((-t1 / u) / u);
}
return tmp;
}
function code(u, v, t1) tmp = 0.0 if ((t1 <= -5.2e-108) || !(t1 <= 2.4e-158)) tmp = Float64(Float64(-v) / fma(2.0, u, t1)); else tmp = Float64(v * Float64(Float64(Float64(-t1) / u) / u)); end return tmp end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -5.2e-108], N[Not[LessEqual[t1, 2.4e-158]], $MachinePrecision]], N[((-v) / N[(2.0 * u + t1), $MachinePrecision]), $MachinePrecision], N[(v * N[(N[((-t1) / u), $MachinePrecision] / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -5.2 \cdot 10^{-108} \lor \neg \left(t1 \leq 2.4 \cdot 10^{-158}\right):\\
\;\;\;\;\frac{-v}{\mathsf{fma}\left(2, u, t1\right)}\\
\mathbf{else}:\\
\;\;\;\;v \cdot \frac{\frac{-t1}{u}}{u}\\
\end{array}
\end{array}
if t1 < -5.19999999999999968e-108 or 2.40000000000000007e-158 < t1 Initial program 66.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
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
frac-timesN/A
*-lft-identityN/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6494.4
lift-+.f64N/A
+-commutativeN/A
lower-+.f6494.4
lift-+.f64N/A
+-commutativeN/A
lower-+.f6494.4
Applied rewrites94.4%
Taylor expanded in u around 0
+-commutativeN/A
lower-fma.f6478.4
Applied rewrites78.4%
if -5.19999999999999968e-108 < t1 < 2.40000000000000007e-158Initial program 78.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-/.f6491.8
Applied rewrites91.8%
Applied rewrites77.1%
Applied rewrites82.8%
Applied rewrites89.7%
Final simplification81.5%
(FPCore (u v t1) :precision binary64 (if (<= u 8.6e+147) (/ (- v) (fma (+ (/ u t1) 2.0) u t1)) (* (* (/ t1 u) v) (/ -1.0 u))))
double code(double u, double v, double t1) {
double tmp;
if (u <= 8.6e+147) {
tmp = -v / fma(((u / t1) + 2.0), u, t1);
} else {
tmp = ((t1 / u) * v) * (-1.0 / u);
}
return tmp;
}
function code(u, v, t1) tmp = 0.0 if (u <= 8.6e+147) tmp = Float64(Float64(-v) / fma(Float64(Float64(u / t1) + 2.0), u, t1)); else tmp = Float64(Float64(Float64(t1 / u) * v) * Float64(-1.0 / u)); end return tmp end
code[u_, v_, t1_] := If[LessEqual[u, 8.6e+147], N[((-v) / N[(N[(N[(u / t1), $MachinePrecision] + 2.0), $MachinePrecision] * u + t1), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t1 / u), $MachinePrecision] * v), $MachinePrecision] * N[(-1.0 / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq 8.6 \cdot 10^{+147}:\\
\;\;\;\;\frac{-v}{\mathsf{fma}\left(\frac{u}{t1} + 2, u, t1\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{t1}{u} \cdot v\right) \cdot \frac{-1}{u}\\
\end{array}
\end{array}
if u < 8.5999999999999997e147Initial program 71.3%
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
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f6499.4
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.4
Applied rewrites99.4%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
frac-timesN/A
*-lft-identityN/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6496.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6496.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6496.6
Applied rewrites96.6%
Taylor expanded in u around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f6496.6
Applied rewrites96.6%
if 8.5999999999999997e147 < u Initial program 57.4%
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-/.f6493.4
Applied rewrites93.4%
Applied rewrites93.6%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -5.2e-108) (not (<= t1 2.4e-158))) (/ (- v) (fma 2.0 u t1)) (* t1 (/ v (* (- u) u)))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -5.2e-108) || !(t1 <= 2.4e-158)) {
tmp = -v / fma(2.0, u, t1);
} else {
tmp = t1 * (v / (-u * u));
}
return tmp;
}
function code(u, v, t1) tmp = 0.0 if ((t1 <= -5.2e-108) || !(t1 <= 2.4e-158)) tmp = Float64(Float64(-v) / fma(2.0, u, t1)); else tmp = Float64(t1 * Float64(v / Float64(Float64(-u) * u))); end return tmp end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -5.2e-108], N[Not[LessEqual[t1, 2.4e-158]], $MachinePrecision]], N[((-v) / N[(2.0 * u + t1), $MachinePrecision]), $MachinePrecision], N[(t1 * N[(v / N[((-u) * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -5.2 \cdot 10^{-108} \lor \neg \left(t1 \leq 2.4 \cdot 10^{-158}\right):\\
\;\;\;\;\frac{-v}{\mathsf{fma}\left(2, u, t1\right)}\\
\mathbf{else}:\\
\;\;\;\;t1 \cdot \frac{v}{\left(-u\right) \cdot u}\\
\end{array}
\end{array}
if t1 < -5.19999999999999968e-108 or 2.40000000000000007e-158 < t1 Initial program 66.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
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
frac-timesN/A
*-lft-identityN/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6494.4
lift-+.f64N/A
+-commutativeN/A
lower-+.f6494.4
lift-+.f64N/A
+-commutativeN/A
lower-+.f6494.4
Applied rewrites94.4%
Taylor expanded in u around 0
+-commutativeN/A
lower-fma.f6478.4
Applied rewrites78.4%
if -5.19999999999999968e-108 < t1 < 2.40000000000000007e-158Initial program 78.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-/.f6491.8
Applied rewrites91.8%
Applied rewrites83.6%
Final simplification79.8%
(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(Float64(-v) / fma(2.0, u, 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 69.9%
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
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f6499.4
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.4
Applied rewrites99.4%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
frac-timesN/A
*-lft-identityN/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6494.4
lift-+.f64N/A
+-commutativeN/A
lower-+.f6494.4
lift-+.f64N/A
+-commutativeN/A
lower-+.f6494.4
Applied rewrites94.4%
Taylor expanded in u around 0
+-commutativeN/A
lower-fma.f6464.4
Applied rewrites64.4%
(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 69.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
associate-/l*N/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.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.f6463.5
Applied rewrites63.5%
(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 69.9%
Taylor expanded in u around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6459.0
Applied rewrites59.0%
herbie shell --seed 2024318
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))