
(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 15 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 70.2%
times-frac98.0%
Simplified98.0%
Final simplification98.0%
(FPCore (u v t1) :precision binary64 (if (<= u -2.2e-101) (/ t1 (* (/ u v) (- t1 u))) (if (<= u 2.3e-48) (/ (- v) t1) (/ 1.0 (/ (- t1 u) (* v (/ t1 u)))))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -2.2e-101) {
tmp = t1 / ((u / v) * (t1 - u));
} else if (u <= 2.3e-48) {
tmp = -v / t1;
} else {
tmp = 1.0 / ((t1 - u) / (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-101)) then
tmp = t1 / ((u / v) * (t1 - u))
else if (u <= 2.3d-48) then
tmp = -v / t1
else
tmp = 1.0d0 / ((t1 - u) / (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-101) {
tmp = t1 / ((u / v) * (t1 - u));
} else if (u <= 2.3e-48) {
tmp = -v / t1;
} else {
tmp = 1.0 / ((t1 - u) / (v * (t1 / u)));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -2.2e-101: tmp = t1 / ((u / v) * (t1 - u)) elif u <= 2.3e-48: tmp = -v / t1 else: tmp = 1.0 / ((t1 - u) / (v * (t1 / u))) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -2.2e-101) tmp = Float64(t1 / Float64(Float64(u / v) * Float64(t1 - u))); elseif (u <= 2.3e-48) tmp = Float64(Float64(-v) / t1); else tmp = Float64(1.0 / Float64(Float64(t1 - u) / Float64(v * Float64(t1 / u)))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -2.2e-101) tmp = t1 / ((u / v) * (t1 - u)); elseif (u <= 2.3e-48) tmp = -v / t1; else tmp = 1.0 / ((t1 - u) / (v * (t1 / u))); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -2.2e-101], N[(t1 / N[(N[(u / v), $MachinePrecision] * N[(t1 - u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 2.3e-48], N[((-v) / t1), $MachinePrecision], N[(1.0 / N[(N[(t1 - u), $MachinePrecision] / N[(v * N[(t1 / u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.2 \cdot 10^{-101}:\\
\;\;\;\;\frac{t1}{\frac{u}{v} \cdot \left(t1 - u\right)}\\
\mathbf{elif}\;u \leq 2.3 \cdot 10^{-48}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{t1 - u}{v \cdot \frac{t1}{u}}}\\
\end{array}
\end{array}
if u < -2.1999999999999999e-101Initial program 75.7%
times-frac98.6%
Simplified98.6%
*-commutative98.6%
clear-num98.6%
frac-2neg98.6%
frac-times85.1%
*-un-lft-identity85.1%
remove-double-neg85.1%
distribute-neg-in85.1%
add-sqr-sqrt51.1%
sqrt-unprod79.5%
sqr-neg79.5%
sqrt-unprod30.6%
add-sqr-sqrt76.4%
sub-neg76.4%
Applied egg-rr76.4%
Taylor expanded in t1 around 0 77.5%
if -2.1999999999999999e-101 < u < 2.3000000000000001e-48Initial program 62.5%
times-frac98.2%
Simplified98.2%
Taylor expanded in t1 around inf 86.9%
associate-*r/86.9%
neg-mul-186.9%
Simplified86.9%
if 2.3000000000000001e-48 < u Initial program 76.0%
times-frac96.5%
Simplified96.5%
*-commutative96.5%
clear-num95.3%
frac-2neg95.3%
frac-times86.0%
*-un-lft-identity86.0%
remove-double-neg86.0%
distribute-neg-in86.0%
add-sqr-sqrt45.3%
sqrt-unprod78.1%
sqr-neg78.1%
sqrt-unprod34.2%
add-sqr-sqrt73.6%
sub-neg73.6%
Applied egg-rr73.6%
Taylor expanded in t1 around 0 73.6%
clear-num73.7%
inv-pow73.7%
*-commutative73.7%
clear-num73.7%
un-div-inv73.6%
Applied egg-rr73.6%
associate-/l/78.0%
associate-*r/74.9%
*-commutative74.9%
associate-*r/78.0%
unpow-178.0%
Simplified78.0%
Final simplification81.6%
(FPCore (u v t1) :precision binary64 (if (<= u -2.6e-101) (/ t1 (* (/ u v) (- t1 u))) (if (<= u 6e-36) (/ (- v) t1) (* (/ (- t1) (+ t1 u)) (/ v u)))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -2.6e-101) {
tmp = t1 / ((u / v) * (t1 - u));
} else if (u <= 6e-36) {
tmp = -v / t1;
} else {
tmp = (-t1 / (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 (u <= (-2.6d-101)) then
tmp = t1 / ((u / v) * (t1 - u))
else if (u <= 6d-36) then
tmp = -v / t1
else
tmp = (-t1 / (t1 + u)) * (v / u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -2.6e-101) {
tmp = t1 / ((u / v) * (t1 - u));
} else if (u <= 6e-36) {
tmp = -v / t1;
} else {
tmp = (-t1 / (t1 + u)) * (v / u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -2.6e-101: tmp = t1 / ((u / v) * (t1 - u)) elif u <= 6e-36: tmp = -v / t1 else: tmp = (-t1 / (t1 + u)) * (v / u) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -2.6e-101) tmp = Float64(t1 / Float64(Float64(u / v) * Float64(t1 - u))); elseif (u <= 6e-36) tmp = Float64(Float64(-v) / t1); else tmp = Float64(Float64(Float64(-t1) / Float64(t1 + u)) * Float64(v / u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -2.6e-101) tmp = t1 / ((u / v) * (t1 - u)); elseif (u <= 6e-36) tmp = -v / t1; else tmp = (-t1 / (t1 + u)) * (v / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -2.6e-101], N[(t1 / N[(N[(u / v), $MachinePrecision] * N[(t1 - u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 6e-36], N[((-v) / t1), $MachinePrecision], N[(N[((-t1) / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(v / u), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.6 \cdot 10^{-101}:\\
\;\;\;\;\frac{t1}{\frac{u}{v} \cdot \left(t1 - u\right)}\\
\mathbf{elif}\;u \leq 6 \cdot 10^{-36}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{-t1}{t1 + u} \cdot \frac{v}{u}\\
\end{array}
\end{array}
if u < -2.6000000000000001e-101Initial program 75.7%
times-frac98.6%
Simplified98.6%
*-commutative98.6%
clear-num98.6%
frac-2neg98.6%
frac-times85.1%
*-un-lft-identity85.1%
remove-double-neg85.1%
distribute-neg-in85.1%
add-sqr-sqrt51.1%
sqrt-unprod79.5%
sqr-neg79.5%
sqrt-unprod30.6%
add-sqr-sqrt76.4%
sub-neg76.4%
Applied egg-rr76.4%
Taylor expanded in t1 around 0 77.5%
if -2.6000000000000001e-101 < u < 6.0000000000000003e-36Initial program 63.4%
times-frac97.5%
Simplified97.5%
Taylor expanded in t1 around inf 85.0%
associate-*r/85.0%
neg-mul-185.0%
Simplified85.0%
if 6.0000000000000003e-36 < u Initial program 75.6%
times-frac97.9%
Simplified97.9%
Taylor expanded in t1 around 0 78.6%
Final simplification81.0%
(FPCore (u v t1) :precision binary64 (if (<= u -2.6e-101) (/ t1 (* (/ u v) (- t1 u))) (if (<= u 2.3e-48) (/ (- v) t1) (/ (* v (/ t1 u)) (- (- t1) u)))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -2.6e-101) {
tmp = t1 / ((u / v) * (t1 - u));
} else if (u <= 2.3e-48) {
tmp = -v / t1;
} else {
tmp = (v * (t1 / u)) / (-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.6d-101)) then
tmp = t1 / ((u / v) * (t1 - u))
else if (u <= 2.3d-48) then
tmp = -v / t1
else
tmp = (v * (t1 / u)) / (-t1 - u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -2.6e-101) {
tmp = t1 / ((u / v) * (t1 - u));
} else if (u <= 2.3e-48) {
tmp = -v / t1;
} else {
tmp = (v * (t1 / u)) / (-t1 - u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -2.6e-101: tmp = t1 / ((u / v) * (t1 - u)) elif u <= 2.3e-48: tmp = -v / t1 else: tmp = (v * (t1 / u)) / (-t1 - u) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -2.6e-101) tmp = Float64(t1 / Float64(Float64(u / v) * Float64(t1 - u))); elseif (u <= 2.3e-48) tmp = Float64(Float64(-v) / t1); else tmp = Float64(Float64(v * Float64(t1 / u)) / Float64(Float64(-t1) - u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -2.6e-101) tmp = t1 / ((u / v) * (t1 - u)); elseif (u <= 2.3e-48) tmp = -v / t1; else tmp = (v * (t1 / u)) / (-t1 - u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -2.6e-101], N[(t1 / N[(N[(u / v), $MachinePrecision] * N[(t1 - u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 2.3e-48], N[((-v) / t1), $MachinePrecision], N[(N[(v * N[(t1 / u), $MachinePrecision]), $MachinePrecision] / N[((-t1) - u), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.6 \cdot 10^{-101}:\\
\;\;\;\;\frac{t1}{\frac{u}{v} \cdot \left(t1 - u\right)}\\
\mathbf{elif}\;u \leq 2.3 \cdot 10^{-48}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v \cdot \frac{t1}{u}}{\left(-t1\right) - u}\\
\end{array}
\end{array}
if u < -2.6000000000000001e-101Initial program 75.7%
times-frac98.6%
Simplified98.6%
*-commutative98.6%
clear-num98.6%
frac-2neg98.6%
frac-times85.1%
*-un-lft-identity85.1%
remove-double-neg85.1%
distribute-neg-in85.1%
add-sqr-sqrt51.1%
sqrt-unprod79.5%
sqr-neg79.5%
sqrt-unprod30.6%
add-sqr-sqrt76.4%
sub-neg76.4%
Applied egg-rr76.4%
Taylor expanded in t1 around 0 77.5%
if -2.6000000000000001e-101 < u < 2.3000000000000001e-48Initial program 62.5%
times-frac98.2%
Simplified98.2%
Taylor expanded in t1 around inf 86.9%
associate-*r/86.9%
neg-mul-186.9%
Simplified86.9%
if 2.3000000000000001e-48 < u Initial program 76.0%
associate-/r*85.5%
*-commutative85.5%
associate-/l*96.7%
associate-/l/90.8%
+-commutative90.8%
remove-double-neg90.8%
unsub-neg90.8%
div-sub90.8%
sub-neg90.8%
*-inverses90.8%
metadata-eval90.8%
Simplified90.8%
Taylor expanded in u around inf 69.8%
mul-1-neg69.8%
distribute-neg-frac69.8%
Simplified69.8%
div-inv69.7%
frac-2neg69.7%
metadata-eval69.7%
distribute-rgt-neg-in69.7%
frac-2neg69.7%
remove-double-neg69.7%
distribute-frac-neg69.7%
frac-2neg69.7%
Applied egg-rr69.7%
associate-*r/69.8%
*-commutative69.8%
times-frac75.6%
*-commutative75.6%
associate-*l/75.6%
associate-/r/77.0%
associate-*r*77.0%
associate-*r/77.0%
neg-mul-177.0%
+-commutative77.0%
Simplified77.0%
frac-2neg77.0%
+-commutative77.0%
div-inv77.0%
*-commutative77.0%
distribute-rgt-neg-in77.0%
frac-2neg77.0%
remove-double-neg77.0%
distribute-frac-neg77.0%
frac-2neg77.0%
Applied egg-rr77.0%
associate-*r/77.0%
*-rgt-identity77.0%
associate-*r/73.7%
associate-/l*78.2%
associate-/r/77.0%
distribute-neg-in77.0%
unsub-neg77.0%
Simplified77.0%
Final simplification81.4%
(FPCore (u v t1) :precision binary64 (if (<= u -2.6e-101) (/ t1 (* (/ u v) (- t1 u))) (if (<= u 2.6e-17) (/ (- v) t1) (/ (* (- t1) (/ v u)) (+ t1 u)))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -2.6e-101) {
tmp = t1 / ((u / v) * (t1 - u));
} else if (u <= 2.6e-17) {
tmp = -v / t1;
} else {
tmp = (-t1 * (v / u)) / (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.6d-101)) then
tmp = t1 / ((u / v) * (t1 - u))
else if (u <= 2.6d-17) then
tmp = -v / t1
else
tmp = (-t1 * (v / u)) / (t1 + u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -2.6e-101) {
tmp = t1 / ((u / v) * (t1 - u));
} else if (u <= 2.6e-17) {
tmp = -v / t1;
} else {
tmp = (-t1 * (v / u)) / (t1 + u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -2.6e-101: tmp = t1 / ((u / v) * (t1 - u)) elif u <= 2.6e-17: tmp = -v / t1 else: tmp = (-t1 * (v / u)) / (t1 + u) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -2.6e-101) tmp = Float64(t1 / Float64(Float64(u / v) * Float64(t1 - u))); elseif (u <= 2.6e-17) tmp = Float64(Float64(-v) / t1); else tmp = Float64(Float64(Float64(-t1) * Float64(v / u)) / Float64(t1 + u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -2.6e-101) tmp = t1 / ((u / v) * (t1 - u)); elseif (u <= 2.6e-17) tmp = -v / t1; else tmp = (-t1 * (v / u)) / (t1 + u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -2.6e-101], N[(t1 / N[(N[(u / v), $MachinePrecision] * N[(t1 - u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 2.6e-17], N[((-v) / t1), $MachinePrecision], N[(N[((-t1) * N[(v / u), $MachinePrecision]), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.6 \cdot 10^{-101}:\\
\;\;\;\;\frac{t1}{\frac{u}{v} \cdot \left(t1 - u\right)}\\
\mathbf{elif}\;u \leq 2.6 \cdot 10^{-17}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-t1\right) \cdot \frac{v}{u}}{t1 + u}\\
\end{array}
\end{array}
if u < -2.6000000000000001e-101Initial program 75.7%
times-frac98.6%
Simplified98.6%
*-commutative98.6%
clear-num98.6%
frac-2neg98.6%
frac-times85.1%
*-un-lft-identity85.1%
remove-double-neg85.1%
distribute-neg-in85.1%
add-sqr-sqrt51.1%
sqrt-unprod79.5%
sqr-neg79.5%
sqrt-unprod30.6%
add-sqr-sqrt76.4%
sub-neg76.4%
Applied egg-rr76.4%
Taylor expanded in t1 around 0 77.5%
if -2.6000000000000001e-101 < u < 2.60000000000000003e-17Initial program 63.0%
times-frac97.5%
Simplified97.5%
Taylor expanded in t1 around inf 83.8%
associate-*r/83.8%
neg-mul-183.8%
Simplified83.8%
if 2.60000000000000003e-17 < u Initial program 77.3%
associate-/r*84.8%
*-commutative84.8%
associate-/l*96.2%
associate-/l/89.2%
+-commutative89.2%
remove-double-neg89.2%
unsub-neg89.2%
div-sub89.2%
sub-neg89.2%
*-inverses89.2%
metadata-eval89.2%
Simplified89.2%
Taylor expanded in u around inf 72.1%
mul-1-neg72.1%
distribute-neg-frac72.1%
Simplified72.1%
div-inv72.0%
frac-2neg72.0%
metadata-eval72.0%
distribute-rgt-neg-in72.0%
frac-2neg72.0%
remove-double-neg72.0%
distribute-frac-neg72.0%
frac-2neg72.0%
Applied egg-rr72.0%
associate-*r/72.1%
*-commutative72.1%
times-frac79.0%
*-commutative79.0%
associate-*l/79.0%
associate-/r/82.5%
associate-*r*82.5%
associate-*r/82.5%
neg-mul-182.5%
+-commutative82.5%
Simplified82.5%
Final simplification81.4%
(FPCore (u v t1) :precision binary64 (if (<= u -2.6e-101) (/ (/ v u) (/ (- u) t1)) (if (<= u 2.3e-48) (/ (- v) t1) (* (/ v u) (/ t1 (- t1 u))))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -2.6e-101) {
tmp = (v / u) / (-u / t1);
} else if (u <= 2.3e-48) {
tmp = -v / t1;
} else {
tmp = (v / u) * (t1 / (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.6d-101)) then
tmp = (v / u) / (-u / t1)
else if (u <= 2.3d-48) then
tmp = -v / t1
else
tmp = (v / u) * (t1 / (t1 - u))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -2.6e-101) {
tmp = (v / u) / (-u / t1);
} else if (u <= 2.3e-48) {
tmp = -v / t1;
} else {
tmp = (v / u) * (t1 / (t1 - u));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -2.6e-101: tmp = (v / u) / (-u / t1) elif u <= 2.3e-48: tmp = -v / t1 else: tmp = (v / u) * (t1 / (t1 - u)) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -2.6e-101) tmp = Float64(Float64(v / u) / Float64(Float64(-u) / t1)); elseif (u <= 2.3e-48) tmp = Float64(Float64(-v) / t1); else tmp = Float64(Float64(v / u) * Float64(t1 / Float64(t1 - u))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -2.6e-101) tmp = (v / u) / (-u / t1); elseif (u <= 2.3e-48) tmp = -v / t1; else tmp = (v / u) * (t1 / (t1 - u)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -2.6e-101], N[(N[(v / u), $MachinePrecision] / N[((-u) / t1), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 2.3e-48], N[((-v) / t1), $MachinePrecision], N[(N[(v / u), $MachinePrecision] * N[(t1 / N[(t1 - u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.6 \cdot 10^{-101}:\\
\;\;\;\;\frac{\frac{v}{u}}{\frac{-u}{t1}}\\
\mathbf{elif}\;u \leq 2.3 \cdot 10^{-48}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u} \cdot \frac{t1}{t1 - u}\\
\end{array}
\end{array}
if u < -2.6000000000000001e-101Initial program 75.7%
associate-/r*87.2%
*-commutative87.2%
associate-/l*98.7%
associate-/l/96.6%
+-commutative96.6%
remove-double-neg96.6%
unsub-neg96.6%
div-sub96.6%
sub-neg96.6%
*-inverses96.6%
metadata-eval96.6%
Simplified96.6%
Taylor expanded in v around 0 96.6%
sub-neg96.6%
mul-1-neg96.6%
distribute-neg-in96.6%
associate-/r*98.7%
+-commutative98.7%
distribute-neg-in98.7%
metadata-eval98.7%
sub-neg98.7%
Simplified98.7%
Taylor expanded in t1 around 0 76.2%
Taylor expanded in u around inf 77.2%
associate-*r/77.2%
mul-1-neg77.2%
Simplified77.2%
if -2.6000000000000001e-101 < u < 2.3000000000000001e-48Initial program 62.5%
times-frac98.2%
Simplified98.2%
Taylor expanded in t1 around inf 86.9%
associate-*r/86.9%
neg-mul-186.9%
Simplified86.9%
if 2.3000000000000001e-48 < u Initial program 76.0%
times-frac96.5%
Simplified96.5%
*-commutative96.5%
clear-num95.3%
frac-2neg95.3%
frac-times86.0%
*-un-lft-identity86.0%
remove-double-neg86.0%
distribute-neg-in86.0%
add-sqr-sqrt45.3%
sqrt-unprod78.1%
sqr-neg78.1%
sqrt-unprod34.2%
add-sqr-sqrt73.6%
sub-neg73.6%
Applied egg-rr73.6%
Taylor expanded in t1 around 0 73.6%
Taylor expanded in v around 0 70.3%
*-commutative70.3%
times-frac75.4%
Simplified75.4%
Final simplification80.9%
(FPCore (u v t1) :precision binary64 (if (<= u -4.7e-102) (/ t1 (* (/ u v) (- t1 u))) (if (<= u 2.3e-48) (/ (- v) t1) (* (/ v u) (/ t1 (- t1 u))))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -4.7e-102) {
tmp = t1 / ((u / v) * (t1 - u));
} else if (u <= 2.3e-48) {
tmp = -v / t1;
} else {
tmp = (v / u) * (t1 / (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 <= (-4.7d-102)) then
tmp = t1 / ((u / v) * (t1 - u))
else if (u <= 2.3d-48) then
tmp = -v / t1
else
tmp = (v / u) * (t1 / (t1 - u))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -4.7e-102) {
tmp = t1 / ((u / v) * (t1 - u));
} else if (u <= 2.3e-48) {
tmp = -v / t1;
} else {
tmp = (v / u) * (t1 / (t1 - u));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -4.7e-102: tmp = t1 / ((u / v) * (t1 - u)) elif u <= 2.3e-48: tmp = -v / t1 else: tmp = (v / u) * (t1 / (t1 - u)) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -4.7e-102) tmp = Float64(t1 / Float64(Float64(u / v) * Float64(t1 - u))); elseif (u <= 2.3e-48) tmp = Float64(Float64(-v) / t1); else tmp = Float64(Float64(v / u) * Float64(t1 / Float64(t1 - u))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -4.7e-102) tmp = t1 / ((u / v) * (t1 - u)); elseif (u <= 2.3e-48) tmp = -v / t1; else tmp = (v / u) * (t1 / (t1 - u)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -4.7e-102], N[(t1 / N[(N[(u / v), $MachinePrecision] * N[(t1 - u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 2.3e-48], N[((-v) / t1), $MachinePrecision], N[(N[(v / u), $MachinePrecision] * N[(t1 / N[(t1 - u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -4.7 \cdot 10^{-102}:\\
\;\;\;\;\frac{t1}{\frac{u}{v} \cdot \left(t1 - u\right)}\\
\mathbf{elif}\;u \leq 2.3 \cdot 10^{-48}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u} \cdot \frac{t1}{t1 - u}\\
\end{array}
\end{array}
if u < -4.7000000000000003e-102Initial program 75.7%
times-frac98.6%
Simplified98.6%
*-commutative98.6%
clear-num98.6%
frac-2neg98.6%
frac-times85.1%
*-un-lft-identity85.1%
remove-double-neg85.1%
distribute-neg-in85.1%
add-sqr-sqrt51.1%
sqrt-unprod79.5%
sqr-neg79.5%
sqrt-unprod30.6%
add-sqr-sqrt76.4%
sub-neg76.4%
Applied egg-rr76.4%
Taylor expanded in t1 around 0 77.5%
if -4.7000000000000003e-102 < u < 2.3000000000000001e-48Initial program 62.5%
times-frac98.2%
Simplified98.2%
Taylor expanded in t1 around inf 86.9%
associate-*r/86.9%
neg-mul-186.9%
Simplified86.9%
if 2.3000000000000001e-48 < u Initial program 76.0%
times-frac96.5%
Simplified96.5%
*-commutative96.5%
clear-num95.3%
frac-2neg95.3%
frac-times86.0%
*-un-lft-identity86.0%
remove-double-neg86.0%
distribute-neg-in86.0%
add-sqr-sqrt45.3%
sqrt-unprod78.1%
sqr-neg78.1%
sqrt-unprod34.2%
add-sqr-sqrt73.6%
sub-neg73.6%
Applied egg-rr73.6%
Taylor expanded in t1 around 0 73.6%
Taylor expanded in v around 0 70.3%
*-commutative70.3%
times-frac75.4%
Simplified75.4%
Final simplification81.0%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -1.2e-30) (not (<= t1 1.85e-150))) (/ v (- (* u -2.0) t1)) (/ (/ v u) (/ (- u) t1))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.2e-30) || !(t1 <= 1.85e-150)) {
tmp = v / ((u * -2.0) - t1);
} else {
tmp = (v / u) / (-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 ((t1 <= (-1.2d-30)) .or. (.not. (t1 <= 1.85d-150))) then
tmp = v / ((u * (-2.0d0)) - t1)
else
tmp = (v / u) / (-u / t1)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.2e-30) || !(t1 <= 1.85e-150)) {
tmp = v / ((u * -2.0) - t1);
} else {
tmp = (v / u) / (-u / t1);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -1.2e-30) or not (t1 <= 1.85e-150): tmp = v / ((u * -2.0) - t1) else: tmp = (v / u) / (-u / t1) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -1.2e-30) || !(t1 <= 1.85e-150)) tmp = Float64(v / Float64(Float64(u * -2.0) - t1)); else tmp = Float64(Float64(v / u) / Float64(Float64(-u) / t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -1.2e-30) || ~((t1 <= 1.85e-150))) tmp = v / ((u * -2.0) - t1); else tmp = (v / u) / (-u / t1); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -1.2e-30], N[Not[LessEqual[t1, 1.85e-150]], $MachinePrecision]], N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision], N[(N[(v / u), $MachinePrecision] / N[((-u) / t1), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.2 \cdot 10^{-30} \lor \neg \left(t1 \leq 1.85 \cdot 10^{-150}\right):\\
\;\;\;\;\frac{v}{u \cdot -2 - t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{v}{u}}{\frac{-u}{t1}}\\
\end{array}
\end{array}
if t1 < -1.19999999999999992e-30 or 1.85e-150 < t1 Initial program 67.5%
associate-/r*81.0%
*-commutative81.0%
associate-/l*99.9%
associate-/l/96.8%
+-commutative96.8%
remove-double-neg96.8%
unsub-neg96.8%
div-sub96.8%
sub-neg96.8%
*-inverses96.8%
metadata-eval96.8%
Simplified96.8%
Taylor expanded in t1 around inf 80.6%
mul-1-neg80.6%
unsub-neg80.6%
*-commutative80.6%
Simplified80.6%
if -1.19999999999999992e-30 < t1 < 1.85e-150Initial program 74.0%
associate-/r*83.7%
*-commutative83.7%
associate-/l*95.5%
associate-/l/96.3%
+-commutative96.3%
remove-double-neg96.3%
unsub-neg96.3%
div-sub96.3%
sub-neg96.3%
*-inverses96.3%
metadata-eval96.3%
Simplified96.3%
Taylor expanded in v around 0 96.3%
sub-neg96.3%
mul-1-neg96.3%
distribute-neg-in96.3%
associate-/r*94.5%
+-commutative94.5%
distribute-neg-in94.5%
metadata-eval94.5%
sub-neg94.5%
Simplified94.5%
Taylor expanded in t1 around 0 76.2%
Taylor expanded in u around inf 81.1%
associate-*r/81.1%
mul-1-neg81.1%
Simplified81.1%
Final simplification80.8%
(FPCore (u v t1) :precision binary64 (if (or (<= u -2.8e+118) (not (<= u 7e+196))) (/ t1 (/ t1 (/ v u))) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -2.8e+118) || !(u <= 7e+196)) {
tmp = t1 / (t1 / (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 <= (-2.8d+118)) .or. (.not. (u <= 7d+196))) then
tmp = t1 / (t1 / (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 <= -2.8e+118) || !(u <= 7e+196)) {
tmp = t1 / (t1 / (v / u));
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -2.8e+118) or not (u <= 7e+196): tmp = t1 / (t1 / (v / u)) else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -2.8e+118) || !(u <= 7e+196)) tmp = Float64(t1 / Float64(t1 / 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 <= -2.8e+118) || ~((u <= 7e+196))) tmp = t1 / (t1 / (v / u)); else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -2.8e+118], N[Not[LessEqual[u, 7e+196]], $MachinePrecision]], N[(t1 / N[(t1 / N[(v / u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.8 \cdot 10^{+118} \lor \neg \left(u \leq 7 \cdot 10^{+196}\right):\\
\;\;\;\;\frac{t1}{\frac{t1}{\frac{v}{u}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -2.79999999999999986e118 or 6.9999999999999997e196 < u Initial program 79.8%
times-frac99.8%
Simplified99.8%
*-commutative99.8%
clear-num99.9%
frac-2neg99.9%
frac-times86.8%
*-un-lft-identity86.8%
remove-double-neg86.8%
distribute-neg-in86.8%
add-sqr-sqrt42.4%
sqrt-unprod85.1%
sqr-neg85.1%
sqrt-unprod44.4%
add-sqr-sqrt86.8%
sub-neg86.8%
Applied egg-rr86.8%
Taylor expanded in t1 around 0 86.8%
Taylor expanded in u around 0 55.2%
associate-/l*55.1%
Simplified55.1%
if -2.79999999999999986e118 < u < 6.9999999999999997e196Initial program 67.6%
times-frac97.5%
Simplified97.5%
Taylor expanded in t1 around inf 62.3%
associate-*r/62.3%
neg-mul-162.3%
Simplified62.3%
Final simplification60.7%
(FPCore (u v t1) :precision binary64 (if (or (<= u -2.3e+117) (not (<= u 6.2e+196))) (/ t1 (/ (* t1 u) v)) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -2.3e+117) || !(u <= 6.2e+196)) {
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 <= (-2.3d+117)) .or. (.not. (u <= 6.2d+196))) 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 <= -2.3e+117) || !(u <= 6.2e+196)) {
tmp = t1 / ((t1 * u) / v);
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -2.3e+117) or not (u <= 6.2e+196): tmp = t1 / ((t1 * u) / v) else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -2.3e+117) || !(u <= 6.2e+196)) 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 <= -2.3e+117) || ~((u <= 6.2e+196))) tmp = t1 / ((t1 * u) / v); else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -2.3e+117], N[Not[LessEqual[u, 6.2e+196]], $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 -2.3 \cdot 10^{+117} \lor \neg \left(u \leq 6.2 \cdot 10^{+196}\right):\\
\;\;\;\;\frac{t1}{\frac{t1 \cdot u}{v}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -2.29999999999999988e117 or 6.2000000000000002e196 < u Initial program 79.8%
times-frac99.8%
Simplified99.8%
*-commutative99.8%
clear-num99.9%
frac-2neg99.9%
frac-times86.8%
*-un-lft-identity86.8%
remove-double-neg86.8%
distribute-neg-in86.8%
add-sqr-sqrt42.4%
sqrt-unprod85.1%
sqr-neg85.1%
sqrt-unprod44.4%
add-sqr-sqrt86.8%
sub-neg86.8%
Applied egg-rr86.8%
Taylor expanded in t1 around 0 86.8%
Taylor expanded in u around 0 55.2%
if -2.29999999999999988e117 < u < 6.2000000000000002e196Initial program 67.6%
times-frac97.5%
Simplified97.5%
Taylor expanded in t1 around inf 62.3%
associate-*r/62.3%
neg-mul-162.3%
Simplified62.3%
Final simplification60.7%
(FPCore (u v t1) :precision binary64 (if (or (<= u -8.6e+120) (not (<= u 2.1e+221))) (/ (- v) u) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -8.6e+120) || !(u <= 2.1e+221)) {
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 <= (-8.6d+120)) .or. (.not. (u <= 2.1d+221))) 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 <= -8.6e+120) || !(u <= 2.1e+221)) {
tmp = -v / u;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -8.6e+120) or not (u <= 2.1e+221): tmp = -v / u else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -8.6e+120) || !(u <= 2.1e+221)) 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 <= -8.6e+120) || ~((u <= 2.1e+221))) tmp = -v / u; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -8.6e+120], N[Not[LessEqual[u, 2.1e+221]], $MachinePrecision]], N[((-v) / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -8.6 \cdot 10^{+120} \lor \neg \left(u \leq 2.1 \cdot 10^{+221}\right):\\
\;\;\;\;\frac{-v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -8.6000000000000003e120 or 2.10000000000000002e221 < u Initial program 79.3%
associate-/r*95.9%
*-commutative95.9%
associate-/l*99.9%
associate-/l/88.6%
+-commutative88.6%
remove-double-neg88.6%
unsub-neg88.6%
div-sub88.6%
sub-neg88.6%
*-inverses88.6%
metadata-eval88.6%
Simplified88.6%
Taylor expanded in u around inf 80.9%
mul-1-neg80.9%
distribute-neg-frac80.9%
Simplified80.9%
Taylor expanded in t1 around inf 47.7%
associate-*r/47.7%
neg-mul-147.7%
Simplified47.7%
if -8.6000000000000003e120 < u < 2.10000000000000002e221Initial program 68.1%
times-frac97.5%
Simplified97.5%
Taylor expanded in t1 around inf 61.9%
associate-*r/61.9%
neg-mul-161.9%
Simplified61.9%
Final simplification59.2%
(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 70.2%
associate-/r*82.1%
*-commutative82.1%
associate-/l*98.1%
associate-/l/96.6%
+-commutative96.6%
remove-double-neg96.6%
unsub-neg96.6%
div-sub96.6%
sub-neg96.6%
*-inverses96.6%
metadata-eval96.6%
Simplified96.6%
Taylor expanded in u around 0 96.6%
sub-neg96.6%
mul-1-neg96.6%
distribute-neg-in96.6%
+-commutative96.6%
distribute-neg-in96.6%
metadata-eval96.6%
sub-neg96.6%
Simplified96.6%
Final simplification96.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(Float64(v / 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[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] / N[(-1.0 - N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{v}{t1 + u}}{-1 - \frac{u}{t1}}
\end{array}
Initial program 70.2%
associate-/r*82.1%
*-commutative82.1%
associate-/l*98.1%
associate-/l/96.6%
+-commutative96.6%
remove-double-neg96.6%
unsub-neg96.6%
div-sub96.6%
sub-neg96.6%
*-inverses96.6%
metadata-eval96.6%
Simplified96.6%
Taylor expanded in v around 0 96.6%
sub-neg96.6%
mul-1-neg96.6%
distribute-neg-in96.6%
associate-/r*97.6%
+-commutative97.6%
distribute-neg-in97.6%
metadata-eval97.6%
sub-neg97.6%
Simplified97.6%
Final simplification97.6%
(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 70.2%
associate-/r*82.1%
*-commutative82.1%
associate-/l*98.1%
associate-/l/96.6%
+-commutative96.6%
remove-double-neg96.6%
unsub-neg96.6%
div-sub96.6%
sub-neg96.6%
*-inverses96.6%
metadata-eval96.6%
Simplified96.6%
Taylor expanded in t1 around inf 61.4%
mul-1-neg61.4%
unsub-neg61.4%
*-commutative61.4%
Simplified61.4%
Final simplification61.4%
(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 70.2%
times-frac98.0%
Simplified98.0%
Taylor expanded in t1 around inf 53.8%
associate-*r/53.8%
neg-mul-153.8%
Simplified53.8%
Final simplification53.8%
herbie shell --seed 2024018
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))