
(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 (* (/ 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(-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[(t1 / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * (-N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision])), $MachinePrecision]
\begin{array}{l}
\\
\frac{t1}{t1 + u} \cdot \left(-\frac{v}{t1 + u}\right)
\end{array}
Initial program 70.2%
*-commutativeN/A
neg-mul-1N/A
associate-*r*N/A
times-fracN/A
*-commutativeN/A
neg-mul-1N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
neg-lowering-neg.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6498.5
Applied egg-rr98.5%
Final simplification98.5%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (* (+ t1 u) (+ t1 u)))) (if (<= (/ (* v (- t1)) t_1) 4e+228) (* v (/ (- t1) t_1)) (- (/ v t1)))))
double code(double u, double v, double t1) {
double t_1 = (t1 + u) * (t1 + u);
double tmp;
if (((v * -t1) / t_1) <= 4e+228) {
tmp = v * (-t1 / t_1);
} 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) :: t_1
real(8) :: tmp
t_1 = (t1 + u) * (t1 + u)
if (((v * -t1) / t_1) <= 4d+228) then
tmp = v * (-t1 / t_1)
else
tmp = -(v / t1)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = (t1 + u) * (t1 + u);
double tmp;
if (((v * -t1) / t_1) <= 4e+228) {
tmp = v * (-t1 / t_1);
} else {
tmp = -(v / t1);
}
return tmp;
}
def code(u, v, t1): t_1 = (t1 + u) * (t1 + u) tmp = 0 if ((v * -t1) / t_1) <= 4e+228: tmp = v * (-t1 / t_1) else: tmp = -(v / t1) return tmp
function code(u, v, t1) t_1 = Float64(Float64(t1 + u) * Float64(t1 + u)) tmp = 0.0 if (Float64(Float64(v * Float64(-t1)) / t_1) <= 4e+228) tmp = Float64(v * Float64(Float64(-t1) / t_1)); else tmp = Float64(-Float64(v / t1)); end return tmp end
function tmp_2 = code(u, v, t1) t_1 = (t1 + u) * (t1 + u); tmp = 0.0; if (((v * -t1) / t_1) <= 4e+228) tmp = v * (-t1 / t_1); else tmp = -(v / t1); end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(v * (-t1)), $MachinePrecision] / t$95$1), $MachinePrecision], 4e+228], N[(v * N[((-t1) / t$95$1), $MachinePrecision]), $MachinePrecision], (-N[(v / t1), $MachinePrecision])]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t1 + u\right) \cdot \left(t1 + u\right)\\
\mathbf{if}\;\frac{v \cdot \left(-t1\right)}{t\_1} \leq 4 \cdot 10^{+228}:\\
\;\;\;\;v \cdot \frac{-t1}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;-\frac{v}{t1}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (neg.f64 t1) v) (*.f64 (+.f64 t1 u) (+.f64 t1 u))) < 3.9999999999999997e228Initial program 84.3%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6487.4
Applied egg-rr87.4%
if 3.9999999999999997e228 < (/.f64 (*.f64 (neg.f64 t1) v) (*.f64 (+.f64 t1 u) (+.f64 t1 u))) Initial program 9.2%
Taylor expanded in t1 around inf
associate-*r/N/A
/-lowering-/.f64N/A
mul-1-negN/A
neg-lowering-neg.f6484.0
Simplified84.0%
Final simplification86.8%
(FPCore (u v t1) :precision binary64 (if (<= t1 -9e-86) (- (/ v (+ t1 u))) (if (<= t1 7e-48) (* (/ v u) (/ t1 (- u))) (/ -1.0 (/ (+ t1 u) v)))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -9e-86) {
tmp = -(v / (t1 + u));
} else if (t1 <= 7e-48) {
tmp = (v / u) * (t1 / -u);
} else {
tmp = -1.0 / ((t1 + u) / v);
}
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 <= (-9d-86)) then
tmp = -(v / (t1 + u))
else if (t1 <= 7d-48) then
tmp = (v / u) * (t1 / -u)
else
tmp = (-1.0d0) / ((t1 + u) / v)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (t1 <= -9e-86) {
tmp = -(v / (t1 + u));
} else if (t1 <= 7e-48) {
tmp = (v / u) * (t1 / -u);
} else {
tmp = -1.0 / ((t1 + u) / v);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if t1 <= -9e-86: tmp = -(v / (t1 + u)) elif t1 <= 7e-48: tmp = (v / u) * (t1 / -u) else: tmp = -1.0 / ((t1 + u) / v) return tmp
function code(u, v, t1) tmp = 0.0 if (t1 <= -9e-86) tmp = Float64(-Float64(v / Float64(t1 + u))); elseif (t1 <= 7e-48) tmp = Float64(Float64(v / u) * Float64(t1 / Float64(-u))); else tmp = Float64(-1.0 / Float64(Float64(t1 + u) / v)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (t1 <= -9e-86) tmp = -(v / (t1 + u)); elseif (t1 <= 7e-48) tmp = (v / u) * (t1 / -u); else tmp = -1.0 / ((t1 + u) / v); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[t1, -9e-86], (-N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), If[LessEqual[t1, 7e-48], N[(N[(v / u), $MachinePrecision] * N[(t1 / (-u)), $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[(N[(t1 + u), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -9 \cdot 10^{-86}:\\
\;\;\;\;-\frac{v}{t1 + u}\\
\mathbf{elif}\;t1 \leq 7 \cdot 10^{-48}:\\
\;\;\;\;\frac{v}{u} \cdot \frac{t1}{-u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{t1 + u}{v}}\\
\end{array}
\end{array}
if t1 < -8.9999999999999995e-86Initial program 63.1%
*-commutativeN/A
times-fracN/A
distribute-frac-negN/A
distribute-frac-neg2N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
neg-lowering-neg.f64N/A
+-lowering-+.f6499.9
Applied egg-rr99.9%
Taylor expanded in t1 around inf
Simplified79.9%
if -8.9999999999999995e-86 < t1 < 6.99999999999999982e-48Initial program 77.4%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6480.2
Applied egg-rr80.2%
Taylor expanded in t1 around 0
unpow2N/A
*-lowering-*.f6474.0
Simplified74.0%
associate-*l/N/A
frac-2negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
remove-double-negN/A
distribute-lft-neg-inN/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
neg-lowering-neg.f64N/A
/-lowering-/.f6480.1
Applied egg-rr80.1%
if 6.99999999999999982e-48 < t1 Initial program 70.5%
*-commutativeN/A
times-fracN/A
distribute-frac-negN/A
distribute-frac-neg2N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
neg-lowering-neg.f64N/A
+-lowering-+.f6499.9
Applied egg-rr99.9%
Taylor expanded in t1 around inf
Simplified86.7%
distribute-frac-neg2N/A
neg-mul-1N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6486.8
Applied egg-rr86.8%
Final simplification81.7%
(FPCore (u v t1) :precision binary64 (if (<= t1 -5e-139) (- (/ v (+ t1 u))) (if (<= t1 1.6e-47) (* (- v) (/ t1 (* u u))) (/ -1.0 (/ (+ t1 u) v)))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -5e-139) {
tmp = -(v / (t1 + u));
} else if (t1 <= 1.6e-47) {
tmp = -v * (t1 / (u * u));
} else {
tmp = -1.0 / ((t1 + u) / v);
}
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 <= (-5d-139)) then
tmp = -(v / (t1 + u))
else if (t1 <= 1.6d-47) then
tmp = -v * (t1 / (u * u))
else
tmp = (-1.0d0) / ((t1 + u) / v)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (t1 <= -5e-139) {
tmp = -(v / (t1 + u));
} else if (t1 <= 1.6e-47) {
tmp = -v * (t1 / (u * u));
} else {
tmp = -1.0 / ((t1 + u) / v);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if t1 <= -5e-139: tmp = -(v / (t1 + u)) elif t1 <= 1.6e-47: tmp = -v * (t1 / (u * u)) else: tmp = -1.0 / ((t1 + u) / v) return tmp
function code(u, v, t1) tmp = 0.0 if (t1 <= -5e-139) tmp = Float64(-Float64(v / Float64(t1 + u))); elseif (t1 <= 1.6e-47) tmp = Float64(Float64(-v) * Float64(t1 / Float64(u * u))); else tmp = Float64(-1.0 / Float64(Float64(t1 + u) / v)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (t1 <= -5e-139) tmp = -(v / (t1 + u)); elseif (t1 <= 1.6e-47) tmp = -v * (t1 / (u * u)); else tmp = -1.0 / ((t1 + u) / v); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[t1, -5e-139], (-N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), If[LessEqual[t1, 1.6e-47], N[((-v) * N[(t1 / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[(N[(t1 + u), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -5 \cdot 10^{-139}:\\
\;\;\;\;-\frac{v}{t1 + u}\\
\mathbf{elif}\;t1 \leq 1.6 \cdot 10^{-47}:\\
\;\;\;\;\left(-v\right) \cdot \frac{t1}{u \cdot u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{t1 + u}{v}}\\
\end{array}
\end{array}
if t1 < -5.00000000000000034e-139Initial program 65.1%
*-commutativeN/A
times-fracN/A
distribute-frac-negN/A
distribute-frac-neg2N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
neg-lowering-neg.f64N/A
+-lowering-+.f6499.9
Applied egg-rr99.9%
Taylor expanded in t1 around inf
Simplified78.3%
if -5.00000000000000034e-139 < t1 < 1.6e-47Initial program 76.8%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6478.8
Applied egg-rr78.8%
Taylor expanded in t1 around 0
unpow2N/A
*-lowering-*.f6475.2
Simplified75.2%
if 1.6e-47 < t1 Initial program 70.5%
*-commutativeN/A
times-fracN/A
distribute-frac-negN/A
distribute-frac-neg2N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
neg-lowering-neg.f64N/A
+-lowering-+.f6499.9
Applied egg-rr99.9%
Taylor expanded in t1 around inf
Simplified86.7%
distribute-frac-neg2N/A
neg-mul-1N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6486.8
Applied egg-rr86.8%
Final simplification79.5%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (- (/ v (+ t1 u)))))
(if (<= t1 -3.7e-144)
t_1
(if (<= t1 1.4e-47) (* (- v) (/ t1 (* u u))) t_1))))
double code(double u, double v, double t1) {
double t_1 = -(v / (t1 + u));
double tmp;
if (t1 <= -3.7e-144) {
tmp = t_1;
} else if (t1 <= 1.4e-47) {
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 <= (-3.7d-144)) then
tmp = t_1
else if (t1 <= 1.4d-47) 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 <= -3.7e-144) {
tmp = t_1;
} else if (t1 <= 1.4e-47) {
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 <= -3.7e-144: tmp = t_1 elif t1 <= 1.4e-47: tmp = -v * (t1 / (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 <= -3.7e-144) tmp = t_1; elseif (t1 <= 1.4e-47) tmp = Float64(Float64(-v) * Float64(t1 / 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 <= -3.7e-144) tmp = t_1; elseif (t1 <= 1.4e-47) 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, -3.7e-144], t$95$1, If[LessEqual[t1, 1.4e-47], N[((-v) * N[(t1 / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -\frac{v}{t1 + u}\\
\mathbf{if}\;t1 \leq -3.7 \cdot 10^{-144}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 1.4 \cdot 10^{-47}:\\
\;\;\;\;\left(-v\right) \cdot \frac{t1}{u \cdot u}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -3.7000000000000003e-144 or 1.39999999999999996e-47 < t1 Initial program 67.1%
*-commutativeN/A
times-fracN/A
distribute-frac-negN/A
distribute-frac-neg2N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
neg-lowering-neg.f64N/A
+-lowering-+.f6499.9
Applied egg-rr99.9%
Taylor expanded in t1 around inf
Simplified81.5%
if -3.7000000000000003e-144 < t1 < 1.39999999999999996e-47Initial program 76.8%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6478.8
Applied egg-rr78.8%
Taylor expanded in t1 around 0
unpow2N/A
*-lowering-*.f6475.2
Simplified75.2%
Final simplification79.5%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (- (/ v (+ t1 u)))))
(if (<= t1 -1.05e-85)
t_1
(if (<= t1 2.8e-47) (* (- 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.05e-85) {
tmp = t_1;
} else if (t1 <= 2.8e-47) {
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.05d-85)) then
tmp = t_1
else if (t1 <= 2.8d-47) 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.05e-85) {
tmp = t_1;
} else if (t1 <= 2.8e-47) {
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.05e-85: tmp = t_1 elif t1 <= 2.8e-47: 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 <= -1.05e-85) tmp = t_1; elseif (t1 <= 2.8e-47) tmp = Float64(Float64(-t1) * Float64(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 <= -1.05e-85) tmp = t_1; elseif (t1 <= 2.8e-47) 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.05e-85], t$95$1, If[LessEqual[t1, 2.8e-47], N[((-t1) * N[(v / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -\frac{v}{t1 + u}\\
\mathbf{if}\;t1 \leq -1.05 \cdot 10^{-85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 2.8 \cdot 10^{-47}:\\
\;\;\;\;\left(-t1\right) \cdot \frac{v}{u \cdot u}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -1.05e-85 or 2.79999999999999993e-47 < t1 Initial program 66.1%
*-commutativeN/A
times-fracN/A
distribute-frac-negN/A
distribute-frac-neg2N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
neg-lowering-neg.f64N/A
+-lowering-+.f6499.9
Applied egg-rr99.9%
Taylor expanded in t1 around inf
Simplified82.6%
if -1.05e-85 < t1 < 2.79999999999999993e-47Initial program 77.4%
Taylor expanded in t1 around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
unpow2N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f6474.0
Simplified74.0%
Final simplification79.5%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (- (/ v u)))) (if (<= u -1.36e+138) t_1 (if (<= u 5.2e+144) (- (/ v t1)) t_1))))
double code(double u, double v, double t1) {
double t_1 = -(v / u);
double tmp;
if (u <= -1.36e+138) {
tmp = t_1;
} else if (u <= 5.2e+144) {
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 <= (-1.36d+138)) then
tmp = t_1
else if (u <= 5.2d+144) 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 <= -1.36e+138) {
tmp = t_1;
} else if (u <= 5.2e+144) {
tmp = -(v / t1);
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -(v / u) tmp = 0 if u <= -1.36e+138: tmp = t_1 elif u <= 5.2e+144: 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 <= -1.36e+138) tmp = t_1; elseif (u <= 5.2e+144) tmp = Float64(-Float64(v / 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 <= -1.36e+138) tmp = t_1; elseif (u <= 5.2e+144) 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, -1.36e+138], t$95$1, If[LessEqual[u, 5.2e+144], (-N[(v / t1), $MachinePrecision]), t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -\frac{v}{u}\\
\mathbf{if}\;u \leq -1.36 \cdot 10^{+138}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq 5.2 \cdot 10^{+144}:\\
\;\;\;\;-\frac{v}{t1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if u < -1.35999999999999995e138 or 5.1999999999999998e144 < u Initial program 79.0%
*-commutativeN/A
times-fracN/A
distribute-frac-negN/A
distribute-frac-neg2N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
neg-lowering-neg.f64N/A
+-lowering-+.f6499.9
Applied egg-rr99.9%
Taylor expanded in t1 around inf
Simplified44.7%
Taylor expanded in t1 around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
neg-lowering-neg.f6439.4
Simplified39.4%
if -1.35999999999999995e138 < u < 5.1999999999999998e144Initial program 66.8%
Taylor expanded in t1 around inf
associate-*r/N/A
/-lowering-/.f64N/A
mul-1-negN/A
neg-lowering-neg.f6473.6
Simplified73.6%
Final simplification64.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 70.2%
*-commutativeN/A
times-fracN/A
distribute-frac-negN/A
distribute-frac-neg2N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
neg-lowering-neg.f64N/A
+-lowering-+.f6498.3
Applied egg-rr98.3%
Taylor expanded in t1 around inf
Simplified65.8%
Final simplification65.8%
(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(-Float64(v / 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 70.2%
*-commutativeN/A
times-fracN/A
distribute-frac-negN/A
distribute-frac-neg2N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
neg-lowering-neg.f64N/A
+-lowering-+.f6498.3
Applied egg-rr98.3%
Taylor expanded in t1 around inf
Simplified65.8%
Taylor expanded in t1 around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
neg-lowering-neg.f6417.1
Simplified17.1%
Final simplification17.1%
herbie shell --seed 2024198
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))