
(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 (/ (* (/ 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\right) - u}
\end{array}
Initial program 71.6%
lift-neg.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
frac-2negN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-frac-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
lower-neg.f6498.5
Applied egg-rr98.5%
Final simplification98.5%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (- (- t1) u)))
(if (<= t1 -9.2e+122)
(/ (fma (/ v t1) (* u -2.0) v) (- t1))
(if (<= t1 2.1e+121) (* v (/ t1 (* (+ t1 u) t_1))) (/ v t_1)))))
double code(double u, double v, double t1) {
double t_1 = -t1 - u;
double tmp;
if (t1 <= -9.2e+122) {
tmp = fma((v / t1), (u * -2.0), v) / -t1;
} else if (t1 <= 2.1e+121) {
tmp = v * (t1 / ((t1 + u) * t_1));
} else {
tmp = v / t_1;
}
return tmp;
}
function code(u, v, t1) t_1 = Float64(Float64(-t1) - u) tmp = 0.0 if (t1 <= -9.2e+122) tmp = Float64(fma(Float64(v / t1), Float64(u * -2.0), v) / Float64(-t1)); elseif (t1 <= 2.1e+121) tmp = Float64(v * Float64(t1 / Float64(Float64(t1 + u) * t_1))); else tmp = Float64(v / t_1); end return tmp end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-t1) - u), $MachinePrecision]}, If[LessEqual[t1, -9.2e+122], N[(N[(N[(v / t1), $MachinePrecision] * N[(u * -2.0), $MachinePrecision] + v), $MachinePrecision] / (-t1)), $MachinePrecision], If[LessEqual[t1, 2.1e+121], N[(v * N[(t1 / N[(N[(t1 + u), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(v / t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-t1\right) - u\\
\mathbf{if}\;t1 \leq -9.2 \cdot 10^{+122}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{v}{t1}, u \cdot -2, v\right)}{-t1}\\
\mathbf{elif}\;t1 \leq 2.1 \cdot 10^{+121}:\\
\;\;\;\;v \cdot \frac{t1}{\left(t1 + u\right) \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{t\_1}\\
\end{array}
\end{array}
if t1 < -9.2000000000000002e122Initial program 44.1%
Taylor expanded in t1 around inf
mul-1-negN/A
metadata-evalN/A
distribute-lft-neg-inN/A
associate-*r/N/A
distribute-neg-inN/A
associate-*r/N/A
distribute-neg-fracN/A
lower-neg.f64N/A
lower-/.f64N/A
associate-*r/N/A
+-commutativeN/A
associate-*r*N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6494.6
Simplified94.6%
if -9.2000000000000002e122 < t1 < 2.1000000000000002e121Initial program 82.8%
lift-neg.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6484.6
Applied egg-rr84.6%
if 2.1000000000000002e121 < t1 Initial program 48.3%
lift-neg.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
frac-2negN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-frac-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
lower-neg.f6499.9
Applied egg-rr99.9%
Taylor expanded in t1 around inf
Simplified89.6%
lift-neg.f64N/A
mul-1-negN/A
lift-+.f64N/A
frac-2negN/A
lower-/.f6489.6
Applied egg-rr89.6%
Final simplification86.8%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (- (- t1) u)) (t_2 (/ v t_1)))
(if (<= t1 -9.5e+138)
t_2
(if (<= t1 2.1e+121) (* v (/ t1 (* (+ t1 u) t_1))) t_2))))
double code(double u, double v, double t1) {
double t_1 = -t1 - u;
double t_2 = v / t_1;
double tmp;
if (t1 <= -9.5e+138) {
tmp = t_2;
} else if (t1 <= 2.1e+121) {
tmp = v * (t1 / ((t1 + u) * t_1));
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = -t1 - u
t_2 = v / t_1
if (t1 <= (-9.5d+138)) then
tmp = t_2
else if (t1 <= 2.1d+121) then
tmp = v * (t1 / ((t1 + u) * t_1))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = -t1 - u;
double t_2 = v / t_1;
double tmp;
if (t1 <= -9.5e+138) {
tmp = t_2;
} else if (t1 <= 2.1e+121) {
tmp = v * (t1 / ((t1 + u) * t_1));
} else {
tmp = t_2;
}
return tmp;
}
def code(u, v, t1): t_1 = -t1 - u t_2 = v / t_1 tmp = 0 if t1 <= -9.5e+138: tmp = t_2 elif t1 <= 2.1e+121: tmp = v * (t1 / ((t1 + u) * t_1)) else: tmp = t_2 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-t1) - u) t_2 = Float64(v / t_1) tmp = 0.0 if (t1 <= -9.5e+138) tmp = t_2; elseif (t1 <= 2.1e+121) tmp = Float64(v * Float64(t1 / Float64(Float64(t1 + u) * t_1))); else tmp = t_2; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -t1 - u; t_2 = v / t_1; tmp = 0.0; if (t1 <= -9.5e+138) tmp = t_2; elseif (t1 <= 2.1e+121) tmp = v * (t1 / ((t1 + u) * t_1)); else tmp = t_2; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-t1) - u), $MachinePrecision]}, Block[{t$95$2 = N[(v / t$95$1), $MachinePrecision]}, If[LessEqual[t1, -9.5e+138], t$95$2, If[LessEqual[t1, 2.1e+121], N[(v * N[(t1 / N[(N[(t1 + u), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-t1\right) - u\\
t_2 := \frac{v}{t\_1}\\
\mathbf{if}\;t1 \leq -9.5 \cdot 10^{+138}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t1 \leq 2.1 \cdot 10^{+121}:\\
\;\;\;\;v \cdot \frac{t1}{\left(t1 + u\right) \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t1 < -9.49999999999999998e138 or 2.1000000000000002e121 < t1 Initial program 45.6%
lift-neg.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
frac-2negN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-frac-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
lower-neg.f6499.9
Applied egg-rr99.9%
Taylor expanded in t1 around inf
Simplified92.3%
lift-neg.f64N/A
mul-1-negN/A
lift-+.f64N/A
frac-2negN/A
lower-/.f6492.3
Applied egg-rr92.3%
if -9.49999999999999998e138 < t1 < 2.1000000000000002e121Initial program 82.5%
lift-neg.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6484.4
Applied egg-rr84.4%
Final simplification86.7%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (/ v (- (- t1) u)))) (if (<= t1 -1.6e-33) t_1 (if (<= t1 0.215) (* v (/ t1 (* u (- u)))) t_1))))
double code(double u, double v, double t1) {
double t_1 = v / (-t1 - u);
double tmp;
if (t1 <= -1.6e-33) {
tmp = t_1;
} else if (t1 <= 0.215) {
tmp = v * (t1 / (u * -u));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: t_1
real(8) :: tmp
t_1 = v / (-t1 - u)
if (t1 <= (-1.6d-33)) then
tmp = t_1
else if (t1 <= 0.215d0) then
tmp = v * (t1 / (u * -u))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = v / (-t1 - u);
double tmp;
if (t1 <= -1.6e-33) {
tmp = t_1;
} else if (t1 <= 0.215) {
tmp = v * (t1 / (u * -u));
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = v / (-t1 - u) tmp = 0 if t1 <= -1.6e-33: tmp = t_1 elif t1 <= 0.215: tmp = v * (t1 / (u * -u)) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(v / Float64(Float64(-t1) - u)) tmp = 0.0 if (t1 <= -1.6e-33) tmp = t_1; elseif (t1 <= 0.215) tmp = Float64(v * Float64(t1 / Float64(u * 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 <= -1.6e-33) tmp = t_1; elseif (t1 <= 0.215) tmp = v * (t1 / (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, -1.6e-33], t$95$1, If[LessEqual[t1, 0.215], N[(v * N[(t1 / N[(u * (-u)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{v}{\left(-t1\right) - u}\\
\mathbf{if}\;t1 \leq -1.6 \cdot 10^{-33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 0.215:\\
\;\;\;\;v \cdot \frac{t1}{u \cdot \left(-u\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -1.59999999999999988e-33 or 0.214999999999999997 < t1 Initial program 63.7%
lift-neg.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
frac-2negN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-frac-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
lower-neg.f6499.9
Applied egg-rr99.9%
Taylor expanded in t1 around inf
Simplified85.7%
lift-neg.f64N/A
mul-1-negN/A
lift-+.f64N/A
frac-2negN/A
lower-/.f6485.7
Applied egg-rr85.7%
if -1.59999999999999988e-33 < t1 < 0.214999999999999997Initial program 80.2%
Taylor expanded in t1 around 0
unpow2N/A
lower-*.f6471.3
Simplified71.3%
lift-neg.f64N/A
lift-*.f64N/A
lift-*.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
neg-mul-1N/A
times-fracN/A
lift-neg.f64N/A
remove-double-negN/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
neg-mul-1N/A
lift-neg.f64N/A
lower-*.f64N/A
lower-/.f6472.2
Applied egg-rr72.2%
Final simplification79.3%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (/ v (- (- t1) u)))) (if (<= t1 -1.6e-33) t_1 (if (<= t1 0.215) (* t1 (/ v (* u (- u)))) t_1))))
double code(double u, double v, double t1) {
double t_1 = v / (-t1 - u);
double tmp;
if (t1 <= -1.6e-33) {
tmp = t_1;
} else if (t1 <= 0.215) {
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 <= (-1.6d-33)) then
tmp = t_1
else if (t1 <= 0.215d0) 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 <= -1.6e-33) {
tmp = t_1;
} else if (t1 <= 0.215) {
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 <= -1.6e-33: tmp = t_1 elif t1 <= 0.215: tmp = t1 * (v / (u * -u)) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(v / Float64(Float64(-t1) - u)) tmp = 0.0 if (t1 <= -1.6e-33) tmp = t_1; elseif (t1 <= 0.215) tmp = Float64(t1 * Float64(v / Float64(u * Float64(-u)))); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = v / (-t1 - u); tmp = 0.0; if (t1 <= -1.6e-33) tmp = t_1; elseif (t1 <= 0.215) 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, -1.6e-33], t$95$1, If[LessEqual[t1, 0.215], N[(t1 * N[(v / N[(u * (-u)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{v}{\left(-t1\right) - u}\\
\mathbf{if}\;t1 \leq -1.6 \cdot 10^{-33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 0.215:\\
\;\;\;\;t1 \cdot \frac{v}{u \cdot \left(-u\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -1.59999999999999988e-33 or 0.214999999999999997 < t1 Initial program 63.7%
lift-neg.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
frac-2negN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-frac-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
lower-neg.f6499.9
Applied egg-rr99.9%
Taylor expanded in t1 around inf
Simplified85.7%
lift-neg.f64N/A
mul-1-negN/A
lift-+.f64N/A
frac-2negN/A
lower-/.f6485.7
Applied egg-rr85.7%
if -1.59999999999999988e-33 < t1 < 0.214999999999999997Initial program 80.2%
Taylor expanded in t1 around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
unpow2N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6472.1
Simplified72.1%
Final simplification79.2%
(FPCore (u v t1) :precision binary64 (/ (* t1 (/ v (+ t1 u))) (- (- t1) u)))
double code(double u, double v, double t1) {
return (t1 * (v / (t1 + u))) / (-t1 - u);
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = (t1 * (v / (t1 + u))) / (-t1 - u)
end function
public static double code(double u, double v, double t1) {
return (t1 * (v / (t1 + u))) / (-t1 - u);
}
def code(u, v, t1): return (t1 * (v / (t1 + u))) / (-t1 - u)
function code(u, v, t1) return Float64(Float64(t1 * Float64(v / Float64(t1 + u))) / Float64(Float64(-t1) - u)) end
function tmp = code(u, v, t1) tmp = (t1 * (v / (t1 + u))) / (-t1 - u); end
code[u_, v_, t1_] := N[(N[(t1 * N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[((-t1) - u), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{t1 \cdot \frac{v}{t1 + u}}{\left(-t1\right) - u}
\end{array}
Initial program 71.6%
lift-neg.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
*-commutativeN/A
lift-neg.f64N/A
distribute-frac-negN/A
distribute-frac-neg2N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f6497.9
Applied egg-rr97.9%
Final simplification97.9%
(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(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[(t1 / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(v / N[((-t1) - u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{t1}{t1 + u} \cdot \frac{v}{\left(-t1\right) - u}
\end{array}
Initial program 71.6%
lift-neg.f64N/A
lift-+.f64N/A
lift-+.f64N/A
*-commutativeN/A
lift-neg.f64N/A
neg-mul-1N/A
associate-*r*N/A
times-fracN/A
*-commutativeN/A
neg-mul-1N/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
lower-/.f6497.8
Applied egg-rr97.8%
Final simplification97.8%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (* t1 (/ v (* u u))))) (if (<= u -5.2e+45) t_1 (if (<= u 1.55e+45) (/ v (- t1)) t_1))))
double code(double u, double v, double t1) {
double t_1 = t1 * (v / (u * u));
double tmp;
if (u <= -5.2e+45) {
tmp = t_1;
} else if (u <= 1.55e+45) {
tmp = v / -t1;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: t_1
real(8) :: tmp
t_1 = t1 * (v / (u * u))
if (u <= (-5.2d+45)) then
tmp = t_1
else if (u <= 1.55d+45) then
tmp = v / -t1
else
tmp = t_1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = t1 * (v / (u * u));
double tmp;
if (u <= -5.2e+45) {
tmp = t_1;
} else if (u <= 1.55e+45) {
tmp = v / -t1;
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = t1 * (v / (u * u)) tmp = 0 if u <= -5.2e+45: tmp = t_1 elif u <= 1.55e+45: tmp = v / -t1 else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(t1 * Float64(v / Float64(u * u))) tmp = 0.0 if (u <= -5.2e+45) tmp = t_1; elseif (u <= 1.55e+45) tmp = Float64(v / Float64(-t1)); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = t1 * (v / (u * u)); tmp = 0.0; if (u <= -5.2e+45) tmp = t_1; elseif (u <= 1.55e+45) tmp = v / -t1; else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(t1 * N[(v / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[u, -5.2e+45], t$95$1, If[LessEqual[u, 1.55e+45], N[(v / (-t1)), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t1 \cdot \frac{v}{u \cdot u}\\
\mathbf{if}\;u \leq -5.2 \cdot 10^{+45}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq 1.55 \cdot 10^{+45}:\\
\;\;\;\;\frac{v}{-t1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if u < -5.20000000000000014e45 or 1.54999999999999994e45 < u Initial program 75.0%
Taylor expanded in t1 around 0
unpow2N/A
lower-*.f6471.0
Simplified71.0%
lift-neg.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6473.6
Applied egg-rr73.6%
associate-/r*N/A
lower-/.f64N/A
lower-/.f6479.5
Applied egg-rr79.5%
Applied egg-rr65.4%
if -5.20000000000000014e45 < u < 1.54999999999999994e45Initial program 69.1%
Taylor expanded in t1 around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6477.4
Simplified77.4%
Final simplification72.4%
(FPCore (u v t1) :precision binary64 (if (<= u -3.8e+154) (/ v (- u)) (/ v (- t1))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -3.8e+154) {
tmp = v / -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 <= (-3.8d+154)) then
tmp = v / -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 <= -3.8e+154) {
tmp = v / -u;
} else {
tmp = v / -t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -3.8e+154: tmp = v / -u else: tmp = v / -t1 return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -3.8e+154) tmp = Float64(v / Float64(-u)); else tmp = Float64(v / Float64(-t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -3.8e+154) tmp = v / -u; else tmp = v / -t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -3.8e+154], N[(v / (-u)), $MachinePrecision], N[(v / (-t1)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -3.8 \cdot 10^{+154}:\\
\;\;\;\;\frac{v}{-u}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{-t1}\\
\end{array}
\end{array}
if u < -3.7999999999999998e154Initial program 86.4%
lift-neg.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
*-commutativeN/A
lift-neg.f64N/A
distribute-frac-negN/A
distribute-frac-neg2N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f64100.0
Applied egg-rr100.0%
Taylor expanded in t1 around 0
mul-1-negN/A
lower-neg.f64100.0
Simplified100.0%
Taylor expanded in t1 around inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6437.4
Simplified37.4%
if -3.7999999999999998e154 < u Initial program 69.2%
Taylor expanded in t1 around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6461.6
Simplified61.6%
Final simplification58.3%
(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(v / Float64(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}{\left(-t1\right) - u}
\end{array}
Initial program 71.6%
lift-neg.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
frac-2negN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-neg.f64N/A
distribute-frac-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
lower-neg.f6498.5
Applied egg-rr98.5%
Taylor expanded in t1 around inf
Simplified61.4%
lift-neg.f64N/A
mul-1-negN/A
lift-+.f64N/A
frac-2negN/A
lower-/.f6461.4
Applied egg-rr61.4%
Final simplification61.4%
(FPCore (u v t1) :precision binary64 (/ v (- u)))
double code(double u, double v, double t1) {
return v / -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 / -u
end function
public static double code(double u, double v, double t1) {
return v / -u;
}
def code(u, v, t1): return v / -u
function code(u, v, t1) return Float64(v / Float64(-u)) end
function tmp = code(u, v, t1) tmp = v / -u; end
code[u_, v_, t1_] := N[(v / (-u)), $MachinePrecision]
\begin{array}{l}
\\
\frac{v}{-u}
\end{array}
Initial program 71.6%
lift-neg.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
*-commutativeN/A
lift-neg.f64N/A
distribute-frac-negN/A
distribute-frac-neg2N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f6497.9
Applied egg-rr97.9%
Taylor expanded in t1 around 0
mul-1-negN/A
lower-neg.f6461.0
Simplified61.0%
Taylor expanded in t1 around inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6416.4
Simplified16.4%
herbie shell --seed 2024208
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))