
(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 11 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 80.0%
times-frac98.6%
Simplified98.6%
Final simplification98.6%
(FPCore (u v t1) :precision binary64 (if (or (<= u -0.02) (not (<= u 9.2e-33))) (/ (/ t1 (/ (- t1 u) v)) u) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -0.02) || !(u <= 9.2e-33)) {
tmp = (t1 / ((t1 - u) / 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 <= (-0.02d0)) .or. (.not. (u <= 9.2d-33))) then
tmp = (t1 / ((t1 - u) / 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 <= -0.02) || !(u <= 9.2e-33)) {
tmp = (t1 / ((t1 - u) / v)) / u;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -0.02) or not (u <= 9.2e-33): tmp = (t1 / ((t1 - u) / v)) / u else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -0.02) || !(u <= 9.2e-33)) tmp = Float64(Float64(t1 / Float64(Float64(t1 - u) / v)) / u); else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -0.02) || ~((u <= 9.2e-33))) tmp = (t1 / ((t1 - u) / v)) / u; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -0.02], N[Not[LessEqual[u, 9.2e-33]], $MachinePrecision]], N[(N[(t1 / N[(N[(t1 - u), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision] / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -0.02 \lor \neg \left(u \leq 9.2 \cdot 10^{-33}\right):\\
\;\;\;\;\frac{\frac{t1}{\frac{t1 - u}{v}}}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -0.0200000000000000004 or 9.19999999999999942e-33 < u Initial program 84.1%
times-frac98.2%
Simplified98.2%
Taylor expanded in t1 around 0 83.6%
mul-1-neg83.6%
distribute-neg-frac83.6%
Simplified83.6%
associate-*l/85.2%
Applied egg-rr86.1%
if -0.0200000000000000004 < u < 9.19999999999999942e-33Initial program 74.7%
times-frac99.1%
Simplified99.1%
Taylor expanded in t1 around inf 81.7%
associate-*r/81.7%
neg-mul-181.7%
Simplified81.7%
Final simplification84.2%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -4400000000.0) (not (<= t1 4.2e+73))) (/ (- v) (+ t1 u)) (* (/ (- t1) u) (/ v u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -4400000000.0) || !(t1 <= 4.2e+73)) {
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 <= (-4400000000.0d0)) .or. (.not. (t1 <= 4.2d+73))) 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 <= -4400000000.0) || !(t1 <= 4.2e+73)) {
tmp = -v / (t1 + u);
} else {
tmp = (-t1 / u) * (v / u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -4400000000.0) or not (t1 <= 4.2e+73): tmp = -v / (t1 + u) else: tmp = (-t1 / u) * (v / u) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -4400000000.0) || !(t1 <= 4.2e+73)) tmp = Float64(Float64(-v) / Float64(t1 + u)); else tmp = Float64(Float64(Float64(-t1) / u) * Float64(v / u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -4400000000.0) || ~((t1 <= 4.2e+73))) tmp = -v / (t1 + u); else tmp = (-t1 / u) * (v / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -4400000000.0], N[Not[LessEqual[t1, 4.2e+73]], $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 -4400000000 \lor \neg \left(t1 \leq 4.2 \cdot 10^{+73}\right):\\
\;\;\;\;\frac{-v}{t1 + u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\
\end{array}
\end{array}
if t1 < -4.4e9 or 4.2000000000000003e73 < t1 Initial program 65.4%
times-frac99.9%
Simplified99.9%
Taylor expanded in t1 around inf 89.4%
if -4.4e9 < t1 < 4.2000000000000003e73Initial program 91.7%
times-frac97.5%
Simplified97.5%
Taylor expanded in t1 around 0 76.3%
mul-1-neg76.3%
distribute-neg-frac76.3%
Simplified76.3%
Taylor expanded in t1 around 0 79.3%
Final simplification83.8%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -3700000000000.0) (not (<= t1 9.5e+73))) (/ (- v) (+ t1 (* u 2.0))) (* (/ (- t1) u) (/ v u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -3700000000000.0) || !(t1 <= 9.5e+73)) {
tmp = -v / (t1 + (u * 2.0));
} 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 <= (-3700000000000.0d0)) .or. (.not. (t1 <= 9.5d+73))) then
tmp = -v / (t1 + (u * 2.0d0))
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 <= -3700000000000.0) || !(t1 <= 9.5e+73)) {
tmp = -v / (t1 + (u * 2.0));
} else {
tmp = (-t1 / u) * (v / u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -3700000000000.0) or not (t1 <= 9.5e+73): tmp = -v / (t1 + (u * 2.0)) else: tmp = (-t1 / u) * (v / u) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -3700000000000.0) || !(t1 <= 9.5e+73)) tmp = Float64(Float64(-v) / Float64(t1 + Float64(u * 2.0))); else tmp = Float64(Float64(Float64(-t1) / u) * Float64(v / u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -3700000000000.0) || ~((t1 <= 9.5e+73))) tmp = -v / (t1 + (u * 2.0)); else tmp = (-t1 / u) * (v / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -3700000000000.0], N[Not[LessEqual[t1, 9.5e+73]], $MachinePrecision]], N[((-v) / N[(t1 + N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-t1) / u), $MachinePrecision] * N[(v / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -3700000000000 \lor \neg \left(t1 \leq 9.5 \cdot 10^{+73}\right):\\
\;\;\;\;\frac{-v}{t1 + u \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\
\end{array}
\end{array}
if t1 < -3.7e12 or 9.4999999999999996e73 < t1 Initial program 65.4%
times-frac99.9%
neg-mul-199.9%
associate-/l*99.9%
associate-*l/99.9%
neg-mul-199.9%
distribute-frac-neg99.9%
+-commutative99.9%
remove-double-neg99.9%
unsub-neg99.9%
div-sub99.9%
sub-neg99.9%
distribute-frac-neg99.9%
remove-double-neg99.9%
*-inverses99.9%
Simplified99.9%
Taylor expanded in v around 0 97.5%
mul-1-neg97.5%
+-commutative97.5%
*-commutative97.5%
distribute-neg-frac97.5%
Simplified97.5%
Taylor expanded in t1 around inf 89.9%
*-commutative89.9%
Simplified89.9%
if -3.7e12 < t1 < 9.4999999999999996e73Initial program 91.7%
times-frac97.5%
Simplified97.5%
Taylor expanded in t1 around 0 76.3%
mul-1-neg76.3%
distribute-neg-frac76.3%
Simplified76.3%
Taylor expanded in t1 around 0 79.3%
Final simplification84.0%
(FPCore (u v t1) :precision binary64 (if (or (<= u -5e+255) (not (<= u 1.4e+119))) (/ v u) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -5e+255) || !(u <= 1.4e+119)) {
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 <= (-5d+255)) .or. (.not. (u <= 1.4d+119))) 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 <= -5e+255) || !(u <= 1.4e+119)) {
tmp = v / u;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -5e+255) or not (u <= 1.4e+119): tmp = v / u else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -5e+255) || !(u <= 1.4e+119)) 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 <= -5e+255) || ~((u <= 1.4e+119))) tmp = v / u; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -5e+255], N[Not[LessEqual[u, 1.4e+119]], $MachinePrecision]], N[(v / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -5 \cdot 10^{+255} \lor \neg \left(u \leq 1.4 \cdot 10^{+119}\right):\\
\;\;\;\;\frac{v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -5.0000000000000002e255 or 1.40000000000000007e119 < u Initial program 87.4%
times-frac99.4%
Simplified99.4%
frac-2neg99.4%
remove-double-neg99.4%
associate-*l/99.9%
distribute-neg-in99.9%
add-sqr-sqrt48.4%
sqrt-unprod92.5%
sqr-neg92.5%
sqrt-unprod48.6%
add-sqr-sqrt95.4%
sub-neg95.4%
Applied egg-rr95.4%
associate-*r/90.9%
Simplified90.9%
Taylor expanded in t1 around 0 90.9%
*-commutative90.9%
Simplified90.9%
Taylor expanded in t1 around inf 40.4%
if -5.0000000000000002e255 < u < 1.40000000000000007e119Initial program 77.5%
times-frac98.3%
Simplified98.3%
Taylor expanded in t1 around inf 64.2%
associate-*r/64.2%
neg-mul-164.2%
Simplified64.2%
Final simplification58.2%
(FPCore (u v t1) :precision binary64 (if (<= u -5e+255) (/ v u) (if (<= u 9.5e+101) (/ (- v) t1) (/ (- v) u))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -5e+255) {
tmp = v / u;
} else if (u <= 9.5e+101) {
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 <= (-5d+255)) then
tmp = v / u
else if (u <= 9.5d+101) 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 <= -5e+255) {
tmp = v / u;
} else if (u <= 9.5e+101) {
tmp = -v / t1;
} else {
tmp = -v / u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -5e+255: tmp = v / u elif u <= 9.5e+101: tmp = -v / t1 else: tmp = -v / u return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -5e+255) tmp = Float64(v / u); elseif (u <= 9.5e+101) 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 <= -5e+255) tmp = v / u; elseif (u <= 9.5e+101) tmp = -v / t1; else tmp = -v / u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -5e+255], N[(v / u), $MachinePrecision], If[LessEqual[u, 9.5e+101], N[((-v) / t1), $MachinePrecision], N[((-v) / u), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -5 \cdot 10^{+255}:\\
\;\;\;\;\frac{v}{u}\\
\mathbf{elif}\;u \leq 9.5 \cdot 10^{+101}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{u}\\
\end{array}
\end{array}
if u < -5.0000000000000002e255Initial program 93.8%
times-frac99.9%
Simplified99.9%
frac-2neg99.9%
remove-double-neg99.9%
associate-*l/100.0%
distribute-neg-in100.0%
add-sqr-sqrt37.5%
sqrt-unprod94.0%
sqr-neg94.0%
sqrt-unprod62.5%
add-sqr-sqrt100.0%
sub-neg100.0%
Applied egg-rr100.0%
associate-*r/93.9%
Simplified93.9%
Taylor expanded in t1 around 0 93.9%
*-commutative93.9%
Simplified93.9%
Taylor expanded in t1 around inf 39.7%
if -5.0000000000000002e255 < u < 9.49999999999999947e101Initial program 77.1%
times-frac98.3%
Simplified98.3%
Taylor expanded in t1 around inf 65.1%
associate-*r/65.1%
neg-mul-165.1%
Simplified65.1%
if 9.49999999999999947e101 < u Initial program 86.1%
times-frac99.2%
neg-mul-199.2%
associate-/l*97.3%
associate-*l/97.4%
neg-mul-197.4%
distribute-frac-neg97.4%
+-commutative97.4%
remove-double-neg97.4%
unsub-neg97.4%
div-sub97.4%
sub-neg97.4%
distribute-frac-neg97.4%
remove-double-neg97.4%
*-inverses97.4%
Simplified97.4%
Taylor expanded in t1 around 0 91.8%
associate-*r/91.8%
neg-mul-191.8%
Simplified91.8%
Taylor expanded in u around 0 38.6%
associate-*r/38.6%
neg-mul-138.6%
Simplified38.6%
Final simplification58.3%
(FPCore (u v t1) :precision binary64 (if (<= u -5e+255) (/ 1.0 (/ u v)) (if (<= u 9.5e+101) (/ (- v) t1) (/ (- v) u))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -5e+255) {
tmp = 1.0 / (u / v);
} else if (u <= 9.5e+101) {
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 <= (-5d+255)) then
tmp = 1.0d0 / (u / v)
else if (u <= 9.5d+101) 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 <= -5e+255) {
tmp = 1.0 / (u / v);
} else if (u <= 9.5e+101) {
tmp = -v / t1;
} else {
tmp = -v / u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -5e+255: tmp = 1.0 / (u / v) elif u <= 9.5e+101: tmp = -v / t1 else: tmp = -v / u return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -5e+255) tmp = Float64(1.0 / Float64(u / v)); elseif (u <= 9.5e+101) 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 <= -5e+255) tmp = 1.0 / (u / v); elseif (u <= 9.5e+101) tmp = -v / t1; else tmp = -v / u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -5e+255], N[(1.0 / N[(u / v), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 9.5e+101], N[((-v) / t1), $MachinePrecision], N[((-v) / u), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -5 \cdot 10^{+255}:\\
\;\;\;\;\frac{1}{\frac{u}{v}}\\
\mathbf{elif}\;u \leq 9.5 \cdot 10^{+101}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{u}\\
\end{array}
\end{array}
if u < -5.0000000000000002e255Initial program 93.8%
times-frac99.9%
Simplified99.9%
frac-2neg99.9%
clear-num99.9%
frac-times94.0%
remove-double-neg94.0%
*-commutative94.0%
*-un-lft-identity94.0%
distribute-neg-in94.0%
add-sqr-sqrt37.5%
sqrt-unprod94.0%
sqr-neg94.0%
sqrt-unprod56.5%
add-sqr-sqrt94.0%
sub-neg94.0%
Applied egg-rr94.0%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in t1 around inf 41.4%
Taylor expanded in t1 around 0 41.4%
if -5.0000000000000002e255 < u < 9.49999999999999947e101Initial program 77.1%
times-frac98.3%
Simplified98.3%
Taylor expanded in t1 around inf 65.1%
associate-*r/65.1%
neg-mul-165.1%
Simplified65.1%
if 9.49999999999999947e101 < u Initial program 86.1%
times-frac99.2%
neg-mul-199.2%
associate-/l*97.3%
associate-*l/97.4%
neg-mul-197.4%
distribute-frac-neg97.4%
+-commutative97.4%
remove-double-neg97.4%
unsub-neg97.4%
div-sub97.4%
sub-neg97.4%
distribute-frac-neg97.4%
remove-double-neg97.4%
*-inverses97.4%
Simplified97.4%
Taylor expanded in t1 around 0 91.8%
associate-*r/91.8%
neg-mul-191.8%
Simplified91.8%
Taylor expanded in u around 0 38.6%
associate-*r/38.6%
neg-mul-138.6%
Simplified38.6%
Final simplification58.4%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -2.4e+72) (not (<= t1 5.5e+110))) (/ v t1) (/ v u)))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -2.4e+72) || !(t1 <= 5.5e+110)) {
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 <= (-2.4d+72)) .or. (.not. (t1 <= 5.5d+110))) 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 <= -2.4e+72) || !(t1 <= 5.5e+110)) {
tmp = v / t1;
} else {
tmp = v / u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -2.4e+72) or not (t1 <= 5.5e+110): tmp = v / t1 else: tmp = v / u return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -2.4e+72) || !(t1 <= 5.5e+110)) 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 <= -2.4e+72) || ~((t1 <= 5.5e+110))) tmp = v / t1; else tmp = v / u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -2.4e+72], N[Not[LessEqual[t1, 5.5e+110]], $MachinePrecision]], N[(v / t1), $MachinePrecision], N[(v / u), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -2.4 \cdot 10^{+72} \lor \neg \left(t1 \leq 5.5 \cdot 10^{+110}\right):\\
\;\;\;\;\frac{v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u}\\
\end{array}
\end{array}
if t1 < -2.4000000000000001e72 or 5.49999999999999996e110 < t1 Initial program 60.4%
times-frac99.9%
Simplified99.9%
clear-num99.9%
frac-2neg99.9%
frac-times97.0%
*-un-lft-identity97.0%
add-sqr-sqrt46.3%
sqrt-unprod62.3%
sqr-neg62.3%
sqrt-unprod24.6%
add-sqr-sqrt45.0%
add-sqr-sqrt21.9%
sqrt-unprod12.2%
sqr-neg12.2%
sqrt-unprod40.1%
add-sqr-sqrt97.0%
distribute-neg-in97.0%
add-sqr-sqrt56.4%
sqrt-unprod61.3%
sqr-neg61.3%
sqrt-unprod23.1%
add-sqr-sqrt47.9%
sub-neg47.9%
Applied egg-rr47.9%
Taylor expanded in t1 around inf 39.8%
if -2.4000000000000001e72 < t1 < 5.49999999999999996e110Initial program 91.9%
times-frac97.8%
Simplified97.8%
frac-2neg97.8%
remove-double-neg97.8%
associate-*l/98.3%
distribute-neg-in98.3%
add-sqr-sqrt46.0%
sqrt-unprod82.7%
sqr-neg82.7%
sqrt-unprod37.4%
add-sqr-sqrt68.9%
sub-neg68.9%
Applied egg-rr68.9%
associate-*r/68.2%
Simplified68.2%
Taylor expanded in t1 around 0 71.0%
*-commutative71.0%
Simplified71.0%
Taylor expanded in t1 around inf 19.1%
Final simplification26.9%
(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 80.0%
times-frac98.6%
Simplified98.6%
frac-2neg98.6%
clear-num97.7%
frac-times83.1%
remove-double-neg83.1%
*-commutative83.1%
*-un-lft-identity83.1%
distribute-neg-in83.1%
add-sqr-sqrt42.2%
sqrt-unprod70.6%
sqr-neg70.6%
sqrt-unprod31.4%
add-sqr-sqrt59.8%
sub-neg59.8%
Applied egg-rr59.8%
associate-/r*61.9%
Simplified61.9%
Taylor expanded in t1 around inf 26.3%
clear-num26.1%
div-inv26.1%
frac-2neg26.1%
metadata-eval26.1%
distribute-neg-in26.1%
add-sqr-sqrt13.1%
sqrt-unprod37.7%
sqr-neg37.7%
sqrt-unprod27.9%
add-sqr-sqrt61.2%
sub-neg61.2%
Applied egg-rr61.2%
*-commutative61.2%
associate-*l/61.3%
neg-mul-161.3%
Simplified61.3%
Final simplification61.3%
(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 80.0%
times-frac98.6%
Simplified98.6%
Taylor expanded in t1 around inf 61.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(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 80.0%
times-frac98.6%
Simplified98.6%
clear-num98.2%
frac-2neg98.2%
frac-times95.9%
*-un-lft-identity95.9%
add-sqr-sqrt42.4%
sqrt-unprod55.0%
sqr-neg55.0%
sqrt-unprod24.0%
add-sqr-sqrt44.2%
add-sqr-sqrt22.3%
sqrt-unprod45.2%
sqr-neg45.2%
sqrt-unprod45.8%
add-sqr-sqrt95.9%
distribute-neg-in95.9%
add-sqr-sqrt49.8%
sqrt-unprod72.7%
sqr-neg72.7%
sqrt-unprod30.2%
add-sqr-sqrt59.1%
sub-neg59.1%
Applied egg-rr59.1%
Taylor expanded in t1 around inf 16.8%
Final simplification16.8%
herbie shell --seed 2023307
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))