
(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(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[((-t1) / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}
\end{array}
Initial program 77.4%
times-frac97.4%
Simplified97.4%
Final simplification97.4%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (* t1 (/ v (* (+ t1 u) (- (- t1) u)))))
(t_2 (/ v (- (* u -2.0) t1))))
(if (<= t1 -7.6e+131)
t_2
(if (<= t1 -4.5e-174)
t_1
(if (<= t1 8e-294)
(* v (/ (/ t1 u) (- t1 u)))
(if (<= t1 1.16e+84) t_1 t_2))))))
double code(double u, double v, double t1) {
double t_1 = t1 * (v / ((t1 + u) * (-t1 - u)));
double t_2 = v / ((u * -2.0) - t1);
double tmp;
if (t1 <= -7.6e+131) {
tmp = t_2;
} else if (t1 <= -4.5e-174) {
tmp = t_1;
} else if (t1 <= 8e-294) {
tmp = v * ((t1 / u) / (t1 - u));
} else if (t1 <= 1.16e+84) {
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 = t1 * (v / ((t1 + u) * (-t1 - u)))
t_2 = v / ((u * (-2.0d0)) - t1)
if (t1 <= (-7.6d+131)) then
tmp = t_2
else if (t1 <= (-4.5d-174)) then
tmp = t_1
else if (t1 <= 8d-294) then
tmp = v * ((t1 / u) / (t1 - u))
else if (t1 <= 1.16d+84) 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 = t1 * (v / ((t1 + u) * (-t1 - u)));
double t_2 = v / ((u * -2.0) - t1);
double tmp;
if (t1 <= -7.6e+131) {
tmp = t_2;
} else if (t1 <= -4.5e-174) {
tmp = t_1;
} else if (t1 <= 8e-294) {
tmp = v * ((t1 / u) / (t1 - u));
} else if (t1 <= 1.16e+84) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(u, v, t1): t_1 = t1 * (v / ((t1 + u) * (-t1 - u))) t_2 = v / ((u * -2.0) - t1) tmp = 0 if t1 <= -7.6e+131: tmp = t_2 elif t1 <= -4.5e-174: tmp = t_1 elif t1 <= 8e-294: tmp = v * ((t1 / u) / (t1 - u)) elif t1 <= 1.16e+84: tmp = t_1 else: tmp = t_2 return tmp
function code(u, v, t1) t_1 = Float64(t1 * Float64(v / Float64(Float64(t1 + u) * Float64(Float64(-t1) - u)))) t_2 = Float64(v / Float64(Float64(u * -2.0) - t1)) tmp = 0.0 if (t1 <= -7.6e+131) tmp = t_2; elseif (t1 <= -4.5e-174) tmp = t_1; elseif (t1 <= 8e-294) tmp = Float64(v * Float64(Float64(t1 / u) / Float64(t1 - u))); elseif (t1 <= 1.16e+84) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = t1 * (v / ((t1 + u) * (-t1 - u))); t_2 = v / ((u * -2.0) - t1); tmp = 0.0; if (t1 <= -7.6e+131) tmp = t_2; elseif (t1 <= -4.5e-174) tmp = t_1; elseif (t1 <= 8e-294) tmp = v * ((t1 / u) / (t1 - u)); elseif (t1 <= 1.16e+84) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(t1 * N[(v / N[(N[(t1 + u), $MachinePrecision] * N[((-t1) - u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -7.6e+131], t$95$2, If[LessEqual[t1, -4.5e-174], t$95$1, If[LessEqual[t1, 8e-294], N[(v * N[(N[(t1 / u), $MachinePrecision] / N[(t1 - u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 1.16e+84], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t1 \cdot \frac{v}{\left(t1 + u\right) \cdot \left(\left(-t1\right) - u\right)}\\
t_2 := \frac{v}{u \cdot -2 - t1}\\
\mathbf{if}\;t1 \leq -7.6 \cdot 10^{+131}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t1 \leq -4.5 \cdot 10^{-174}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t1 \leq 8 \cdot 10^{-294}:\\
\;\;\;\;v \cdot \frac{\frac{t1}{u}}{t1 - u}\\
\mathbf{elif}\;t1 \leq 1.16 \cdot 10^{+84}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t1 < -7.6000000000000007e131 or 1.16e84 < t1 Initial program 52.9%
associate-/r*76.1%
*-commutative76.1%
associate-/l*99.9%
associate-/l/97.4%
+-commutative97.4%
remove-double-neg97.4%
unsub-neg97.4%
div-sub97.4%
sub-neg97.4%
*-inverses97.4%
metadata-eval97.4%
Simplified97.4%
Taylor expanded in t1 around inf 95.7%
mul-1-neg95.7%
unsub-neg95.7%
*-commutative95.7%
Simplified95.7%
if -7.6000000000000007e131 < t1 < -4.49999999999999964e-174 or 8.00000000000000013e-294 < t1 < 1.16e84Initial program 89.7%
times-frac96.9%
Simplified96.9%
frac-times89.7%
associate-/l*88.6%
frac-2neg88.6%
remove-double-neg88.6%
pow288.6%
Applied egg-rr88.6%
distribute-neg-frac88.6%
associate-/l*89.7%
*-rgt-identity89.7%
associate-*r/89.6%
associate-*l*88.5%
associate-*r/88.6%
*-rgt-identity88.6%
Simplified88.6%
unpow288.6%
Applied egg-rr88.6%
if -4.49999999999999964e-174 < t1 < 8.00000000000000013e-294Initial program 73.3%
times-frac93.5%
Simplified93.5%
*-commutative93.5%
clear-num93.6%
frac-2neg93.6%
frac-times83.7%
*-un-lft-identity83.7%
remove-double-neg83.7%
distribute-neg-in83.7%
add-sqr-sqrt73.1%
sqrt-unprod73.7%
sqr-neg73.7%
sqrt-unprod10.7%
add-sqr-sqrt73.7%
sub-neg73.7%
Applied egg-rr73.7%
Taylor expanded in t1 around 0 74.1%
Taylor expanded in v around 0 73.3%
associate-*l/77.7%
*-commutative77.7%
associate-/r*87.6%
Simplified87.6%
Final simplification90.5%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -3.5e-31) (not (<= t1 4.5e-53))) (/ v (- (* u -2.0) t1)) (* (/ t1 u) (/ (- v) u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -3.5e-31) || !(t1 <= 4.5e-53)) {
tmp = v / ((u * -2.0) - t1);
} 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.5d-31)) .or. (.not. (t1 <= 4.5d-53))) then
tmp = v / ((u * (-2.0d0)) - t1)
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.5e-31) || !(t1 <= 4.5e-53)) {
tmp = v / ((u * -2.0) - t1);
} else {
tmp = (t1 / u) * (-v / u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -3.5e-31) or not (t1 <= 4.5e-53): tmp = v / ((u * -2.0) - t1) else: tmp = (t1 / u) * (-v / u) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -3.5e-31) || !(t1 <= 4.5e-53)) tmp = Float64(v / Float64(Float64(u * -2.0) - t1)); 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.5e-31) || ~((t1 <= 4.5e-53))) tmp = v / ((u * -2.0) - t1); else tmp = (t1 / u) * (-v / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -3.5e-31], N[Not[LessEqual[t1, 4.5e-53]], $MachinePrecision]], N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision], N[(N[(t1 / u), $MachinePrecision] * N[((-v) / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -3.5 \cdot 10^{-31} \lor \neg \left(t1 \leq 4.5 \cdot 10^{-53}\right):\\
\;\;\;\;\frac{v}{u \cdot -2 - t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t1}{u} \cdot \frac{-v}{u}\\
\end{array}
\end{array}
if t1 < -3.49999999999999985e-31 or 4.49999999999999985e-53 < t1 Initial program 70.4%
associate-/r*86.4%
*-commutative86.4%
associate-/l*99.9%
associate-/l/95.8%
+-commutative95.8%
remove-double-neg95.8%
unsub-neg95.8%
div-sub95.8%
sub-neg95.8%
*-inverses95.8%
metadata-eval95.8%
Simplified95.8%
Taylor expanded in t1 around inf 88.1%
mul-1-neg88.1%
unsub-neg88.1%
*-commutative88.1%
Simplified88.1%
if -3.49999999999999985e-31 < t1 < 4.49999999999999985e-53Initial program 85.3%
times-frac94.5%
Simplified94.5%
Taylor expanded in t1 around 0 79.2%
associate-*r/79.2%
mul-1-neg79.2%
Simplified79.2%
Taylor expanded in t1 around 0 79.2%
Final simplification84.0%
(FPCore (u v t1) :precision binary64 (if (or (<= u -4.25e+102) (not (<= u 1.22e+66))) (* t1 (/ (/ v u) t1)) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -4.25e+102) || !(u <= 1.22e+66)) {
tmp = t1 * ((v / u) / t1);
} 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 <= (-4.25d+102)) .or. (.not. (u <= 1.22d+66))) then
tmp = t1 * ((v / u) / t1)
else
tmp = -v / t1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((u <= -4.25e+102) || !(u <= 1.22e+66)) {
tmp = t1 * ((v / u) / t1);
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -4.25e+102) or not (u <= 1.22e+66): tmp = t1 * ((v / u) / t1) else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -4.25e+102) || !(u <= 1.22e+66)) tmp = Float64(t1 * Float64(Float64(v / u) / t1)); else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -4.25e+102) || ~((u <= 1.22e+66))) tmp = t1 * ((v / u) / t1); else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -4.25e+102], N[Not[LessEqual[u, 1.22e+66]], $MachinePrecision]], N[(t1 * N[(N[(v / u), $MachinePrecision] / t1), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -4.25 \cdot 10^{+102} \lor \neg \left(u \leq 1.22 \cdot 10^{+66}\right):\\
\;\;\;\;t1 \cdot \frac{\frac{v}{u}}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -4.2499999999999998e102 or 1.21999999999999993e66 < u Initial program 83.3%
times-frac95.8%
Simplified95.8%
*-commutative95.8%
clear-num95.8%
frac-2neg95.8%
frac-times93.8%
*-un-lft-identity93.8%
remove-double-neg93.8%
distribute-neg-in93.8%
add-sqr-sqrt39.3%
sqrt-unprod90.7%
sqr-neg90.7%
sqrt-unprod53.4%
add-sqr-sqrt91.7%
sub-neg91.7%
Applied egg-rr91.7%
Taylor expanded in t1 around 0 91.8%
Taylor expanded in u around 0 53.7%
clear-num54.5%
associate-/r/53.7%
clear-num53.7%
*-commutative53.7%
associate-/r*51.6%
Applied egg-rr51.6%
if -4.2499999999999998e102 < u < 1.21999999999999993e66Initial program 74.1%
times-frac98.2%
Simplified98.2%
Taylor expanded in t1 around inf 68.4%
associate-*r/68.4%
neg-mul-168.4%
Simplified68.4%
Final simplification62.3%
(FPCore (u v t1) :precision binary64 (if (or (<= u -1.26e+112) (not (<= u 8e+65))) (/ t1 (/ (* t1 u) v)) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -1.26e+112) || !(u <= 8e+65)) {
tmp = t1 / ((t1 * u) / v);
} 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 <= (-1.26d+112)) .or. (.not. (u <= 8d+65))) then
tmp = t1 / ((t1 * u) / v)
else
tmp = -v / t1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((u <= -1.26e+112) || !(u <= 8e+65)) {
tmp = t1 / ((t1 * u) / v);
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -1.26e+112) or not (u <= 8e+65): tmp = t1 / ((t1 * u) / v) else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -1.26e+112) || !(u <= 8e+65)) tmp = Float64(t1 / Float64(Float64(t1 * u) / v)); else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -1.26e+112) || ~((u <= 8e+65))) tmp = t1 / ((t1 * u) / v); else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -1.26e+112], N[Not[LessEqual[u, 8e+65]], $MachinePrecision]], N[(t1 / N[(N[(t1 * u), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.26 \cdot 10^{+112} \lor \neg \left(u \leq 8 \cdot 10^{+65}\right):\\
\;\;\;\;\frac{t1}{\frac{t1 \cdot u}{v}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -1.26e112 or 7.9999999999999999e65 < u Initial program 83.3%
times-frac95.8%
Simplified95.8%
*-commutative95.8%
clear-num95.8%
frac-2neg95.8%
frac-times93.8%
*-un-lft-identity93.8%
remove-double-neg93.8%
distribute-neg-in93.8%
add-sqr-sqrt39.3%
sqrt-unprod90.7%
sqr-neg90.7%
sqrt-unprod53.4%
add-sqr-sqrt91.7%
sub-neg91.7%
Applied egg-rr91.7%
Taylor expanded in t1 around 0 91.8%
Taylor expanded in u around 0 53.7%
if -1.26e112 < u < 7.9999999999999999e65Initial program 74.1%
times-frac98.2%
Simplified98.2%
Taylor expanded in t1 around inf 68.4%
associate-*r/68.4%
neg-mul-168.4%
Simplified68.4%
Final simplification63.1%
(FPCore (u v t1) :precision binary64 (if (<= u -1.38e+110) (/ t1 (* t1 (/ u v))) (if (<= u 1.1e+66) (/ (- v) t1) (* t1 (/ (/ v u) t1)))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -1.38e+110) {
tmp = t1 / (t1 * (u / v));
} else if (u <= 1.1e+66) {
tmp = -v / t1;
} else {
tmp = t1 * ((v / u) / 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 <= (-1.38d+110)) then
tmp = t1 / (t1 * (u / v))
else if (u <= 1.1d+66) then
tmp = -v / t1
else
tmp = t1 * ((v / u) / t1)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -1.38e+110) {
tmp = t1 / (t1 * (u / v));
} else if (u <= 1.1e+66) {
tmp = -v / t1;
} else {
tmp = t1 * ((v / u) / t1);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -1.38e+110: tmp = t1 / (t1 * (u / v)) elif u <= 1.1e+66: tmp = -v / t1 else: tmp = t1 * ((v / u) / t1) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -1.38e+110) tmp = Float64(t1 / Float64(t1 * Float64(u / v))); elseif (u <= 1.1e+66) tmp = Float64(Float64(-v) / t1); else tmp = Float64(t1 * Float64(Float64(v / u) / t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -1.38e+110) tmp = t1 / (t1 * (u / v)); elseif (u <= 1.1e+66) tmp = -v / t1; else tmp = t1 * ((v / u) / t1); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -1.38e+110], N[(t1 / N[(t1 * N[(u / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 1.1e+66], N[((-v) / t1), $MachinePrecision], N[(t1 * N[(N[(v / u), $MachinePrecision] / t1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.38 \cdot 10^{+110}:\\
\;\;\;\;\frac{t1}{t1 \cdot \frac{u}{v}}\\
\mathbf{elif}\;u \leq 1.1 \cdot 10^{+66}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;t1 \cdot \frac{\frac{v}{u}}{t1}\\
\end{array}
\end{array}
if u < -1.37999999999999998e110Initial program 79.8%
times-frac95.4%
Simplified95.4%
*-commutative95.4%
clear-num95.4%
frac-2neg95.4%
frac-times88.9%
*-un-lft-identity88.9%
remove-double-neg88.9%
distribute-neg-in88.9%
add-sqr-sqrt26.6%
sqrt-unprod86.6%
sqr-neg86.6%
sqrt-unprod62.3%
add-sqr-sqrt88.9%
sub-neg88.9%
Applied egg-rr88.9%
Taylor expanded in t1 around 0 88.9%
Taylor expanded in u around 0 57.7%
associate-*r/57.0%
Simplified57.0%
if -1.37999999999999998e110 < u < 1.0999999999999999e66Initial program 74.1%
times-frac98.2%
Simplified98.2%
Taylor expanded in t1 around inf 68.4%
associate-*r/68.4%
neg-mul-168.4%
Simplified68.4%
if 1.0999999999999999e66 < u Initial program 86.2%
times-frac96.1%
Simplified96.1%
*-commutative96.1%
clear-num96.1%
frac-2neg96.1%
frac-times98.0%
*-un-lft-identity98.0%
remove-double-neg98.0%
distribute-neg-in98.0%
add-sqr-sqrt50.0%
sqrt-unprod94.1%
sqr-neg94.1%
sqrt-unprod46.0%
add-sqr-sqrt94.0%
sub-neg94.0%
Applied egg-rr94.0%
Taylor expanded in t1 around 0 94.2%
Taylor expanded in u around 0 50.4%
clear-num50.4%
associate-/r/50.4%
clear-num50.4%
*-commutative50.4%
associate-/r*48.5%
Applied egg-rr48.5%
Final simplification62.6%
(FPCore (u v t1) :precision binary64 (if (or (<= u -2.4e+149) (not (<= u 1.45e+77))) (* (/ v u) -0.5) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -2.4e+149) || !(u <= 1.45e+77)) {
tmp = (v / u) * -0.5;
} 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 <= (-2.4d+149)) .or. (.not. (u <= 1.45d+77))) then
tmp = (v / u) * (-0.5d0)
else
tmp = -v / t1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((u <= -2.4e+149) || !(u <= 1.45e+77)) {
tmp = (v / u) * -0.5;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -2.4e+149) or not (u <= 1.45e+77): tmp = (v / u) * -0.5 else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -2.4e+149) || !(u <= 1.45e+77)) tmp = Float64(Float64(v / u) * -0.5); else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -2.4e+149) || ~((u <= 1.45e+77))) tmp = (v / u) * -0.5; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -2.4e+149], N[Not[LessEqual[u, 1.45e+77]], $MachinePrecision]], N[(N[(v / u), $MachinePrecision] * -0.5), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.4 \cdot 10^{+149} \lor \neg \left(u \leq 1.45 \cdot 10^{+77}\right):\\
\;\;\;\;\frac{v}{u} \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -2.40000000000000012e149 or 1.4500000000000001e77 < u Initial program 81.3%
associate-/r*93.9%
*-commutative93.9%
associate-/l*97.5%
associate-/l/87.4%
+-commutative87.4%
remove-double-neg87.4%
unsub-neg87.4%
div-sub87.4%
sub-neg87.4%
*-inverses87.4%
metadata-eval87.4%
Simplified87.4%
Taylor expanded in t1 around inf 56.4%
mul-1-neg56.4%
unsub-neg56.4%
*-commutative56.4%
Simplified56.4%
Taylor expanded in u around inf 47.4%
if -2.40000000000000012e149 < u < 1.4500000000000001e77Initial program 75.5%
times-frac97.3%
Simplified97.3%
Taylor expanded in t1 around inf 66.8%
associate-*r/66.8%
neg-mul-166.8%
Simplified66.8%
Final simplification60.6%
(FPCore (u v t1) :precision binary64 (if (or (<= u -7.8e+152) (not (<= u 1.05e+66))) (/ v u) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -7.8e+152) || !(u <= 1.05e+66)) {
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 <= (-7.8d+152)) .or. (.not. (u <= 1.05d+66))) 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 <= -7.8e+152) || !(u <= 1.05e+66)) {
tmp = v / u;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -7.8e+152) or not (u <= 1.05e+66): tmp = v / u else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -7.8e+152) || !(u <= 1.05e+66)) tmp = Float64(v / u); else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -7.8e+152) || ~((u <= 1.05e+66))) tmp = v / u; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -7.8e+152], N[Not[LessEqual[u, 1.05e+66]], $MachinePrecision]], N[(v / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -7.8 \cdot 10^{+152} \lor \neg \left(u \leq 1.05 \cdot 10^{+66}\right):\\
\;\;\;\;\frac{v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -7.80000000000000022e152 or 1.05000000000000003e66 < u Initial program 81.7%
times-frac97.6%
Simplified97.6%
*-commutative97.6%
clear-num97.6%
frac-2neg97.6%
frac-times93.3%
*-un-lft-identity93.3%
remove-double-neg93.3%
distribute-neg-in93.3%
add-sqr-sqrt41.9%
sqrt-unprod89.8%
sqr-neg89.8%
sqrt-unprod50.2%
add-sqr-sqrt90.9%
sub-neg90.9%
Applied egg-rr90.9%
Taylor expanded in t1 around 0 91.0%
Taylor expanded in t1 around inf 46.1%
if -7.80000000000000022e152 < u < 1.05000000000000003e66Initial program 75.3%
times-frac97.2%
Simplified97.2%
Taylor expanded in t1 around inf 67.6%
associate-*r/67.6%
neg-mul-167.6%
Simplified67.6%
Final simplification60.5%
(FPCore (u v t1) :precision binary64 (if (or (<= u -1.9e+153) (not (<= u 8e+78))) (/ (- v) u) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -1.9e+153) || !(u <= 8e+78)) {
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 <= (-1.9d+153)) .or. (.not. (u <= 8d+78))) 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 <= -1.9e+153) || !(u <= 8e+78)) {
tmp = -v / u;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -1.9e+153) or not (u <= 8e+78): tmp = -v / u else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -1.9e+153) || !(u <= 8e+78)) tmp = Float64(Float64(-v) / u); else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -1.9e+153) || ~((u <= 8e+78))) tmp = -v / u; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -1.9e+153], N[Not[LessEqual[u, 8e+78]], $MachinePrecision]], N[((-v) / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.9 \cdot 10^{+153} \lor \neg \left(u \leq 8 \cdot 10^{+78}\right):\\
\;\;\;\;\frac{-v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -1.89999999999999983e153 or 8.00000000000000007e78 < u Initial program 81.3%
times-frac97.6%
Simplified97.6%
Taylor expanded in t1 around 0 90.1%
associate-*r/90.1%
mul-1-neg90.1%
Simplified90.1%
Taylor expanded in t1 around inf 47.3%
associate-*r/47.3%
neg-mul-147.3%
Simplified47.3%
if -1.89999999999999983e153 < u < 8.00000000000000007e78Initial program 75.5%
times-frac97.3%
Simplified97.3%
Taylor expanded in t1 around inf 66.8%
associate-*r/66.8%
neg-mul-166.8%
Simplified66.8%
Final simplification60.6%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -1.25e+121) (not (<= t1 2.8e+54))) (/ v t1) (/ v u)))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.25e+121) || !(t1 <= 2.8e+54)) {
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 ((t1 <= (-1.25d+121)) .or. (.not. (t1 <= 2.8d+54))) 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 ((t1 <= -1.25e+121) || !(t1 <= 2.8e+54)) {
tmp = v / t1;
} else {
tmp = v / u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -1.25e+121) or not (t1 <= 2.8e+54): tmp = v / t1 else: tmp = v / u return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -1.25e+121) || !(t1 <= 2.8e+54)) tmp = Float64(v / t1); else tmp = Float64(v / u); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -1.25e+121) || ~((t1 <= 2.8e+54))) tmp = v / t1; else tmp = v / u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -1.25e+121], N[Not[LessEqual[t1, 2.8e+54]], $MachinePrecision]], N[(v / t1), $MachinePrecision], N[(v / u), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.25 \cdot 10^{+121} \lor \neg \left(t1 \leq 2.8 \cdot 10^{+54}\right):\\
\;\;\;\;\frac{v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u}\\
\end{array}
\end{array}
if t1 < -1.25000000000000002e121 or 2.80000000000000015e54 < t1 Initial program 57.0%
times-frac99.9%
Simplified99.9%
*-commutative99.9%
clear-num98.6%
frac-2neg98.6%
frac-times70.3%
*-un-lft-identity70.3%
remove-double-neg70.3%
distribute-neg-in70.3%
add-sqr-sqrt18.5%
sqrt-unprod46.6%
sqr-neg46.6%
sqrt-unprod31.5%
add-sqr-sqrt45.3%
sub-neg45.3%
Applied egg-rr45.3%
Taylor expanded in t1 around inf 38.9%
if -1.25000000000000002e121 < t1 < 2.80000000000000015e54Initial program 87.0%
times-frac96.2%
Simplified96.2%
*-commutative96.2%
clear-num96.0%
frac-2neg96.0%
frac-times93.2%
*-un-lft-identity93.2%
remove-double-neg93.2%
distribute-neg-in93.2%
add-sqr-sqrt42.5%
sqrt-unprod77.6%
sqr-neg77.6%
sqrt-unprod36.2%
add-sqr-sqrt64.7%
sub-neg64.7%
Applied egg-rr64.7%
Taylor expanded in t1 around 0 64.6%
Taylor expanded in t1 around inf 19.8%
Final simplification25.9%
(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 77.4%
associate-/r*88.1%
*-commutative88.1%
associate-/l*97.7%
associate-/l/94.4%
+-commutative94.4%
remove-double-neg94.4%
unsub-neg94.4%
div-sub94.4%
sub-neg94.4%
*-inverses94.4%
metadata-eval94.4%
Simplified94.4%
Taylor expanded in t1 around inf 63.9%
mul-1-neg63.9%
unsub-neg63.9%
*-commutative63.9%
Simplified63.9%
Final simplification63.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 77.4%
times-frac97.4%
Simplified97.4%
*-commutative97.4%
clear-num96.9%
frac-2neg96.9%
frac-times85.9%
*-un-lft-identity85.9%
remove-double-neg85.9%
distribute-neg-in85.9%
add-sqr-sqrt34.8%
sqrt-unprod67.7%
sqr-neg67.7%
sqrt-unprod34.7%
add-sqr-sqrt58.5%
sub-neg58.5%
Applied egg-rr58.5%
Taylor expanded in t1 around inf 14.7%
Final simplification14.7%
herbie shell --seed 2024024
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))