
(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 (/ (/ v (+ u t1)) (- -1.0 (/ u t1))))
double code(double u, double v, double t1) {
return (v / (u + t1)) / (-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 / (u + t1)) / ((-1.0d0) - (u / t1))
end function
public static double code(double u, double v, double t1) {
return (v / (u + t1)) / (-1.0 - (u / t1));
}
def code(u, v, t1): return (v / (u + t1)) / (-1.0 - (u / t1))
function code(u, v, t1) return Float64(Float64(v / Float64(u + t1)) / Float64(-1.0 - Float64(u / t1))) end
function tmp = code(u, v, t1) tmp = (v / (u + t1)) / (-1.0 - (u / t1)); end
code[u_, v_, t1_] := N[(N[(v / N[(u + t1), $MachinePrecision]), $MachinePrecision] / N[(-1.0 - N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{v}{u + t1}}{-1 - \frac{u}{t1}}
\end{array}
Initial program 67.9%
+-commutative67.9%
+-commutative67.9%
*-commutative67.9%
associate-*l/69.9%
distribute-rgt-neg-in69.9%
distribute-lft-neg-in69.9%
distribute-frac-neg69.9%
/-rgt-identity69.9%
metadata-eval69.9%
associate-/r/72.9%
associate-/r*72.9%
times-frac94.9%
metadata-eval94.9%
/-rgt-identity94.9%
+-commutative94.9%
remove-double-neg94.9%
unsub-neg94.9%
div-sub94.9%
sub-neg94.9%
distribute-frac-neg94.9%
remove-double-neg94.9%
*-inverses94.9%
Simplified94.9%
Taylor expanded in v around 0 94.9%
+-commutative94.9%
*-commutative94.9%
mul-1-neg94.9%
distribute-neg-frac94.9%
associate-/r*98.1%
Simplified98.1%
frac-2neg98.1%
distribute-frac-neg98.1%
remove-double-neg98.1%
div-inv98.1%
+-commutative98.1%
distribute-neg-in98.1%
metadata-eval98.1%
Applied egg-rr98.1%
associate-*r/98.1%
*-rgt-identity98.1%
+-commutative98.1%
unsub-neg98.1%
Simplified98.1%
Final simplification98.1%
(FPCore (u v t1) :precision binary64 (if (or (<= u -5e+45) (not (<= u 4.6e+67))) (/ (* t1 (/ (- v) (+ u t1))) u) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -5e+45) || !(u <= 4.6e+67)) {
tmp = (t1 * (-v / (u + t1))) / 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+45)) .or. (.not. (u <= 4.6d+67))) then
tmp = (t1 * (-v / (u + t1))) / 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+45) || !(u <= 4.6e+67)) {
tmp = (t1 * (-v / (u + t1))) / u;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -5e+45) or not (u <= 4.6e+67): tmp = (t1 * (-v / (u + t1))) / u else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -5e+45) || !(u <= 4.6e+67)) tmp = Float64(Float64(t1 * Float64(Float64(-v) / Float64(u + t1))) / u); else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -5e+45) || ~((u <= 4.6e+67))) tmp = (t1 * (-v / (u + t1))) / u; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -5e+45], N[Not[LessEqual[u, 4.6e+67]], $MachinePrecision]], N[(N[(t1 * N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -5 \cdot 10^{+45} \lor \neg \left(u \leq 4.6 \cdot 10^{+67}\right):\\
\;\;\;\;\frac{t1 \cdot \frac{-v}{u + t1}}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -5e45 or 4.5999999999999997e67 < u Initial program 74.5%
+-commutative74.5%
+-commutative74.5%
times-frac97.2%
+-commutative97.2%
+-commutative97.2%
Simplified97.2%
Taylor expanded in t1 around 0 85.9%
mul-1-neg85.9%
Simplified85.9%
distribute-neg-frac85.9%
associate-*l/88.4%
Applied egg-rr88.4%
if -5e45 < u < 4.5999999999999997e67Initial program 63.3%
+-commutative63.3%
+-commutative63.3%
*-commutative63.3%
associate-*l/65.8%
distribute-rgt-neg-in65.8%
distribute-lft-neg-in65.8%
distribute-frac-neg65.8%
/-rgt-identity65.8%
metadata-eval65.8%
associate-/r/72.8%
associate-/r*72.8%
times-frac99.9%
metadata-eval99.9%
/-rgt-identity99.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 t1 around inf 80.8%
Final simplification83.9%
(FPCore (u v t1) :precision binary64 (if (<= u -1.25e+119) (/ (* t1 (/ (- v) u)) u) (if (<= u 4.8e+67) (/ (- v) t1) (* (/ t1 u) (/ (- v) (+ u t1))))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -1.25e+119) {
tmp = (t1 * (-v / u)) / u;
} else if (u <= 4.8e+67) {
tmp = -v / t1;
} else {
tmp = (t1 / u) * (-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.25d+119)) then
tmp = (t1 * (-v / u)) / u
else if (u <= 4.8d+67) then
tmp = -v / t1
else
tmp = (t1 / u) * (-v / (u + t1))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -1.25e+119) {
tmp = (t1 * (-v / u)) / u;
} else if (u <= 4.8e+67) {
tmp = -v / t1;
} else {
tmp = (t1 / u) * (-v / (u + t1));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -1.25e+119: tmp = (t1 * (-v / u)) / u elif u <= 4.8e+67: tmp = -v / t1 else: tmp = (t1 / u) * (-v / (u + t1)) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -1.25e+119) tmp = Float64(Float64(t1 * Float64(Float64(-v) / u)) / u); elseif (u <= 4.8e+67) tmp = Float64(Float64(-v) / t1); else tmp = Float64(Float64(t1 / u) * Float64(Float64(-v) / Float64(u + t1))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -1.25e+119) tmp = (t1 * (-v / u)) / u; elseif (u <= 4.8e+67) tmp = -v / t1; else tmp = (t1 / u) * (-v / (u + t1)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -1.25e+119], N[(N[(t1 * N[((-v) / u), $MachinePrecision]), $MachinePrecision] / u), $MachinePrecision], If[LessEqual[u, 4.8e+67], N[((-v) / t1), $MachinePrecision], N[(N[(t1 / u), $MachinePrecision] * N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.25 \cdot 10^{+119}:\\
\;\;\;\;\frac{t1 \cdot \frac{-v}{u}}{u}\\
\mathbf{elif}\;u \leq 4.8 \cdot 10^{+67}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t1}{u} \cdot \frac{-v}{u + t1}\\
\end{array}
\end{array}
if u < -1.25e119Initial program 72.0%
+-commutative72.0%
+-commutative72.0%
times-frac95.0%
+-commutative95.0%
+-commutative95.0%
Simplified95.0%
Taylor expanded in t1 around 0 92.0%
mul-1-neg92.0%
Simplified92.0%
distribute-neg-frac92.0%
associate-*l/96.8%
Applied egg-rr96.8%
Taylor expanded in t1 around 0 97.0%
if -1.25e119 < u < 4.80000000000000004e67Initial program 63.6%
+-commutative63.6%
+-commutative63.6%
*-commutative63.6%
associate-*l/65.4%
distribute-rgt-neg-in65.4%
distribute-lft-neg-in65.4%
distribute-frac-neg65.4%
/-rgt-identity65.4%
metadata-eval65.4%
associate-/r/72.4%
associate-/r*72.4%
times-frac99.9%
metadata-eval99.9%
/-rgt-identity99.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 t1 around inf 78.7%
if 4.80000000000000004e67 < u Initial program 77.7%
+-commutative77.7%
+-commutative77.7%
times-frac98.1%
+-commutative98.1%
+-commutative98.1%
Simplified98.1%
Taylor expanded in t1 around 0 86.5%
mul-1-neg86.5%
Simplified86.5%
Final simplification83.0%
(FPCore (u v t1) :precision binary64 (if (<= u -2.1e+47) (/ t1 (* (/ u v) (- (- t1) u))) (if (<= u 4.6e+67) (/ (- v) t1) (* (/ t1 u) (/ (- v) (+ u t1))))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -2.1e+47) {
tmp = t1 / ((u / v) * (-t1 - u));
} else if (u <= 4.6e+67) {
tmp = -v / t1;
} else {
tmp = (t1 / u) * (-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 <= (-2.1d+47)) then
tmp = t1 / ((u / v) * (-t1 - u))
else if (u <= 4.6d+67) then
tmp = -v / t1
else
tmp = (t1 / u) * (-v / (u + t1))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -2.1e+47) {
tmp = t1 / ((u / v) * (-t1 - u));
} else if (u <= 4.6e+67) {
tmp = -v / t1;
} else {
tmp = (t1 / u) * (-v / (u + t1));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -2.1e+47: tmp = t1 / ((u / v) * (-t1 - u)) elif u <= 4.6e+67: tmp = -v / t1 else: tmp = (t1 / u) * (-v / (u + t1)) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -2.1e+47) tmp = Float64(t1 / Float64(Float64(u / v) * Float64(Float64(-t1) - u))); elseif (u <= 4.6e+67) tmp = Float64(Float64(-v) / t1); else tmp = Float64(Float64(t1 / u) * Float64(Float64(-v) / Float64(u + t1))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -2.1e+47) tmp = t1 / ((u / v) * (-t1 - u)); elseif (u <= 4.6e+67) tmp = -v / t1; else tmp = (t1 / u) * (-v / (u + t1)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -2.1e+47], N[(t1 / N[(N[(u / v), $MachinePrecision] * N[((-t1) - u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 4.6e+67], N[((-v) / t1), $MachinePrecision], N[(N[(t1 / u), $MachinePrecision] * N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.1 \cdot 10^{+47}:\\
\;\;\;\;\frac{t1}{\frac{u}{v} \cdot \left(\left(-t1\right) - u\right)}\\
\mathbf{elif}\;u \leq 4.6 \cdot 10^{+67}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t1}{u} \cdot \frac{-v}{u + t1}\\
\end{array}
\end{array}
if u < -2.1e47Initial program 70.9%
+-commutative70.9%
+-commutative70.9%
times-frac96.2%
distribute-frac-neg96.2%
distribute-lft-neg-in96.2%
distribute-rgt-neg-in96.2%
distribute-frac-neg96.2%
associate-/r/92.1%
associate-/r/92.0%
*-commutative92.0%
+-commutative92.0%
+-commutative92.0%
Simplified92.0%
Taylor expanded in t1 around 0 87.2%
mul-1-neg87.2%
Simplified87.2%
if -2.1e47 < u < 4.5999999999999997e67Initial program 63.3%
+-commutative63.3%
+-commutative63.3%
*-commutative63.3%
associate-*l/65.8%
distribute-rgt-neg-in65.8%
distribute-lft-neg-in65.8%
distribute-frac-neg65.8%
/-rgt-identity65.8%
metadata-eval65.8%
associate-/r/72.8%
associate-/r*72.8%
times-frac99.9%
metadata-eval99.9%
/-rgt-identity99.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 t1 around inf 80.8%
if 4.5999999999999997e67 < u Initial program 77.7%
+-commutative77.7%
+-commutative77.7%
times-frac98.1%
+-commutative98.1%
+-commutative98.1%
Simplified98.1%
Taylor expanded in t1 around 0 86.5%
mul-1-neg86.5%
Simplified86.5%
Final simplification83.3%
(FPCore (u v t1) :precision binary64 (if (<= u -1e+128) (/ (* t1 (/ (- v) u)) u) (/ v (* (+ u t1) (- -1.0 (/ u t1))))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -1e+128) {
tmp = (t1 * (-v / u)) / u;
} else {
tmp = v / ((u + t1) * (-1.0 - (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 <= (-1d+128)) then
tmp = (t1 * (-v / u)) / u
else
tmp = v / ((u + t1) * ((-1.0d0) - (u / t1)))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -1e+128) {
tmp = (t1 * (-v / u)) / u;
} else {
tmp = v / ((u + t1) * (-1.0 - (u / t1)));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -1e+128: tmp = (t1 * (-v / u)) / u else: tmp = v / ((u + t1) * (-1.0 - (u / t1))) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -1e+128) tmp = Float64(Float64(t1 * Float64(Float64(-v) / u)) / u); else tmp = Float64(v / Float64(Float64(u + t1) * Float64(-1.0 - Float64(u / t1)))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -1e+128) tmp = (t1 * (-v / u)) / u; else tmp = v / ((u + t1) * (-1.0 - (u / t1))); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -1e+128], N[(N[(t1 * N[((-v) / u), $MachinePrecision]), $MachinePrecision] / u), $MachinePrecision], N[(v / N[(N[(u + t1), $MachinePrecision] * N[(-1.0 - N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1 \cdot 10^{+128}:\\
\;\;\;\;\frac{t1 \cdot \frac{-v}{u}}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{\left(u + t1\right) \cdot \left(-1 - \frac{u}{t1}\right)}\\
\end{array}
\end{array}
if u < -1.0000000000000001e128Initial program 71.2%
+-commutative71.2%
+-commutative71.2%
times-frac94.9%
+-commutative94.9%
+-commutative94.9%
Simplified94.9%
Taylor expanded in t1 around 0 91.8%
mul-1-neg91.8%
Simplified91.8%
distribute-neg-frac91.8%
associate-*l/96.7%
Applied egg-rr96.7%
Taylor expanded in t1 around 0 96.9%
if -1.0000000000000001e128 < u Initial program 67.3%
+-commutative67.3%
+-commutative67.3%
*-commutative67.3%
associate-*l/69.1%
distribute-rgt-neg-in69.1%
distribute-lft-neg-in69.1%
distribute-frac-neg69.1%
/-rgt-identity69.1%
metadata-eval69.1%
associate-/r/73.0%
associate-/r*73.0%
times-frac96.4%
metadata-eval96.4%
/-rgt-identity96.4%
+-commutative96.4%
remove-double-neg96.4%
unsub-neg96.4%
div-sub96.5%
sub-neg96.5%
distribute-frac-neg96.5%
remove-double-neg96.5%
*-inverses96.5%
Simplified96.5%
Taylor expanded in v around 0 96.5%
+-commutative96.5%
*-commutative96.5%
mul-1-neg96.5%
distribute-neg-frac96.5%
associate-/r*98.6%
Simplified98.6%
frac-2neg98.6%
distribute-frac-neg98.6%
remove-double-neg98.6%
div-inv98.6%
+-commutative98.6%
distribute-neg-in98.6%
metadata-eval98.6%
Applied egg-rr98.6%
associate-*r/98.6%
*-rgt-identity98.6%
associate-/l/96.5%
unsub-neg96.5%
+-commutative96.5%
Simplified96.5%
Final simplification96.5%
(FPCore (u v t1) :precision binary64 (if (or (<= u -3.8e+118) (not (<= u 6e+67))) (* (/ v u) (/ (- t1) u)) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -3.8e+118) || !(u <= 6e+67)) {
tmp = (v / u) * (-t1 / 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 <= (-3.8d+118)) .or. (.not. (u <= 6d+67))) then
tmp = (v / u) * (-t1 / 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 <= -3.8e+118) || !(u <= 6e+67)) {
tmp = (v / u) * (-t1 / u);
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -3.8e+118) or not (u <= 6e+67): tmp = (v / u) * (-t1 / u) else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -3.8e+118) || !(u <= 6e+67)) tmp = Float64(Float64(v / u) * Float64(Float64(-t1) / u)); else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -3.8e+118) || ~((u <= 6e+67))) tmp = (v / u) * (-t1 / u); else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -3.8e+118], N[Not[LessEqual[u, 6e+67]], $MachinePrecision]], N[(N[(v / u), $MachinePrecision] * N[((-t1) / u), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -3.8 \cdot 10^{+118} \lor \neg \left(u \leq 6 \cdot 10^{+67}\right):\\
\;\;\;\;\frac{v}{u} \cdot \frac{-t1}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -3.80000000000000016e118 or 6.0000000000000002e67 < u Initial program 75.4%
+-commutative75.4%
+-commutative75.4%
times-frac96.8%
+-commutative96.8%
+-commutative96.8%
Simplified96.8%
Taylor expanded in t1 around 0 88.7%
mul-1-neg88.7%
Simplified88.7%
Taylor expanded in t1 around 0 87.8%
if -3.80000000000000016e118 < u < 6.0000000000000002e67Initial program 63.6%
+-commutative63.6%
+-commutative63.6%
*-commutative63.6%
associate-*l/65.4%
distribute-rgt-neg-in65.4%
distribute-lft-neg-in65.4%
distribute-frac-neg65.4%
/-rgt-identity65.4%
metadata-eval65.4%
associate-/r/72.4%
associate-/r*72.4%
times-frac99.9%
metadata-eval99.9%
/-rgt-identity99.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 t1 around inf 78.7%
Final simplification82.0%
(FPCore (u v t1) :precision binary64 (if (or (<= u -3.8e+118) (not (<= u 6e+67))) (/ (* t1 (/ (- v) u)) u) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -3.8e+118) || !(u <= 6e+67)) {
tmp = (t1 * (-v / u)) / 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 <= (-3.8d+118)) .or. (.not. (u <= 6d+67))) then
tmp = (t1 * (-v / u)) / 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 <= -3.8e+118) || !(u <= 6e+67)) {
tmp = (t1 * (-v / u)) / u;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -3.8e+118) or not (u <= 6e+67): tmp = (t1 * (-v / u)) / u else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -3.8e+118) || !(u <= 6e+67)) tmp = Float64(Float64(t1 * Float64(Float64(-v) / u)) / u); else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -3.8e+118) || ~((u <= 6e+67))) tmp = (t1 * (-v / u)) / u; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -3.8e+118], N[Not[LessEqual[u, 6e+67]], $MachinePrecision]], N[(N[(t1 * N[((-v) / u), $MachinePrecision]), $MachinePrecision] / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -3.8 \cdot 10^{+118} \lor \neg \left(u \leq 6 \cdot 10^{+67}\right):\\
\;\;\;\;\frac{t1 \cdot \frac{-v}{u}}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -3.80000000000000016e118 or 6.0000000000000002e67 < u Initial program 75.4%
+-commutative75.4%
+-commutative75.4%
times-frac96.8%
+-commutative96.8%
+-commutative96.8%
Simplified96.8%
Taylor expanded in t1 around 0 88.7%
mul-1-neg88.7%
Simplified88.7%
distribute-neg-frac88.7%
associate-*l/91.6%
Applied egg-rr91.6%
Taylor expanded in t1 around 0 90.6%
if -3.80000000000000016e118 < u < 6.0000000000000002e67Initial program 63.6%
+-commutative63.6%
+-commutative63.6%
*-commutative63.6%
associate-*l/65.4%
distribute-rgt-neg-in65.4%
distribute-lft-neg-in65.4%
distribute-frac-neg65.4%
/-rgt-identity65.4%
metadata-eval65.4%
associate-/r/72.4%
associate-/r*72.4%
times-frac99.9%
metadata-eval99.9%
/-rgt-identity99.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 t1 around inf 78.7%
Final simplification83.0%
(FPCore (u v t1) :precision binary64 (if (or (<= u -6.9e+126) (not (<= u 3.8e+74))) (* (/ v u) (/ t1 u)) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -6.9e+126) || !(u <= 3.8e+74)) {
tmp = (v / u) * (t1 / 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 <= (-6.9d+126)) .or. (.not. (u <= 3.8d+74))) then
tmp = (v / u) * (t1 / 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 <= -6.9e+126) || !(u <= 3.8e+74)) {
tmp = (v / u) * (t1 / u);
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -6.9e+126) or not (u <= 3.8e+74): tmp = (v / u) * (t1 / u) else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -6.9e+126) || !(u <= 3.8e+74)) tmp = Float64(Float64(v / u) * Float64(t1 / u)); else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -6.9e+126) || ~((u <= 3.8e+74))) tmp = (v / u) * (t1 / u); else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -6.9e+126], N[Not[LessEqual[u, 3.8e+74]], $MachinePrecision]], N[(N[(v / u), $MachinePrecision] * N[(t1 / u), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -6.9 \cdot 10^{+126} \lor \neg \left(u \leq 3.8 \cdot 10^{+74}\right):\\
\;\;\;\;\frac{v}{u} \cdot \frac{t1}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -6.8999999999999996e126 or 3.7999999999999998e74 < u Initial program 75.1%
+-commutative75.1%
+-commutative75.1%
times-frac96.7%
+-commutative96.7%
+-commutative96.7%
Simplified96.7%
Taylor expanded in t1 around 0 89.3%
mul-1-neg89.3%
Simplified89.3%
distribute-neg-frac89.3%
associate-*l/92.3%
Applied egg-rr92.3%
Taylor expanded in t1 around 0 83.8%
*-commutative83.8%
associate-*r/83.8%
associate-*r*83.8%
mul-1-neg83.8%
Simplified83.8%
associate-/l/72.9%
times-frac88.3%
add-sqr-sqrt42.9%
sqrt-unprod65.8%
sqr-neg65.8%
sqrt-unprod35.8%
add-sqr-sqrt65.4%
Applied egg-rr65.4%
if -6.8999999999999996e126 < u < 3.7999999999999998e74Initial program 64.1%
+-commutative64.1%
+-commutative64.1%
*-commutative64.1%
associate-*l/65.8%
distribute-rgt-neg-in65.8%
distribute-lft-neg-in65.8%
distribute-frac-neg65.8%
/-rgt-identity65.8%
metadata-eval65.8%
associate-/r/72.6%
associate-/r*72.6%
times-frac99.9%
metadata-eval99.9%
/-rgt-identity99.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 t1 around inf 77.5%
Final simplification73.4%
(FPCore (u v t1) :precision binary64 (if (or (<= u -8.2e+131) (not (<= u 1.65e+136))) (/ v u) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -8.2e+131) || !(u <= 1.65e+136)) {
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.2d+131)) .or. (.not. (u <= 1.65d+136))) 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.2e+131) || !(u <= 1.65e+136)) {
tmp = v / u;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -8.2e+131) or not (u <= 1.65e+136): tmp = v / u else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -8.2e+131) || !(u <= 1.65e+136)) 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 <= -8.2e+131) || ~((u <= 1.65e+136))) tmp = v / u; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -8.2e+131], N[Not[LessEqual[u, 1.65e+136]], $MachinePrecision]], N[(v / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -8.2 \cdot 10^{+131} \lor \neg \left(u \leq 1.65 \cdot 10^{+136}\right):\\
\;\;\;\;\frac{v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -8.20000000000000015e131 or 1.64999999999999996e136 < u Initial program 74.0%
+-commutative74.0%
+-commutative74.0%
times-frac98.5%
+-commutative98.5%
+-commutative98.5%
Simplified98.5%
Taylor expanded in t1 around 0 94.8%
mul-1-neg94.8%
Simplified94.8%
distribute-neg-frac94.8%
associate-*l/96.0%
Applied egg-rr96.0%
frac-2neg96.0%
associate-*r/87.9%
add-sqr-sqrt45.7%
sqrt-unprod72.3%
sqr-neg72.3%
sqrt-unprod39.4%
add-sqr-sqrt72.5%
*-commutative72.5%
add-sqr-sqrt48.8%
sqrt-unprod76.3%
sqr-neg76.3%
sqrt-unprod31.9%
add-sqr-sqrt87.9%
distribute-neg-in87.9%
add-sqr-sqrt55.9%
sqrt-unprod87.2%
sqr-neg87.2%
sqrt-unprod32.0%
add-sqr-sqrt87.9%
sub-neg87.9%
Applied egg-rr87.9%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in t1 around inf 39.7%
if -8.20000000000000015e131 < u < 1.64999999999999996e136Initial program 65.6%
+-commutative65.6%
+-commutative65.6%
*-commutative65.6%
associate-*l/67.7%
distribute-rgt-neg-in67.7%
distribute-lft-neg-in67.7%
distribute-frac-neg67.7%
/-rgt-identity67.7%
metadata-eval67.7%
associate-/r/71.8%
associate-/r*71.8%
times-frac97.9%
metadata-eval97.9%
/-rgt-identity97.9%
+-commutative97.9%
remove-double-neg97.9%
unsub-neg97.9%
div-sub97.9%
sub-neg97.9%
distribute-frac-neg97.9%
remove-double-neg97.9%
*-inverses97.9%
Simplified97.9%
Taylor expanded in t1 around inf 73.0%
Final simplification64.1%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -6e+163) (not (<= t1 1.5e+119))) (/ v t1) (/ v u)))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -6e+163) || !(t1 <= 1.5e+119)) {
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 <= (-6d+163)) .or. (.not. (t1 <= 1.5d+119))) 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 <= -6e+163) || !(t1 <= 1.5e+119)) {
tmp = v / t1;
} else {
tmp = v / u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -6e+163) or not (t1 <= 1.5e+119): tmp = v / t1 else: tmp = v / u return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -6e+163) || !(t1 <= 1.5e+119)) 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 <= -6e+163) || ~((t1 <= 1.5e+119))) tmp = v / t1; else tmp = v / u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -6e+163], N[Not[LessEqual[t1, 1.5e+119]], $MachinePrecision]], N[(v / t1), $MachinePrecision], N[(v / u), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -6 \cdot 10^{+163} \lor \neg \left(t1 \leq 1.5 \cdot 10^{+119}\right):\\
\;\;\;\;\frac{v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u}\\
\end{array}
\end{array}
if t1 < -6.00000000000000027e163 or 1.50000000000000001e119 < t1 Initial program 42.3%
+-commutative42.3%
+-commutative42.3%
times-frac100.0%
+-commutative100.0%
+-commutative100.0%
Simplified100.0%
clear-num100.0%
frac-2neg100.0%
frac-times98.7%
*-un-lft-identity98.7%
add-sqr-sqrt49.0%
sqrt-unprod49.9%
sqr-neg49.9%
sqrt-unprod19.3%
add-sqr-sqrt37.6%
add-sqr-sqrt21.5%
sqrt-unprod9.9%
sqr-neg9.9%
sqrt-unprod47.8%
add-sqr-sqrt98.7%
distribute-neg-in98.7%
add-sqr-sqrt50.5%
sqrt-unprod38.5%
sqr-neg38.5%
sqrt-unprod17.1%
add-sqr-sqrt38.7%
sub-neg38.7%
Applied egg-rr38.7%
Taylor expanded in t1 around inf 34.9%
if -6.00000000000000027e163 < t1 < 1.50000000000000001e119Initial program 78.0%
+-commutative78.0%
+-commutative78.0%
times-frac97.3%
+-commutative97.3%
+-commutative97.3%
Simplified97.3%
Taylor expanded in t1 around 0 63.4%
mul-1-neg63.4%
Simplified63.4%
distribute-neg-frac63.4%
associate-*l/63.6%
Applied egg-rr63.6%
frac-2neg63.6%
associate-*r/59.6%
add-sqr-sqrt28.2%
sqrt-unprod42.0%
sqr-neg42.0%
sqrt-unprod20.3%
add-sqr-sqrt37.3%
*-commutative37.3%
add-sqr-sqrt23.1%
sqrt-unprod43.8%
sqr-neg43.8%
sqrt-unprod23.0%
add-sqr-sqrt59.6%
distribute-neg-in59.6%
add-sqr-sqrt36.5%
sqrt-unprod59.4%
sqr-neg59.4%
sqrt-unprod23.1%
add-sqr-sqrt59.4%
sub-neg59.4%
Applied egg-rr59.4%
associate-/l*62.5%
Simplified62.5%
Taylor expanded in t1 around inf 18.6%
Final simplification23.2%
(FPCore (u v t1) :precision binary64 (/ (- v) (+ u t1)))
double code(double u, double v, double t1) {
return -v / (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 / (u + t1)
end function
public static double code(double u, double v, double t1) {
return -v / (u + t1);
}
def code(u, v, t1): return -v / (u + t1)
function code(u, v, t1) return Float64(Float64(-v) / Float64(u + t1)) end
function tmp = code(u, v, t1) tmp = -v / (u + t1); end
code[u_, v_, t1_] := N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-v}{u + t1}
\end{array}
Initial program 67.9%
+-commutative67.9%
+-commutative67.9%
times-frac98.1%
distribute-frac-neg98.1%
distribute-lft-neg-in98.1%
distribute-rgt-neg-in98.1%
distribute-frac-neg98.1%
associate-/r/85.4%
associate-/r/85.4%
*-commutative85.4%
+-commutative85.4%
+-commutative85.4%
Simplified85.4%
Taylor expanded in t1 around inf 54.7%
mul-1-neg54.7%
Simplified54.7%
Taylor expanded in v around 0 64.3%
+-commutative64.3%
associate-*r/64.3%
mul-1-neg64.3%
Simplified64.3%
Final simplification64.3%
(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 67.9%
+-commutative67.9%
+-commutative67.9%
times-frac98.1%
+-commutative98.1%
+-commutative98.1%
Simplified98.1%
clear-num98.0%
frac-2neg98.0%
frac-times94.9%
*-un-lft-identity94.9%
add-sqr-sqrt43.8%
sqrt-unprod48.2%
sqr-neg48.2%
sqrt-unprod19.7%
add-sqr-sqrt37.3%
add-sqr-sqrt23.2%
sqrt-unprod44.0%
sqr-neg44.0%
sqrt-unprod40.9%
add-sqr-sqrt94.9%
distribute-neg-in94.9%
add-sqr-sqrt53.6%
sqrt-unprod64.1%
sqr-neg64.1%
sqrt-unprod21.3%
add-sqr-sqrt52.9%
sub-neg52.9%
Applied egg-rr52.9%
Taylor expanded in t1 around inf 12.6%
Final simplification12.6%
herbie shell --seed 2023305
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))