
(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 (/ (* (/ 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)) * Float64(-v)) / Float64(t1 + u)) end
function tmp = code(u, v, t1) tmp = ((t1 / (t1 + u)) * -v) / (t1 + u); end
code[u_, v_, t1_] := N[(N[(N[(t1 / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * (-v)), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{t1 + u}
\end{array}
Initial program 76.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.f6498.1
Applied egg-rr98.1%
Final simplification98.1%
(FPCore (u v t1) :precision binary64 (if (<= t1 -1.22e+154) (/ v (- (* u -2.0) t1)) (if (<= t1 2.4e+158) (* v (/ t1 (* (+ t1 u) (- (- t1) u)))) (/ v (- t1)))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -1.22e+154) {
tmp = v / ((u * -2.0) - t1);
} else if (t1 <= 2.4e+158) {
tmp = v * (t1 / ((t1 + u) * (-t1 - 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 (t1 <= (-1.22d+154)) then
tmp = v / ((u * (-2.0d0)) - t1)
else if (t1 <= 2.4d+158) then
tmp = v * (t1 / ((t1 + u) * (-t1 - u)))
else
tmp = v / -t1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (t1 <= -1.22e+154) {
tmp = v / ((u * -2.0) - t1);
} else if (t1 <= 2.4e+158) {
tmp = v * (t1 / ((t1 + u) * (-t1 - u)));
} else {
tmp = v / -t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if t1 <= -1.22e+154: tmp = v / ((u * -2.0) - t1) elif t1 <= 2.4e+158: tmp = v * (t1 / ((t1 + u) * (-t1 - u))) else: tmp = v / -t1 return tmp
function code(u, v, t1) tmp = 0.0 if (t1 <= -1.22e+154) tmp = Float64(v / Float64(Float64(u * -2.0) - t1)); elseif (t1 <= 2.4e+158) tmp = Float64(v * Float64(t1 / Float64(Float64(t1 + u) * Float64(Float64(-t1) - u)))); else tmp = Float64(v / Float64(-t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (t1 <= -1.22e+154) tmp = v / ((u * -2.0) - t1); elseif (t1 <= 2.4e+158) tmp = v * (t1 / ((t1 + u) * (-t1 - u))); else tmp = v / -t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[t1, -1.22e+154], N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 2.4e+158], N[(v * N[(t1 / N[(N[(t1 + u), $MachinePrecision] * N[((-t1) - u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(v / (-t1)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.22 \cdot 10^{+154}:\\
\;\;\;\;\frac{v}{u \cdot -2 - t1}\\
\mathbf{elif}\;t1 \leq 2.4 \cdot 10^{+158}:\\
\;\;\;\;v \cdot \frac{t1}{\left(t1 + u\right) \cdot \left(\left(-t1\right) - u\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{-t1}\\
\end{array}
\end{array}
if t1 < -1.22e154Initial program 46.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.8
Applied egg-rr99.8%
lift-+.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift-neg.f64N/A
associate-*l/N/A
lift-neg.f64N/A
distribute-rgt-neg-inN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-neg.f64N/A
associate-/r*N/A
lift-*.f64N/A
*-commutativeN/A
Applied egg-rr93.7%
Taylor expanded in u around 0
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6487.1
Simplified87.1%
if -1.22e154 < t1 < 2.40000000000000008e158Initial program 85.3%
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-/.f6491.5
Applied egg-rr91.5%
if 2.40000000000000008e158 < t1 Initial program 51.6%
Taylor expanded in t1 around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64100.0
Simplified100.0%
Final simplification92.0%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (* (/ (- v) u) (/ t1 u)))) (if (<= u -2.9e-6) t_1 (if (<= u 4.7e+45) (/ v (- t1)) t_1))))
double code(double u, double v, double t1) {
double t_1 = (-v / u) * (t1 / u);
double tmp;
if (u <= -2.9e-6) {
tmp = t_1;
} else if (u <= 4.7e+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 = (-v / u) * (t1 / u)
if (u <= (-2.9d-6)) then
tmp = t_1
else if (u <= 4.7d+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 = (-v / u) * (t1 / u);
double tmp;
if (u <= -2.9e-6) {
tmp = t_1;
} else if (u <= 4.7e+45) {
tmp = v / -t1;
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = (-v / u) * (t1 / u) tmp = 0 if u <= -2.9e-6: tmp = t_1 elif u <= 4.7e+45: tmp = v / -t1 else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(Float64(-v) / u) * Float64(t1 / u)) tmp = 0.0 if (u <= -2.9e-6) tmp = t_1; elseif (u <= 4.7e+45) tmp = Float64(v / Float64(-t1)); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = (-v / u) * (t1 / u); tmp = 0.0; if (u <= -2.9e-6) tmp = t_1; elseif (u <= 4.7e+45) tmp = v / -t1; else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(N[((-v) / u), $MachinePrecision] * N[(t1 / u), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[u, -2.9e-6], t$95$1, If[LessEqual[u, 4.7e+45], N[(v / (-t1)), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{u} \cdot \frac{t1}{u}\\
\mathbf{if}\;u \leq -2.9 \cdot 10^{-6}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq 4.7 \cdot 10^{+45}:\\
\;\;\;\;\frac{v}{-t1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if u < -2.9000000000000002e-6 or 4.70000000000000002e45 < u Initial program 86.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.f6484.4
Simplified84.4%
lift-neg.f64N/A
lift-*.f64N/A
div-invN/A
associate-*r*N/A
div-invN/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6487.4
Applied egg-rr87.4%
if -2.9000000000000002e-6 < u < 4.70000000000000002e45Initial program 68.4%
Taylor expanded in t1 around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6480.5
Simplified80.5%
Final simplification83.7%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ v (- (* u -2.0) t1))))
(if (<= t1 -1.25e-57)
t_1
(if (<= t1 5.8e-111) (* v (/ t1 (* u (- u)))) t_1))))
double code(double u, double v, double t1) {
double t_1 = v / ((u * -2.0) - t1);
double tmp;
if (t1 <= -1.25e-57) {
tmp = t_1;
} else if (t1 <= 5.8e-111) {
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 / ((u * (-2.0d0)) - t1)
if (t1 <= (-1.25d-57)) then
tmp = t_1
else if (t1 <= 5.8d-111) 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 / ((u * -2.0) - t1);
double tmp;
if (t1 <= -1.25e-57) {
tmp = t_1;
} else if (t1 <= 5.8e-111) {
tmp = v * (t1 / (u * -u));
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = v / ((u * -2.0) - t1) tmp = 0 if t1 <= -1.25e-57: tmp = t_1 elif t1 <= 5.8e-111: tmp = v * (t1 / (u * -u)) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(v / Float64(Float64(u * -2.0) - t1)) tmp = 0.0 if (t1 <= -1.25e-57) tmp = t_1; elseif (t1 <= 5.8e-111) 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 / ((u * -2.0) - t1); tmp = 0.0; if (t1 <= -1.25e-57) tmp = t_1; elseif (t1 <= 5.8e-111) 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[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -1.25e-57], t$95$1, If[LessEqual[t1, 5.8e-111], N[(v * N[(t1 / N[(u * (-u)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{v}{u \cdot -2 - t1}\\
\mathbf{if}\;t1 \leq -1.25 \cdot 10^{-57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 5.8 \cdot 10^{-111}:\\
\;\;\;\;v \cdot \frac{t1}{u \cdot \left(-u\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -1.25e-57 or 5.80000000000000003e-111 < t1 Initial program 72.2%
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%
lift-+.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift-neg.f64N/A
associate-*l/N/A
lift-neg.f64N/A
distribute-rgt-neg-inN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-neg.f64N/A
associate-/r*N/A
lift-*.f64N/A
*-commutativeN/A
Applied egg-rr95.8%
Taylor expanded in u around 0
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6483.2
Simplified83.2%
if -1.25e-57 < t1 < 5.80000000000000003e-111Initial program 82.6%
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-/.f6489.1
Applied egg-rr89.1%
Taylor expanded in t1 around 0
unpow2N/A
lower-*.f6482.2
Simplified82.2%
Final simplification82.8%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (* t1 (/ v (* u (- u)))))) (if (<= u -2.9e-6) t_1 (if (<= u 4.7e+45) (/ v (- t1)) t_1))))
double code(double u, double v, double t1) {
double t_1 = t1 * (v / (u * -u));
double tmp;
if (u <= -2.9e-6) {
tmp = t_1;
} else if (u <= 4.7e+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 <= (-2.9d-6)) then
tmp = t_1
else if (u <= 4.7d+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 <= -2.9e-6) {
tmp = t_1;
} else if (u <= 4.7e+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 <= -2.9e-6: tmp = t_1 elif u <= 4.7e+45: tmp = v / -t1 else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(t1 * Float64(v / Float64(u * Float64(-u)))) tmp = 0.0 if (u <= -2.9e-6) tmp = t_1; elseif (u <= 4.7e+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 <= -2.9e-6) tmp = t_1; elseif (u <= 4.7e+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, -2.9e-6], t$95$1, If[LessEqual[u, 4.7e+45], N[(v / (-t1)), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t1 \cdot \frac{v}{u \cdot \left(-u\right)}\\
\mathbf{if}\;u \leq -2.9 \cdot 10^{-6}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq 4.7 \cdot 10^{+45}:\\
\;\;\;\;\frac{v}{-t1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if u < -2.9000000000000002e-6 or 4.70000000000000002e45 < u Initial program 86.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.f6484.4
Simplified84.4%
if -2.9000000000000002e-6 < u < 4.70000000000000002e45Initial program 68.4%
Taylor expanded in t1 around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6480.5
Simplified80.5%
Final simplification82.3%
(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 76.7%
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.3
Applied egg-rr97.3%
Final simplification97.3%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (* t1 (/ v (* u u))))) (if (<= u -4e+75) t_1 (if (<= u 2.2e+56) (/ v (- t1)) t_1))))
double code(double u, double v, double t1) {
double t_1 = t1 * (v / (u * u));
double tmp;
if (u <= -4e+75) {
tmp = t_1;
} else if (u <= 2.2e+56) {
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 <= (-4d+75)) then
tmp = t_1
else if (u <= 2.2d+56) 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 <= -4e+75) {
tmp = t_1;
} else if (u <= 2.2e+56) {
tmp = v / -t1;
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = t1 * (v / (u * u)) tmp = 0 if u <= -4e+75: tmp = t_1 elif u <= 2.2e+56: 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 <= -4e+75) tmp = t_1; elseif (u <= 2.2e+56) 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 <= -4e+75) tmp = t_1; elseif (u <= 2.2e+56) 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, -4e+75], t$95$1, If[LessEqual[u, 2.2e+56], 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 -4 \cdot 10^{+75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq 2.2 \cdot 10^{+56}:\\
\;\;\;\;\frac{v}{-t1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if u < -3.99999999999999971e75 or 2.20000000000000016e56 < u Initial program 85.7%
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.f6485.3
Simplified85.3%
Applied egg-rr75.2%
if -3.99999999999999971e75 < u < 2.20000000000000016e56Initial program 70.9%
Taylor expanded in t1 around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6474.2
Simplified74.2%
Final simplification74.6%
(FPCore (u v t1) :precision binary64 (/ v (* (+ t1 u) (- -1.0 (/ u t1)))))
double code(double u, double v, double t1) {
return v / ((t1 + u) * (-1.0 - (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 / ((t1 + u) * ((-1.0d0) - (u / t1)))
end function
public static double code(double u, double v, double t1) {
return v / ((t1 + u) * (-1.0 - (u / t1)));
}
def code(u, v, t1): return v / ((t1 + u) * (-1.0 - (u / t1)))
function code(u, v, t1) return Float64(v / Float64(Float64(t1 + u) * Float64(-1.0 - Float64(u / t1)))) end
function tmp = code(u, v, t1) tmp = v / ((t1 + u) * (-1.0 - (u / t1))); end
code[u_, v_, t1_] := N[(v / N[(N[(t1 + u), $MachinePrecision] * N[(-1.0 - N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{v}{\left(t1 + u\right) \cdot \left(-1 - \frac{u}{t1}\right)}
\end{array}
Initial program 76.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.f6498.1
Applied egg-rr98.1%
lift-+.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift-neg.f64N/A
associate-*l/N/A
lift-neg.f64N/A
distribute-rgt-neg-inN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-neg.f64N/A
associate-/r*N/A
lift-*.f64N/A
*-commutativeN/A
Applied egg-rr95.9%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (/ (- v) u))) (if (<= u -3.8e+79) t_1 (if (<= u 5e+105) (/ v (- t1)) t_1))))
double code(double u, double v, double t1) {
double t_1 = -v / u;
double tmp;
if (u <= -3.8e+79) {
tmp = t_1;
} else if (u <= 5e+105) {
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 = -v / u
if (u <= (-3.8d+79)) then
tmp = t_1
else if (u <= 5d+105) 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 = -v / u;
double tmp;
if (u <= -3.8e+79) {
tmp = t_1;
} else if (u <= 5e+105) {
tmp = v / -t1;
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -v / u tmp = 0 if u <= -3.8e+79: tmp = t_1 elif u <= 5e+105: tmp = v / -t1 else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-v) / u) tmp = 0.0 if (u <= -3.8e+79) tmp = t_1; elseif (u <= 5e+105) tmp = Float64(v / Float64(-t1)); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -v / u; tmp = 0.0; if (u <= -3.8e+79) tmp = t_1; elseif (u <= 5e+105) tmp = v / -t1; else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / u), $MachinePrecision]}, If[LessEqual[u, -3.8e+79], t$95$1, If[LessEqual[u, 5e+105], N[(v / (-t1)), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{u}\\
\mathbf{if}\;u \leq -3.8 \cdot 10^{+79}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq 5 \cdot 10^{+105}:\\
\;\;\;\;\frac{v}{-t1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if u < -3.8000000000000002e79 or 5.00000000000000046e105 < u Initial program 84.7%
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%
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.f6461.1
Simplified61.1%
Taylor expanded in t1 around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6445.5
Simplified45.5%
if -3.8000000000000002e79 < u < 5.00000000000000046e105Initial program 72.5%
Taylor expanded in t1 around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6470.5
Simplified70.5%
Final simplification62.0%
(FPCore (u v t1) :precision binary64 (if (<= t1 -9.2e+120) (/ v t1) (if (<= t1 3e+106) (/ (- v) u) (/ v t1))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -9.2e+120) {
tmp = v / t1;
} else if (t1 <= 3e+106) {
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 (t1 <= (-9.2d+120)) then
tmp = v / t1
else if (t1 <= 3d+106) 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 (t1 <= -9.2e+120) {
tmp = v / t1;
} else if (t1 <= 3e+106) {
tmp = -v / u;
} else {
tmp = v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if t1 <= -9.2e+120: tmp = v / t1 elif t1 <= 3e+106: tmp = -v / u else: tmp = v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if (t1 <= -9.2e+120) tmp = Float64(v / t1); elseif (t1 <= 3e+106) tmp = Float64(Float64(-v) / u); else tmp = Float64(v / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (t1 <= -9.2e+120) tmp = v / t1; elseif (t1 <= 3e+106) tmp = -v / u; else tmp = v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[t1, -9.2e+120], N[(v / t1), $MachinePrecision], If[LessEqual[t1, 3e+106], N[((-v) / u), $MachinePrecision], N[(v / t1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -9.2 \cdot 10^{+120}:\\
\;\;\;\;\frac{v}{t1}\\
\mathbf{elif}\;t1 \leq 3 \cdot 10^{+106}:\\
\;\;\;\;\frac{-v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{t1}\\
\end{array}
\end{array}
if t1 < -9.1999999999999997e120 or 3.0000000000000001e106 < t1 Initial program 56.4%
Taylor expanded in t1 around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6489.5
Simplified89.5%
distribute-frac-negN/A
distribute-frac-neg2N/A
lift-neg.f64N/A
clear-numN/A
associate-/r/N/A
lower-*.f64N/A
frac-2negN/A
metadata-evalN/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f6489.4
Applied egg-rr89.4%
associate-*l/N/A
neg-mul-1N/A
+-lft-identityN/A
flip3-+N/A
sqr-powN/A
pow-prod-downN/A
sqr-negN/A
lift-neg.f64N/A
lift-neg.f64N/A
pow-prod-downN/A
sqr-powN/A
sqr-negN/A
lift-neg.f64N/A
lift-neg.f64N/A
remove-double-negN/A
lift-neg.f64N/A
neg-mul-1N/A
associate-*r*N/A
metadata-evalN/A
flip3-+N/A
Applied egg-rr45.4%
if -9.1999999999999997e120 < t1 < 3.0000000000000001e106Initial program 85.2%
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-/.f6496.3
Applied egg-rr96.3%
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.f6457.3
Simplified57.3%
Taylor expanded in t1 around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6421.4
Simplified21.4%
Final simplification28.5%
(FPCore (u v t1) :precision binary64 (/ v (- (* u -2.0) t1)))
double code(double u, double v, double t1) {
return v / ((u * -2.0) - 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 * (-2.0d0)) - t1)
end function
public static double code(double u, double v, double t1) {
return v / ((u * -2.0) - t1);
}
def code(u, v, t1): return v / ((u * -2.0) - t1)
function code(u, v, t1) return Float64(v / Float64(Float64(u * -2.0) - t1)) end
function tmp = code(u, v, t1) tmp = v / ((u * -2.0) - t1); end
code[u_, v_, t1_] := N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{v}{u \cdot -2 - t1}
\end{array}
Initial program 76.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.f6498.1
Applied egg-rr98.1%
lift-+.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift-neg.f64N/A
associate-*l/N/A
lift-neg.f64N/A
distribute-rgt-neg-inN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-neg.f64N/A
associate-/r*N/A
lift-*.f64N/A
*-commutativeN/A
Applied egg-rr95.9%
Taylor expanded in u around 0
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6463.1
Simplified63.1%
(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 76.7%
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.3
Applied egg-rr97.3%
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.f6466.9
Simplified66.9%
Taylor expanded in v around 0
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower-neg.f64N/A
lower-+.f6462.8
Simplified62.8%
Final simplification62.8%
(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(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 76.7%
Taylor expanded in t1 around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6453.9
Simplified53.9%
distribute-frac-negN/A
distribute-frac-neg2N/A
lift-neg.f64N/A
clear-numN/A
associate-/r/N/A
lower-*.f64N/A
frac-2negN/A
metadata-evalN/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f6453.8
Applied egg-rr53.8%
associate-*l/N/A
neg-mul-1N/A
+-lft-identityN/A
flip3-+N/A
sqr-powN/A
pow-prod-downN/A
sqr-negN/A
lift-neg.f64N/A
lift-neg.f64N/A
pow-prod-downN/A
sqr-powN/A
sqr-negN/A
lift-neg.f64N/A
lift-neg.f64N/A
remove-double-negN/A
lift-neg.f64N/A
neg-mul-1N/A
associate-*r*N/A
metadata-evalN/A
flip3-+N/A
Applied egg-rr15.7%
herbie shell --seed 2024215
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))