
(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 (/ (* (/ 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 74.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.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.2
Applied rewrites99.2%
Final simplification99.2%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) (+ t1 u))))
(if (<= t1 -8.8e+126)
t_1
(if (<= t1 3.9e+94) (/ (- t1) (* (/ (+ t1 u) v) (+ t1 u))) t_1))))
double code(double u, double v, double t1) {
double t_1 = -v / (t1 + u);
double tmp;
if (t1 <= -8.8e+126) {
tmp = t_1;
} else if (t1 <= 3.9e+94) {
tmp = -t1 / (((t1 + u) / v) * (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)
if (t1 <= (-8.8d+126)) then
tmp = t_1
else if (t1 <= 3.9d+94) then
tmp = -t1 / (((t1 + u) / v) * (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);
double tmp;
if (t1 <= -8.8e+126) {
tmp = t_1;
} else if (t1 <= 3.9e+94) {
tmp = -t1 / (((t1 + u) / v) * (t1 + u));
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -v / (t1 + u) tmp = 0 if t1 <= -8.8e+126: tmp = t_1 elif t1 <= 3.9e+94: tmp = -t1 / (((t1 + u) / v) * (t1 + u)) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-v) / Float64(t1 + u)) tmp = 0.0 if (t1 <= -8.8e+126) tmp = t_1; elseif (t1 <= 3.9e+94) tmp = Float64(Float64(-t1) / Float64(Float64(Float64(t1 + u) / v) * Float64(t1 + u))); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -v / (t1 + u); tmp = 0.0; if (t1 <= -8.8e+126) tmp = t_1; elseif (t1 <= 3.9e+94) tmp = -t1 / (((t1 + u) / v) * (t1 + u)); else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -8.8e+126], t$95$1, If[LessEqual[t1, 3.9e+94], N[((-t1) / N[(N[(N[(t1 + u), $MachinePrecision] / v), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{t1 + u}\\
\mathbf{if}\;t1 \leq -8.8 \cdot 10^{+126}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 3.9 \cdot 10^{+94}:\\
\;\;\;\;\frac{-t1}{\frac{t1 + u}{v} \cdot \left(t1 + u\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -8.79999999999999994e126 or 3.89999999999999986e94 < t1 Initial program 49.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
associate-/l*N/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6488.4
Applied rewrites88.4%
if -8.79999999999999994e126 < t1 < 3.89999999999999986e94Initial program 89.3%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
clear-numN/A
frac-2negN/A
frac-timesN/A
metadata-evalN/A
lift-neg.f64N/A
remove-double-negN/A
distribute-lft-neg-inN/A
neg-mul-1N/A
remove-double-negN/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-neg.f6491.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6491.9
Applied rewrites91.9%
Final simplification90.6%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) (+ t1 u))))
(if (<= t1 -1.42e+23)
t_1
(if (<= t1 3.5e+95) (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))) t_1))))
double code(double u, double v, double t1) {
double t_1 = -v / (t1 + u);
double tmp;
if (t1 <= -1.42e+23) {
tmp = t_1;
} else if (t1 <= 3.5e+95) {
tmp = (-t1 * v) / ((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)
if (t1 <= (-1.42d+23)) then
tmp = t_1
else if (t1 <= 3.5d+95) then
tmp = (-t1 * v) / ((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);
double tmp;
if (t1 <= -1.42e+23) {
tmp = t_1;
} else if (t1 <= 3.5e+95) {
tmp = (-t1 * v) / ((t1 + u) * (t1 + u));
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -v / (t1 + u) tmp = 0 if t1 <= -1.42e+23: tmp = t_1 elif t1 <= 3.5e+95: tmp = (-t1 * v) / ((t1 + u) * (t1 + u)) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-v) / Float64(t1 + u)) tmp = 0.0 if (t1 <= -1.42e+23) tmp = t_1; elseif (t1 <= 3.5e+95) tmp = Float64(Float64(Float64(-t1) * v) / 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); tmp = 0.0; if (t1 <= -1.42e+23) tmp = t_1; elseif (t1 <= 3.5e+95) tmp = (-t1 * v) / ((t1 + u) * (t1 + u)); else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -1.42e+23], t$95$1, If[LessEqual[t1, 3.5e+95], 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}{t1 + u}\\
\mathbf{if}\;t1 \leq -1.42 \cdot 10^{+23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 3.5 \cdot 10^{+95}:\\
\;\;\;\;\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 < -1.42000000000000004e23 or 3.5e95 < t1 Initial program 55.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-/.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6487.0
Applied rewrites87.0%
if -1.42000000000000004e23 < t1 < 3.5e95Initial program 90.8%
Final simplification89.1%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (/ (- v) (+ t1 u)))) (if (<= t1 -1e-92) t_1 (if (<= t1 3.8e-15) (/ (* (/ (- v) u) t1) u) t_1))))
double code(double u, double v, double t1) {
double t_1 = -v / (t1 + u);
double tmp;
if (t1 <= -1e-92) {
tmp = t_1;
} else if (t1 <= 3.8e-15) {
tmp = ((-v / u) * t1) / u;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: t_1
real(8) :: tmp
t_1 = -v / (t1 + u)
if (t1 <= (-1d-92)) then
tmp = t_1
else if (t1 <= 3.8d-15) then
tmp = ((-v / u) * t1) / u
else
tmp = t_1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = -v / (t1 + u);
double tmp;
if (t1 <= -1e-92) {
tmp = t_1;
} else if (t1 <= 3.8e-15) {
tmp = ((-v / u) * t1) / u;
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -v / (t1 + u) tmp = 0 if t1 <= -1e-92: tmp = t_1 elif t1 <= 3.8e-15: tmp = ((-v / u) * t1) / u else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-v) / Float64(t1 + u)) tmp = 0.0 if (t1 <= -1e-92) tmp = t_1; elseif (t1 <= 3.8e-15) tmp = Float64(Float64(Float64(Float64(-v) / u) * t1) / u); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -v / (t1 + u); tmp = 0.0; if (t1 <= -1e-92) tmp = t_1; elseif (t1 <= 3.8e-15) tmp = ((-v / u) * t1) / u; else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -1e-92], t$95$1, If[LessEqual[t1, 3.8e-15], N[(N[(N[((-v) / u), $MachinePrecision] * t1), $MachinePrecision] / u), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{t1 + u}\\
\mathbf{if}\;t1 \leq -1 \cdot 10^{-92}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 3.8 \cdot 10^{-15}:\\
\;\;\;\;\frac{\frac{-v}{u} \cdot t1}{u}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -9.99999999999999988e-93 or 3.8000000000000002e-15 < t1 Initial program 65.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
associate-/l*N/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6481.7
Applied rewrites81.7%
if -9.99999999999999988e-93 < t1 < 3.8000000000000002e-15Initial program 89.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-/.f6489.3
Applied rewrites89.3%
Applied rewrites89.0%
Applied rewrites90.2%
Final simplification84.9%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (/ (- v) (+ t1 u)))) (if (<= t1 -1e-92) t_1 (if (<= t1 3.8e-15) (/ (* (/ t1 u) v) (- u)) t_1))))
double code(double u, double v, double t1) {
double t_1 = -v / (t1 + u);
double tmp;
if (t1 <= -1e-92) {
tmp = t_1;
} else if (t1 <= 3.8e-15) {
tmp = ((t1 / u) * v) / -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)
if (t1 <= (-1d-92)) then
tmp = t_1
else if (t1 <= 3.8d-15) then
tmp = ((t1 / u) * v) / -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);
double tmp;
if (t1 <= -1e-92) {
tmp = t_1;
} else if (t1 <= 3.8e-15) {
tmp = ((t1 / u) * v) / -u;
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -v / (t1 + u) tmp = 0 if t1 <= -1e-92: tmp = t_1 elif t1 <= 3.8e-15: tmp = ((t1 / u) * v) / -u else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-v) / Float64(t1 + u)) tmp = 0.0 if (t1 <= -1e-92) tmp = t_1; elseif (t1 <= 3.8e-15) tmp = Float64(Float64(Float64(t1 / u) * v) / Float64(-u)); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -v / (t1 + u); tmp = 0.0; if (t1 <= -1e-92) tmp = t_1; elseif (t1 <= 3.8e-15) tmp = ((t1 / u) * v) / -u; else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -1e-92], t$95$1, If[LessEqual[t1, 3.8e-15], N[(N[(N[(t1 / u), $MachinePrecision] * v), $MachinePrecision] / (-u)), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{t1 + u}\\
\mathbf{if}\;t1 \leq -1 \cdot 10^{-92}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 3.8 \cdot 10^{-15}:\\
\;\;\;\;\frac{\frac{t1}{u} \cdot v}{-u}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -9.99999999999999988e-93 or 3.8000000000000002e-15 < t1 Initial program 65.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
associate-/l*N/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6481.7
Applied rewrites81.7%
if -9.99999999999999988e-93 < t1 < 3.8000000000000002e-15Initial program 89.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-/.f6489.3
Applied rewrites89.3%
Applied rewrites89.6%
Final simplification84.7%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (/ (- v) (+ t1 u)))) (if (<= t1 -1e-92) t_1 (if (<= t1 3.8e-15) (* (/ t1 u) (/ (- v) u)) t_1))))
double code(double u, double v, double t1) {
double t_1 = -v / (t1 + u);
double tmp;
if (t1 <= -1e-92) {
tmp = t_1;
} else if (t1 <= 3.8e-15) {
tmp = (t1 / u) * (-v / 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)
if (t1 <= (-1d-92)) then
tmp = t_1
else if (t1 <= 3.8d-15) then
tmp = (t1 / u) * (-v / 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);
double tmp;
if (t1 <= -1e-92) {
tmp = t_1;
} else if (t1 <= 3.8e-15) {
tmp = (t1 / u) * (-v / u);
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -v / (t1 + u) tmp = 0 if t1 <= -1e-92: tmp = t_1 elif t1 <= 3.8e-15: tmp = (t1 / u) * (-v / u) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-v) / Float64(t1 + u)) tmp = 0.0 if (t1 <= -1e-92) tmp = t_1; elseif (t1 <= 3.8e-15) tmp = Float64(Float64(t1 / u) * Float64(Float64(-v) / u)); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -v / (t1 + u); tmp = 0.0; if (t1 <= -1e-92) tmp = t_1; elseif (t1 <= 3.8e-15) tmp = (t1 / u) * (-v / u); else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -1e-92], t$95$1, If[LessEqual[t1, 3.8e-15], N[(N[(t1 / u), $MachinePrecision] * N[((-v) / u), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{t1 + u}\\
\mathbf{if}\;t1 \leq -1 \cdot 10^{-92}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 3.8 \cdot 10^{-15}:\\
\;\;\;\;\frac{t1}{u} \cdot \frac{-v}{u}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -9.99999999999999988e-93 or 3.8000000000000002e-15 < t1 Initial program 65.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
associate-/l*N/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6481.7
Applied rewrites81.7%
if -9.99999999999999988e-93 < t1 < 3.8000000000000002e-15Initial program 89.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-/.f6489.3
Applied rewrites89.3%
Final simplification84.6%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (/ (- v) (+ t1 u)))) (if (<= t1 -1e-92) t_1 (if (<= t1 3.8e-15) (* (/ (/ (- v) u) u) t1) t_1))))
double code(double u, double v, double t1) {
double t_1 = -v / (t1 + u);
double tmp;
if (t1 <= -1e-92) {
tmp = t_1;
} else if (t1 <= 3.8e-15) {
tmp = ((-v / u) / u) * t1;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: t_1
real(8) :: tmp
t_1 = -v / (t1 + u)
if (t1 <= (-1d-92)) then
tmp = t_1
else if (t1 <= 3.8d-15) then
tmp = ((-v / u) / u) * t1
else
tmp = t_1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = -v / (t1 + u);
double tmp;
if (t1 <= -1e-92) {
tmp = t_1;
} else if (t1 <= 3.8e-15) {
tmp = ((-v / u) / u) * t1;
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -v / (t1 + u) tmp = 0 if t1 <= -1e-92: tmp = t_1 elif t1 <= 3.8e-15: tmp = ((-v / u) / u) * t1 else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-v) / Float64(t1 + u)) tmp = 0.0 if (t1 <= -1e-92) tmp = t_1; elseif (t1 <= 3.8e-15) tmp = Float64(Float64(Float64(Float64(-v) / u) / u) * t1); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -v / (t1 + u); tmp = 0.0; if (t1 <= -1e-92) tmp = t_1; elseif (t1 <= 3.8e-15) tmp = ((-v / u) / u) * t1; else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -1e-92], t$95$1, If[LessEqual[t1, 3.8e-15], N[(N[(N[((-v) / u), $MachinePrecision] / u), $MachinePrecision] * t1), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{t1 + u}\\
\mathbf{if}\;t1 \leq -1 \cdot 10^{-92}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 3.8 \cdot 10^{-15}:\\
\;\;\;\;\frac{\frac{-v}{u}}{u} \cdot t1\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -9.99999999999999988e-93 or 3.8000000000000002e-15 < t1 Initial program 65.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
associate-/l*N/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6481.7
Applied rewrites81.7%
if -9.99999999999999988e-93 < t1 < 3.8000000000000002e-15Initial program 89.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-/.f6489.3
Applied rewrites89.3%
Applied rewrites84.9%
Final simplification82.9%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (/ (- v) (+ t1 u)))) (if (<= t1 -1e-92) t_1 (if (<= t1 3.8e-15) (/ (* (- t1) v) (* u u)) t_1))))
double code(double u, double v, double t1) {
double t_1 = -v / (t1 + u);
double tmp;
if (t1 <= -1e-92) {
tmp = t_1;
} else if (t1 <= 3.8e-15) {
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)
if (t1 <= (-1d-92)) then
tmp = t_1
else if (t1 <= 3.8d-15) 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);
double tmp;
if (t1 <= -1e-92) {
tmp = t_1;
} else if (t1 <= 3.8e-15) {
tmp = (-t1 * v) / (u * u);
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -v / (t1 + u) tmp = 0 if t1 <= -1e-92: tmp = t_1 elif t1 <= 3.8e-15: tmp = (-t1 * v) / (u * u) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-v) / Float64(t1 + u)) tmp = 0.0 if (t1 <= -1e-92) tmp = t_1; elseif (t1 <= 3.8e-15) tmp = Float64(Float64(Float64(-t1) * v) / Float64(u * u)); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -v / (t1 + u); tmp = 0.0; if (t1 <= -1e-92) tmp = t_1; elseif (t1 <= 3.8e-15) tmp = (-t1 * v) / (u * u); else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -1e-92], t$95$1, If[LessEqual[t1, 3.8e-15], N[(N[((-t1) * v), $MachinePrecision] / N[(u * u), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{t1 + u}\\
\mathbf{if}\;t1 \leq -1 \cdot 10^{-92}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 3.8 \cdot 10^{-15}:\\
\;\;\;\;\frac{\left(-t1\right) \cdot v}{u \cdot u}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -9.99999999999999988e-93 or 3.8000000000000002e-15 < t1 Initial program 65.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
associate-/l*N/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6481.7
Applied rewrites81.7%
if -9.99999999999999988e-93 < t1 < 3.8000000000000002e-15Initial program 89.5%
Taylor expanded in u around inf
unpow2N/A
lower-*.f6484.5
Applied rewrites84.5%
Final simplification82.7%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (/ (- v) (+ t1 u)))) (if (<= t1 -1e-92) t_1 (if (<= t1 3.8e-15) (* (/ t1 (* (- u) u)) v) t_1))))
double code(double u, double v, double t1) {
double t_1 = -v / (t1 + u);
double tmp;
if (t1 <= -1e-92) {
tmp = t_1;
} else if (t1 <= 3.8e-15) {
tmp = (t1 / (-u * u)) * v;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: t_1
real(8) :: tmp
t_1 = -v / (t1 + u)
if (t1 <= (-1d-92)) then
tmp = t_1
else if (t1 <= 3.8d-15) then
tmp = (t1 / (-u * u)) * v
else
tmp = t_1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = -v / (t1 + u);
double tmp;
if (t1 <= -1e-92) {
tmp = t_1;
} else if (t1 <= 3.8e-15) {
tmp = (t1 / (-u * u)) * v;
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -v / (t1 + u) tmp = 0 if t1 <= -1e-92: tmp = t_1 elif t1 <= 3.8e-15: tmp = (t1 / (-u * u)) * v else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-v) / Float64(t1 + u)) tmp = 0.0 if (t1 <= -1e-92) tmp = t_1; elseif (t1 <= 3.8e-15) tmp = Float64(Float64(t1 / Float64(Float64(-u) * u)) * v); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -v / (t1 + u); tmp = 0.0; if (t1 <= -1e-92) tmp = t_1; elseif (t1 <= 3.8e-15) tmp = (t1 / (-u * u)) * v; else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -1e-92], t$95$1, If[LessEqual[t1, 3.8e-15], N[(N[(t1 / N[((-u) * u), $MachinePrecision]), $MachinePrecision] * v), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{t1 + u}\\
\mathbf{if}\;t1 \leq -1 \cdot 10^{-92}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 3.8 \cdot 10^{-15}:\\
\;\;\;\;\frac{t1}{\left(-u\right) \cdot u} \cdot v\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -9.99999999999999988e-93 or 3.8000000000000002e-15 < t1 Initial program 65.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
associate-/l*N/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6481.7
Applied rewrites81.7%
if -9.99999999999999988e-93 < t1 < 3.8000000000000002e-15Initial program 89.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-/.f6489.3
Applied rewrites89.3%
Applied rewrites89.0%
Applied rewrites83.9%
Final simplification82.5%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (/ (- v) (+ t1 u)))) (if (<= t1 -1e-92) t_1 (if (<= t1 3.8e-15) (* (/ v (* (- u) u)) t1) t_1))))
double code(double u, double v, double t1) {
double t_1 = -v / (t1 + u);
double tmp;
if (t1 <= -1e-92) {
tmp = t_1;
} else if (t1 <= 3.8e-15) {
tmp = (v / (-u * u)) * t1;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: t_1
real(8) :: tmp
t_1 = -v / (t1 + u)
if (t1 <= (-1d-92)) then
tmp = t_1
else if (t1 <= 3.8d-15) then
tmp = (v / (-u * u)) * t1
else
tmp = t_1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = -v / (t1 + u);
double tmp;
if (t1 <= -1e-92) {
tmp = t_1;
} else if (t1 <= 3.8e-15) {
tmp = (v / (-u * u)) * t1;
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -v / (t1 + u) tmp = 0 if t1 <= -1e-92: tmp = t_1 elif t1 <= 3.8e-15: tmp = (v / (-u * u)) * t1 else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-v) / Float64(t1 + u)) tmp = 0.0 if (t1 <= -1e-92) tmp = t_1; elseif (t1 <= 3.8e-15) tmp = Float64(Float64(v / Float64(Float64(-u) * u)) * t1); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -v / (t1 + u); tmp = 0.0; if (t1 <= -1e-92) tmp = t_1; elseif (t1 <= 3.8e-15) tmp = (v / (-u * u)) * t1; else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -1e-92], t$95$1, If[LessEqual[t1, 3.8e-15], N[(N[(v / N[((-u) * u), $MachinePrecision]), $MachinePrecision] * t1), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{t1 + u}\\
\mathbf{if}\;t1 \leq -1 \cdot 10^{-92}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 3.8 \cdot 10^{-15}:\\
\;\;\;\;\frac{v}{\left(-u\right) \cdot u} \cdot t1\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -9.99999999999999988e-93 or 3.8000000000000002e-15 < t1 Initial program 65.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
associate-/l*N/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6481.7
Applied rewrites81.7%
if -9.99999999999999988e-93 < t1 < 3.8000000000000002e-15Initial program 89.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-/.f6489.3
Applied rewrites89.3%
Applied rewrites82.9%
Final simplification82.1%
(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 74.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
associate-/l*N/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6499.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.0
Applied rewrites99.0%
Final simplification99.0%
(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 74.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
associate-/l*N/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6499.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.0
Applied rewrites99.0%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6462.9
Applied rewrites62.9%
Final simplification62.9%
(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 74.6%
Taylor expanded in u around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6454.9
Applied rewrites54.9%
herbie shell --seed 2024308
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))