
(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 12 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(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 69.9%
associate-/r*83.8%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in t1 around 0 93.4%
+-commutative93.4%
Simplified93.4%
Taylor expanded in v around -inf 69.9%
times-frac98.6%
mul-1-neg98.6%
neg-mul-198.6%
+-commutative98.6%
sub-neg98.6%
Simplified98.6%
Final simplification98.6%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (* v (/ (- t1) (* (+ t1 u) (+ t1 u)))))
(t_2 (/ (- (/ u (/ t1 v)) v) (+ t1 u))))
(if (<= t1 -1.6e+123)
t_2
(if (<= t1 -1.66e-102)
t_1
(if (<= t1 1.02e-184)
(* (/ t1 u) (/ (- v) u))
(if (<= t1 4.5e+148) t_1 t_2))))))
double code(double u, double v, double t1) {
double t_1 = v * (-t1 / ((t1 + u) * (t1 + u)));
double t_2 = ((u / (t1 / v)) - v) / (t1 + u);
double tmp;
if (t1 <= -1.6e+123) {
tmp = t_2;
} else if (t1 <= -1.66e-102) {
tmp = t_1;
} else if (t1 <= 1.02e-184) {
tmp = (t1 / u) * (-v / u);
} else if (t1 <= 4.5e+148) {
tmp = 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 = v * (-t1 / ((t1 + u) * (t1 + u)))
t_2 = ((u / (t1 / v)) - v) / (t1 + u)
if (t1 <= (-1.6d+123)) then
tmp = t_2
else if (t1 <= (-1.66d-102)) then
tmp = t_1
else if (t1 <= 1.02d-184) then
tmp = (t1 / u) * (-v / u)
else if (t1 <= 4.5d+148) then
tmp = 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 = v * (-t1 / ((t1 + u) * (t1 + u)));
double t_2 = ((u / (t1 / v)) - v) / (t1 + u);
double tmp;
if (t1 <= -1.6e+123) {
tmp = t_2;
} else if (t1 <= -1.66e-102) {
tmp = t_1;
} else if (t1 <= 1.02e-184) {
tmp = (t1 / u) * (-v / u);
} else if (t1 <= 4.5e+148) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(u, v, t1): t_1 = v * (-t1 / ((t1 + u) * (t1 + u))) t_2 = ((u / (t1 / v)) - v) / (t1 + u) tmp = 0 if t1 <= -1.6e+123: tmp = t_2 elif t1 <= -1.66e-102: tmp = t_1 elif t1 <= 1.02e-184: tmp = (t1 / u) * (-v / u) elif t1 <= 4.5e+148: tmp = t_1 else: tmp = t_2 return tmp
function code(u, v, t1) t_1 = Float64(v * Float64(Float64(-t1) / Float64(Float64(t1 + u) * Float64(t1 + u)))) t_2 = Float64(Float64(Float64(u / Float64(t1 / v)) - v) / Float64(t1 + u)) tmp = 0.0 if (t1 <= -1.6e+123) tmp = t_2; elseif (t1 <= -1.66e-102) tmp = t_1; elseif (t1 <= 1.02e-184) tmp = Float64(Float64(t1 / u) * Float64(Float64(-v) / u)); elseif (t1 <= 4.5e+148) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = v * (-t1 / ((t1 + u) * (t1 + u))); t_2 = ((u / (t1 / v)) - v) / (t1 + u); tmp = 0.0; if (t1 <= -1.6e+123) tmp = t_2; elseif (t1 <= -1.66e-102) tmp = t_1; elseif (t1 <= 1.02e-184) tmp = (t1 / u) * (-v / u); elseif (t1 <= 4.5e+148) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(v * N[((-t1) / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(u / N[(t1 / v), $MachinePrecision]), $MachinePrecision] - v), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -1.6e+123], t$95$2, If[LessEqual[t1, -1.66e-102], t$95$1, If[LessEqual[t1, 1.02e-184], N[(N[(t1 / u), $MachinePrecision] * N[((-v) / u), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 4.5e+148], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\
t_2 := \frac{\frac{u}{\frac{t1}{v}} - v}{t1 + u}\\
\mathbf{if}\;t1 \leq -1.6 \cdot 10^{+123}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t1 \leq -1.66 \cdot 10^{-102}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t1 \leq 1.02 \cdot 10^{-184}:\\
\;\;\;\;\frac{t1}{u} \cdot \frac{-v}{u}\\
\mathbf{elif}\;t1 \leq 4.5 \cdot 10^{+148}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t1 < -1.60000000000000002e123 or 4.49999999999999994e148 < t1 Initial program 39.1%
associate-/r*69.5%
associate-/l*98.1%
Simplified98.1%
Taylor expanded in t1 around inf 83.1%
neg-mul-183.1%
+-commutative83.1%
unsub-neg83.1%
associate-/l*92.6%
Simplified92.6%
if -1.60000000000000002e123 < t1 < -1.66000000000000001e-102 or 1.0200000000000001e-184 < t1 < 4.49999999999999994e148Initial program 85.6%
associate-*l/91.0%
*-commutative91.0%
Simplified91.0%
if -1.66000000000000001e-102 < t1 < 1.0200000000000001e-184Initial program 75.9%
associate-/r*82.9%
associate-/l*91.4%
Simplified91.4%
Taylor expanded in v around 0 82.9%
mul-1-neg82.9%
associate-*l/93.7%
distribute-rgt-neg-out93.7%
Simplified93.7%
Taylor expanded in t1 around 0 74.0%
unpow274.0%
times-frac89.3%
*-commutative89.3%
neg-mul-189.3%
distribute-rgt-neg-in89.3%
Simplified89.3%
Final simplification90.9%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -5e-100) (not (<= t1 2.2e-121))) (/ (- v) (+ t1 u)) (* (- v) (/ t1 (* u u)))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -5e-100) || !(t1 <= 2.2e-121)) {
tmp = -v / (t1 + u);
} else {
tmp = -v * (t1 / (u * u));
}
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-100)) .or. (.not. (t1 <= 2.2d-121))) then
tmp = -v / (t1 + u)
else
tmp = -v * (t1 / (u * u))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -5e-100) || !(t1 <= 2.2e-121)) {
tmp = -v / (t1 + u);
} else {
tmp = -v * (t1 / (u * u));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -5e-100) or not (t1 <= 2.2e-121): tmp = -v / (t1 + u) else: tmp = -v * (t1 / (u * u)) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -5e-100) || !(t1 <= 2.2e-121)) tmp = Float64(Float64(-v) / Float64(t1 + u)); else tmp = Float64(Float64(-v) * Float64(t1 / Float64(u * u))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -5e-100) || ~((t1 <= 2.2e-121))) tmp = -v / (t1 + u); else tmp = -v * (t1 / (u * u)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -5e-100], N[Not[LessEqual[t1, 2.2e-121]], $MachinePrecision]], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], N[((-v) * N[(t1 / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -5 \cdot 10^{-100} \lor \neg \left(t1 \leq 2.2 \cdot 10^{-121}\right):\\
\;\;\;\;\frac{-v}{t1 + u}\\
\mathbf{else}:\\
\;\;\;\;\left(-v\right) \cdot \frac{t1}{u \cdot u}\\
\end{array}
\end{array}
if t1 < -5.0000000000000001e-100 or 2.20000000000000021e-121 < t1 Initial program 64.1%
associate-/r*82.6%
associate-/l*98.6%
Simplified98.6%
Taylor expanded in t1 around inf 79.6%
neg-mul-179.6%
Simplified79.6%
if -5.0000000000000001e-100 < t1 < 2.20000000000000021e-121Initial program 79.9%
associate-*l/83.4%
*-commutative83.4%
Simplified83.4%
Taylor expanded in t1 around 0 80.9%
associate-*r/80.9%
neg-mul-180.9%
unpow280.9%
Simplified80.9%
Final simplification80.1%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -4.3e-102) (not (<= t1 2.25e-121))) (/ (- v) (+ t1 u)) (* v (/ (/ (- t1) u) u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -4.3e-102) || !(t1 <= 2.25e-121)) {
tmp = -v / (t1 + u);
} else {
tmp = v * ((-t1 / u) / u);
}
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 <= (-4.3d-102)) .or. (.not. (t1 <= 2.25d-121))) then
tmp = -v / (t1 + u)
else
tmp = v * ((-t1 / u) / u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -4.3e-102) || !(t1 <= 2.25e-121)) {
tmp = -v / (t1 + u);
} else {
tmp = v * ((-t1 / u) / u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -4.3e-102) or not (t1 <= 2.25e-121): tmp = -v / (t1 + u) else: tmp = v * ((-t1 / u) / u) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -4.3e-102) || !(t1 <= 2.25e-121)) tmp = Float64(Float64(-v) / Float64(t1 + u)); else tmp = Float64(v * Float64(Float64(Float64(-t1) / u) / u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -4.3e-102) || ~((t1 <= 2.25e-121))) tmp = -v / (t1 + u); else tmp = v * ((-t1 / u) / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -4.3e-102], N[Not[LessEqual[t1, 2.25e-121]], $MachinePrecision]], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], N[(v * N[(N[((-t1) / u), $MachinePrecision] / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -4.3 \cdot 10^{-102} \lor \neg \left(t1 \leq 2.25 \cdot 10^{-121}\right):\\
\;\;\;\;\frac{-v}{t1 + u}\\
\mathbf{else}:\\
\;\;\;\;v \cdot \frac{\frac{-t1}{u}}{u}\\
\end{array}
\end{array}
if t1 < -4.2999999999999997e-102 or 2.2500000000000002e-121 < t1 Initial program 64.1%
associate-/r*82.6%
associate-/l*98.6%
Simplified98.6%
Taylor expanded in t1 around inf 79.6%
neg-mul-179.6%
Simplified79.6%
if -4.2999999999999997e-102 < t1 < 2.2500000000000002e-121Initial program 79.9%
associate-/l*79.1%
neg-mul-179.1%
associate-*r/87.3%
times-frac91.8%
div-inv91.8%
clear-num91.8%
Applied egg-rr91.8%
Taylor expanded in t1 around 0 77.4%
*-commutative77.4%
unpow277.4%
times-frac89.0%
*-commutative89.0%
associate-*l/87.1%
associate-*r/88.4%
associate-*r*88.4%
*-commutative88.4%
associate-*r/88.4%
neg-mul-188.4%
distribute-neg-frac88.4%
Simplified88.4%
Final simplification82.8%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -3.85e-100) (not (<= t1 2.3e-68))) (/ (- v) (+ t1 u)) (* (/ t1 u) (/ (- v) u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -3.85e-100) || !(t1 <= 2.3e-68)) {
tmp = -v / (t1 + u);
} else {
tmp = (t1 / u) * (-v / u);
}
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 <= (-3.85d-100)) .or. (.not. (t1 <= 2.3d-68))) then
tmp = -v / (t1 + u)
else
tmp = (t1 / u) * (-v / u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -3.85e-100) || !(t1 <= 2.3e-68)) {
tmp = -v / (t1 + u);
} else {
tmp = (t1 / u) * (-v / u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -3.85e-100) or not (t1 <= 2.3e-68): tmp = -v / (t1 + u) else: tmp = (t1 / u) * (-v / u) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -3.85e-100) || !(t1 <= 2.3e-68)) tmp = Float64(Float64(-v) / Float64(t1 + u)); else tmp = Float64(Float64(t1 / u) * Float64(Float64(-v) / u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -3.85e-100) || ~((t1 <= 2.3e-68))) tmp = -v / (t1 + u); else tmp = (t1 / u) * (-v / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -3.85e-100], N[Not[LessEqual[t1, 2.3e-68]], $MachinePrecision]], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], N[(N[(t1 / u), $MachinePrecision] * N[((-v) / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -3.85 \cdot 10^{-100} \lor \neg \left(t1 \leq 2.3 \cdot 10^{-68}\right):\\
\;\;\;\;\frac{-v}{t1 + u}\\
\mathbf{else}:\\
\;\;\;\;\frac{t1}{u} \cdot \frac{-v}{u}\\
\end{array}
\end{array}
if t1 < -3.84999999999999987e-100 or 2.29999999999999997e-68 < t1 Initial program 62.5%
associate-/r*81.2%
associate-/l*98.5%
Simplified98.5%
Taylor expanded in t1 around inf 81.2%
neg-mul-181.2%
Simplified81.2%
if -3.84999999999999987e-100 < t1 < 2.29999999999999997e-68Initial program 80.4%
associate-/r*87.4%
associate-/l*92.8%
Simplified92.8%
Taylor expanded in v around 0 87.4%
mul-1-neg87.4%
associate-*l/95.1%
distribute-rgt-neg-out95.1%
Simplified95.1%
Taylor expanded in t1 around 0 74.6%
unpow274.6%
times-frac86.5%
*-commutative86.5%
neg-mul-186.5%
distribute-rgt-neg-in86.5%
Simplified86.5%
Final simplification83.4%
(FPCore (u v t1) :precision binary64 (if (or (<= u -2.2e+178) (not (<= u 1.4e+99))) (* v (/ t1 (* u u))) (/ (- v) (+ t1 u))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -2.2e+178) || !(u <= 1.4e+99)) {
tmp = v * (t1 / (u * u));
} else {
tmp = -v / (t1 + u);
}
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 <= (-2.2d+178)) .or. (.not. (u <= 1.4d+99))) then
tmp = v * (t1 / (u * u))
else
tmp = -v / (t1 + u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((u <= -2.2e+178) || !(u <= 1.4e+99)) {
tmp = v * (t1 / (u * u));
} else {
tmp = -v / (t1 + u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -2.2e+178) or not (u <= 1.4e+99): tmp = v * (t1 / (u * u)) else: tmp = -v / (t1 + u) return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -2.2e+178) || !(u <= 1.4e+99)) tmp = Float64(v * Float64(t1 / Float64(u * u))); else tmp = Float64(Float64(-v) / Float64(t1 + u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -2.2e+178) || ~((u <= 1.4e+99))) tmp = v * (t1 / (u * u)); else tmp = -v / (t1 + u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -2.2e+178], N[Not[LessEqual[u, 1.4e+99]], $MachinePrecision]], N[(v * N[(t1 / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.2 \cdot 10^{+178} \lor \neg \left(u \leq 1.4 \cdot 10^{+99}\right):\\
\;\;\;\;v \cdot \frac{t1}{u \cdot u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1 + u}\\
\end{array}
\end{array}
if u < -2.19999999999999997e178 or 1.4e99 < u Initial program 73.0%
associate-*l/73.2%
*-commutative73.2%
Simplified73.2%
Taylor expanded in t1 around 0 72.4%
associate-*r/72.4%
neg-mul-172.4%
unpow272.4%
Simplified72.4%
add-sqr-sqrt33.2%
sqrt-unprod66.3%
sqr-neg66.3%
sqrt-unprod39.1%
times-frac39.1%
Applied egg-rr39.1%
times-frac39.1%
rem-square-sqrt68.3%
Simplified68.3%
if -2.19999999999999997e178 < u < 1.4e99Initial program 68.8%
associate-/r*81.2%
associate-/l*94.9%
Simplified94.9%
Taylor expanded in t1 around inf 67.3%
neg-mul-167.3%
Simplified67.3%
Final simplification67.6%
(FPCore (u v t1) :precision binary64 (if (<= u -7.4e+177) (* v (/ t1 (* u u))) (if (<= u 3e+89) (/ (- v) (+ t1 u)) (/ t1 (* u (/ u v))))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -7.4e+177) {
tmp = v * (t1 / (u * u));
} else if (u <= 3e+89) {
tmp = -v / (t1 + u);
} else {
tmp = t1 / (u * (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 (u <= (-7.4d+177)) then
tmp = v * (t1 / (u * u))
else if (u <= 3d+89) then
tmp = -v / (t1 + u)
else
tmp = t1 / (u * (u / v))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -7.4e+177) {
tmp = v * (t1 / (u * u));
} else if (u <= 3e+89) {
tmp = -v / (t1 + u);
} else {
tmp = t1 / (u * (u / v));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -7.4e+177: tmp = v * (t1 / (u * u)) elif u <= 3e+89: tmp = -v / (t1 + u) else: tmp = t1 / (u * (u / v)) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -7.4e+177) tmp = Float64(v * Float64(t1 / Float64(u * u))); elseif (u <= 3e+89) tmp = Float64(Float64(-v) / Float64(t1 + u)); else tmp = Float64(t1 / Float64(u * Float64(u / v))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -7.4e+177) tmp = v * (t1 / (u * u)); elseif (u <= 3e+89) tmp = -v / (t1 + u); else tmp = t1 / (u * (u / v)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -7.4e+177], N[(v * N[(t1 / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 3e+89], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], N[(t1 / N[(u * N[(u / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -7.4 \cdot 10^{+177}:\\
\;\;\;\;v \cdot \frac{t1}{u \cdot u}\\
\mathbf{elif}\;u \leq 3 \cdot 10^{+89}:\\
\;\;\;\;\frac{-v}{t1 + u}\\
\mathbf{else}:\\
\;\;\;\;\frac{t1}{u \cdot \frac{u}{v}}\\
\end{array}
\end{array}
if u < -7.40000000000000028e177Initial program 74.9%
associate-*l/75.1%
*-commutative75.1%
Simplified75.1%
Taylor expanded in t1 around 0 75.1%
associate-*r/75.1%
neg-mul-175.1%
unpow275.1%
Simplified75.1%
add-sqr-sqrt26.9%
sqrt-unprod74.6%
sqr-neg74.6%
sqrt-unprod48.2%
times-frac48.0%
Applied egg-rr48.0%
times-frac48.2%
rem-square-sqrt75.1%
Simplified75.1%
if -7.40000000000000028e177 < u < 3.00000000000000013e89Initial program 68.1%
associate-/r*80.8%
associate-/l*94.7%
Simplified94.7%
Taylor expanded in t1 around inf 67.2%
neg-mul-167.2%
Simplified67.2%
if 3.00000000000000013e89 < u Initial program 74.3%
associate-*l/74.6%
*-commutative74.6%
Simplified74.6%
Taylor expanded in t1 around 0 68.1%
associate-*r/68.1%
neg-mul-168.1%
unpow268.1%
Simplified68.1%
add-sqr-sqrt33.0%
sqrt-unprod60.2%
sqr-neg60.2%
sqrt-unprod35.0%
times-frac35.0%
Applied egg-rr35.0%
times-frac35.0%
rem-square-sqrt62.8%
Simplified62.8%
*-commutative62.8%
associate-/r/67.2%
associate-/l*67.0%
associate-/r/67.0%
Applied egg-rr67.0%
Final simplification67.7%
(FPCore (u v t1) :precision binary64 (if (<= u -7.4e+177) (* v (/ t1 (* u u))) (if (<= u 3.5e+88) (/ (- v) (+ t1 u)) (/ t1 (/ (* u u) v)))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -7.4e+177) {
tmp = v * (t1 / (u * u));
} else if (u <= 3.5e+88) {
tmp = -v / (t1 + u);
} else {
tmp = t1 / ((u * 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 (u <= (-7.4d+177)) then
tmp = v * (t1 / (u * u))
else if (u <= 3.5d+88) then
tmp = -v / (t1 + u)
else
tmp = t1 / ((u * u) / v)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -7.4e+177) {
tmp = v * (t1 / (u * u));
} else if (u <= 3.5e+88) {
tmp = -v / (t1 + u);
} else {
tmp = t1 / ((u * u) / v);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -7.4e+177: tmp = v * (t1 / (u * u)) elif u <= 3.5e+88: tmp = -v / (t1 + u) else: tmp = t1 / ((u * u) / v) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -7.4e+177) tmp = Float64(v * Float64(t1 / Float64(u * u))); elseif (u <= 3.5e+88) tmp = Float64(Float64(-v) / Float64(t1 + u)); else tmp = Float64(t1 / Float64(Float64(u * u) / v)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -7.4e+177) tmp = v * (t1 / (u * u)); elseif (u <= 3.5e+88) tmp = -v / (t1 + u); else tmp = t1 / ((u * u) / v); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -7.4e+177], N[(v * N[(t1 / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 3.5e+88], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], N[(t1 / N[(N[(u * u), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -7.4 \cdot 10^{+177}:\\
\;\;\;\;v \cdot \frac{t1}{u \cdot u}\\
\mathbf{elif}\;u \leq 3.5 \cdot 10^{+88}:\\
\;\;\;\;\frac{-v}{t1 + u}\\
\mathbf{else}:\\
\;\;\;\;\frac{t1}{\frac{u \cdot u}{v}}\\
\end{array}
\end{array}
if u < -7.40000000000000028e177Initial program 74.9%
associate-*l/75.1%
*-commutative75.1%
Simplified75.1%
Taylor expanded in t1 around 0 75.1%
associate-*r/75.1%
neg-mul-175.1%
unpow275.1%
Simplified75.1%
add-sqr-sqrt26.9%
sqrt-unprod74.6%
sqr-neg74.6%
sqrt-unprod48.2%
times-frac48.0%
Applied egg-rr48.0%
times-frac48.2%
rem-square-sqrt75.1%
Simplified75.1%
if -7.40000000000000028e177 < u < 3.4999999999999998e88Initial program 68.1%
associate-/r*80.8%
associate-/l*94.7%
Simplified94.7%
Taylor expanded in t1 around inf 67.2%
neg-mul-167.2%
Simplified67.2%
if 3.4999999999999998e88 < u Initial program 74.3%
associate-*l/74.6%
*-commutative74.6%
Simplified74.6%
Taylor expanded in t1 around 0 68.1%
associate-*r/68.1%
neg-mul-168.1%
unpow268.1%
Simplified68.1%
add-sqr-sqrt33.0%
sqrt-unprod60.2%
sqr-neg60.2%
sqrt-unprod35.0%
times-frac35.0%
Applied egg-rr35.0%
times-frac35.0%
rem-square-sqrt62.8%
Simplified62.8%
*-commutative62.8%
associate-/r/67.2%
associate-/l*67.0%
associate-/r/67.0%
Applied egg-rr67.0%
associate-*l/67.2%
Applied egg-rr67.2%
Final simplification67.8%
(FPCore (u v t1) :precision binary64 (if (<= u 3.5e+130) (/ (- v) t1) (/ (- v) u)))
double code(double u, double v, double t1) {
double tmp;
if (u <= 3.5e+130) {
tmp = -v / t1;
} else {
tmp = -v / u;
}
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.5d+130) then
tmp = -v / t1
else
tmp = -v / u
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= 3.5e+130) {
tmp = -v / t1;
} else {
tmp = -v / u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= 3.5e+130: tmp = -v / t1 else: tmp = -v / u return tmp
function code(u, v, t1) tmp = 0.0 if (u <= 3.5e+130) tmp = Float64(Float64(-v) / t1); else tmp = Float64(Float64(-v) / u); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= 3.5e+130) tmp = -v / t1; else tmp = -v / u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, 3.5e+130], N[((-v) / t1), $MachinePrecision], N[((-v) / u), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq 3.5 \cdot 10^{+130}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{u}\\
\end{array}
\end{array}
if u < 3.5000000000000001e130Initial program 69.3%
associate-*l/75.1%
*-commutative75.1%
Simplified75.1%
Taylor expanded in t1 around inf 59.5%
associate-*r/59.5%
neg-mul-159.5%
Simplified59.5%
if 3.5000000000000001e130 < u Initial program 72.8%
associate-/r*90.6%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in t1 around 0 90.4%
mul-1-neg90.4%
associate-/l*94.0%
distribute-neg-frac94.0%
Simplified94.0%
Taylor expanded in t1 around inf 40.7%
neg-mul-140.7%
distribute-neg-frac40.7%
Simplified40.7%
Final simplification56.4%
(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 69.9%
associate-/r*83.8%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in t1 around inf 60.1%
neg-mul-160.1%
Simplified60.1%
Final simplification60.1%
(FPCore (u v t1) :precision binary64 (/ (- v) t1))
double code(double u, double v, double t1) {
return -v / t1;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = -v / t1
end function
public static double code(double u, double v, double t1) {
return -v / t1;
}
def code(u, v, t1): return -v / t1
function code(u, v, t1) return Float64(Float64(-v) / t1) end
function tmp = code(u, v, t1) tmp = -v / t1; end
code[u_, v_, t1_] := N[((-v) / t1), $MachinePrecision]
\begin{array}{l}
\\
\frac{-v}{t1}
\end{array}
Initial program 69.9%
associate-*l/74.5%
*-commutative74.5%
Simplified74.5%
Taylor expanded in t1 around inf 52.9%
associate-*r/52.9%
neg-mul-152.9%
Simplified52.9%
Final simplification52.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(v / t1) end
function tmp = code(u, v, t1) tmp = v / t1; end
code[u_, v_, t1_] := N[(v / t1), $MachinePrecision]
\begin{array}{l}
\\
\frac{v}{t1}
\end{array}
Initial program 69.9%
associate-*l/74.5%
*-commutative74.5%
Simplified74.5%
associate-/r*95.8%
associate-*r/97.9%
*-commutative97.9%
associate-/r/96.1%
div-inv96.0%
clear-num96.0%
associate-/r/96.0%
clear-num96.8%
*-commutative96.8%
clear-num96.0%
div-inv96.0%
frac-2neg96.0%
remove-double-neg96.0%
associate-*l/97.7%
Applied egg-rr56.4%
Taylor expanded in t1 around inf 11.5%
Final simplification11.5%
herbie shell --seed 2023292
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))