
(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 14 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 79.1%
times-frac96.6%
Simplified96.6%
Final simplification96.6%
(FPCore (u v t1) :precision binary64 (if (<= u -6e-92) (* (/ t1 u) (/ (- v) u)) (if (<= u 8.2e-69) (- (/ v t1)) (/ t1 (* u (/ (- t1 u) v))))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -6e-92) {
tmp = (t1 / u) * (-v / u);
} else if (u <= 8.2e-69) {
tmp = -(v / t1);
} else {
tmp = t1 / (u * ((t1 - u) / v));
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if (u <= (-6d-92)) then
tmp = (t1 / u) * (-v / u)
else if (u <= 8.2d-69) then
tmp = -(v / t1)
else
tmp = t1 / (u * ((t1 - u) / v))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -6e-92) {
tmp = (t1 / u) * (-v / u);
} else if (u <= 8.2e-69) {
tmp = -(v / t1);
} else {
tmp = t1 / (u * ((t1 - u) / v));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -6e-92: tmp = (t1 / u) * (-v / u) elif u <= 8.2e-69: tmp = -(v / t1) else: tmp = t1 / (u * ((t1 - u) / v)) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -6e-92) tmp = Float64(Float64(t1 / u) * Float64(Float64(-v) / u)); elseif (u <= 8.2e-69) tmp = Float64(-Float64(v / t1)); else tmp = Float64(t1 / Float64(u * Float64(Float64(t1 - u) / v))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -6e-92) tmp = (t1 / u) * (-v / u); elseif (u <= 8.2e-69) tmp = -(v / t1); else tmp = t1 / (u * ((t1 - u) / v)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -6e-92], N[(N[(t1 / u), $MachinePrecision] * N[((-v) / u), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 8.2e-69], (-N[(v / t1), $MachinePrecision]), N[(t1 / N[(u * N[(N[(t1 - u), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -6 \cdot 10^{-92}:\\
\;\;\;\;\frac{t1}{u} \cdot \frac{-v}{u}\\
\mathbf{elif}\;u \leq 8.2 \cdot 10^{-69}:\\
\;\;\;\;-\frac{v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t1}{u \cdot \frac{t1 - u}{v}}\\
\end{array}
\end{array}
if u < -6.00000000000000027e-92Initial program 86.7%
times-frac94.4%
Simplified94.4%
Taylor expanded in t1 around 0 78.6%
associate-*r/78.6%
mul-1-neg78.6%
Simplified78.6%
Taylor expanded in t1 around 0 77.8%
if -6.00000000000000027e-92 < u < 8.1999999999999998e-69Initial program 68.8%
times-frac99.9%
Simplified99.9%
Taylor expanded in t1 around inf 90.5%
associate-*r/90.5%
neg-mul-190.5%
Simplified90.5%
if 8.1999999999999998e-69 < u Initial program 84.0%
times-frac94.5%
Simplified94.5%
Taylor expanded in t1 around 0 78.2%
associate-*r/78.2%
mul-1-neg78.2%
Simplified78.2%
*-commutative78.2%
clear-num78.2%
frac-times79.6%
*-un-lft-identity79.6%
add-sqr-sqrt35.4%
sqrt-unprod48.1%
sqr-neg48.1%
sqrt-unprod25.3%
add-sqr-sqrt48.0%
frac-2neg48.0%
add-sqr-sqrt22.3%
sqrt-unprod54.1%
sqr-neg54.1%
sqrt-unprod40.5%
add-sqr-sqrt79.6%
distribute-neg-in79.6%
add-sqr-sqrt35.5%
sqrt-unprod79.6%
sqr-neg79.6%
sqrt-unprod43.8%
add-sqr-sqrt79.6%
sub-neg79.6%
Applied egg-rr79.6%
Final simplification83.2%
(FPCore (u v t1) :precision binary64 (if (<= u -5.8e-92) (/ (/ v (- 1.0 (/ u t1))) u) (if (<= u 9.5e-71) (- (/ v t1)) (/ t1 (* u (/ (- t1 u) v))))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -5.8e-92) {
tmp = (v / (1.0 - (u / t1))) / u;
} else if (u <= 9.5e-71) {
tmp = -(v / t1);
} else {
tmp = t1 / (u * ((t1 - u) / v));
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if (u <= (-5.8d-92)) then
tmp = (v / (1.0d0 - (u / t1))) / u
else if (u <= 9.5d-71) then
tmp = -(v / t1)
else
tmp = t1 / (u * ((t1 - u) / v))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -5.8e-92) {
tmp = (v / (1.0 - (u / t1))) / u;
} else if (u <= 9.5e-71) {
tmp = -(v / t1);
} else {
tmp = t1 / (u * ((t1 - u) / v));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -5.8e-92: tmp = (v / (1.0 - (u / t1))) / u elif u <= 9.5e-71: tmp = -(v / t1) else: tmp = t1 / (u * ((t1 - u) / v)) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -5.8e-92) tmp = Float64(Float64(v / Float64(1.0 - Float64(u / t1))) / u); elseif (u <= 9.5e-71) tmp = Float64(-Float64(v / t1)); else tmp = Float64(t1 / Float64(u * Float64(Float64(t1 - u) / v))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -5.8e-92) tmp = (v / (1.0 - (u / t1))) / u; elseif (u <= 9.5e-71) tmp = -(v / t1); else tmp = t1 / (u * ((t1 - u) / v)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -5.8e-92], N[(N[(v / N[(1.0 - N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / u), $MachinePrecision], If[LessEqual[u, 9.5e-71], (-N[(v / t1), $MachinePrecision]), N[(t1 / N[(u * N[(N[(t1 - u), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -5.8 \cdot 10^{-92}:\\
\;\;\;\;\frac{\frac{v}{1 - \frac{u}{t1}}}{u}\\
\mathbf{elif}\;u \leq 9.5 \cdot 10^{-71}:\\
\;\;\;\;-\frac{v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t1}{u \cdot \frac{t1 - u}{v}}\\
\end{array}
\end{array}
if u < -5.79999999999999969e-92Initial program 86.7%
times-frac94.4%
Simplified94.4%
Taylor expanded in t1 around 0 78.6%
associate-*r/78.6%
mul-1-neg78.6%
Simplified78.6%
associate-*l/80.9%
Applied egg-rr77.8%
if -5.79999999999999969e-92 < u < 9.4999999999999994e-71Initial program 68.8%
times-frac99.9%
Simplified99.9%
Taylor expanded in t1 around inf 90.5%
associate-*r/90.5%
neg-mul-190.5%
Simplified90.5%
if 9.4999999999999994e-71 < u Initial program 84.0%
times-frac94.5%
Simplified94.5%
Taylor expanded in t1 around 0 78.2%
associate-*r/78.2%
mul-1-neg78.2%
Simplified78.2%
*-commutative78.2%
clear-num78.2%
frac-times79.6%
*-un-lft-identity79.6%
add-sqr-sqrt35.4%
sqrt-unprod48.1%
sqr-neg48.1%
sqrt-unprod25.3%
add-sqr-sqrt48.0%
frac-2neg48.0%
add-sqr-sqrt22.3%
sqrt-unprod54.1%
sqr-neg54.1%
sqrt-unprod40.5%
add-sqr-sqrt79.6%
distribute-neg-in79.6%
add-sqr-sqrt35.5%
sqrt-unprod79.6%
sqr-neg79.6%
sqrt-unprod43.8%
add-sqr-sqrt79.6%
sub-neg79.6%
Applied egg-rr79.6%
Final simplification83.2%
(FPCore (u v t1) :precision binary64 (if (<= u -5.5e-124) (* (/ v (+ t1 u)) (/ (- t1) u)) (if (<= u 1.25e-70) (- (/ v t1)) (/ t1 (* u (/ (- t1 u) v))))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -5.5e-124) {
tmp = (v / (t1 + u)) * (-t1 / u);
} else if (u <= 1.25e-70) {
tmp = -(v / t1);
} else {
tmp = t1 / (u * ((t1 - u) / v));
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if (u <= (-5.5d-124)) then
tmp = (v / (t1 + u)) * (-t1 / u)
else if (u <= 1.25d-70) then
tmp = -(v / t1)
else
tmp = t1 / (u * ((t1 - u) / v))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -5.5e-124) {
tmp = (v / (t1 + u)) * (-t1 / u);
} else if (u <= 1.25e-70) {
tmp = -(v / t1);
} else {
tmp = t1 / (u * ((t1 - u) / v));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -5.5e-124: tmp = (v / (t1 + u)) * (-t1 / u) elif u <= 1.25e-70: tmp = -(v / t1) else: tmp = t1 / (u * ((t1 - u) / v)) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -5.5e-124) tmp = Float64(Float64(v / Float64(t1 + u)) * Float64(Float64(-t1) / u)); elseif (u <= 1.25e-70) tmp = Float64(-Float64(v / t1)); else tmp = Float64(t1 / Float64(u * Float64(Float64(t1 - u) / v))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -5.5e-124) tmp = (v / (t1 + u)) * (-t1 / u); elseif (u <= 1.25e-70) tmp = -(v / t1); else tmp = t1 / (u * ((t1 - u) / v)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -5.5e-124], N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[((-t1) / u), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 1.25e-70], (-N[(v / t1), $MachinePrecision]), N[(t1 / N[(u * N[(N[(t1 - u), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -5.5 \cdot 10^{-124}:\\
\;\;\;\;\frac{v}{t1 + u} \cdot \frac{-t1}{u}\\
\mathbf{elif}\;u \leq 1.25 \cdot 10^{-70}:\\
\;\;\;\;-\frac{v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t1}{u \cdot \frac{t1 - u}{v}}\\
\end{array}
\end{array}
if u < -5.50000000000000016e-124Initial program 87.0%
times-frac94.6%
Simplified94.6%
Taylor expanded in t1 around 0 78.0%
associate-*r/78.0%
mul-1-neg78.0%
Simplified78.0%
if -5.50000000000000016e-124 < u < 1.25e-70Initial program 68.2%
times-frac99.9%
Simplified99.9%
Taylor expanded in t1 around inf 91.3%
associate-*r/91.3%
neg-mul-191.3%
Simplified91.3%
if 1.25e-70 < u Initial program 84.0%
times-frac94.5%
Simplified94.5%
Taylor expanded in t1 around 0 78.2%
associate-*r/78.2%
mul-1-neg78.2%
Simplified78.2%
*-commutative78.2%
clear-num78.2%
frac-times79.6%
*-un-lft-identity79.6%
add-sqr-sqrt35.4%
sqrt-unprod48.1%
sqr-neg48.1%
sqrt-unprod25.3%
add-sqr-sqrt48.0%
frac-2neg48.0%
add-sqr-sqrt22.3%
sqrt-unprod54.1%
sqr-neg54.1%
sqrt-unprod40.5%
add-sqr-sqrt79.6%
distribute-neg-in79.6%
add-sqr-sqrt35.5%
sqrt-unprod79.6%
sqr-neg79.6%
sqrt-unprod43.8%
add-sqr-sqrt79.6%
sub-neg79.6%
Applied egg-rr79.6%
Final simplification83.5%
(FPCore (u v t1) :precision binary64 (if (<= u -5.5e-124) (/ (* v (/ (- t1) u)) (+ t1 u)) (if (<= u 8.5e-69) (- (/ v t1)) (/ t1 (* u (/ (- t1 u) v))))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -5.5e-124) {
tmp = (v * (-t1 / u)) / (t1 + u);
} else if (u <= 8.5e-69) {
tmp = -(v / t1);
} else {
tmp = t1 / (u * ((t1 - u) / v));
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if (u <= (-5.5d-124)) then
tmp = (v * (-t1 / u)) / (t1 + u)
else if (u <= 8.5d-69) then
tmp = -(v / t1)
else
tmp = t1 / (u * ((t1 - u) / v))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -5.5e-124) {
tmp = (v * (-t1 / u)) / (t1 + u);
} else if (u <= 8.5e-69) {
tmp = -(v / t1);
} else {
tmp = t1 / (u * ((t1 - u) / v));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -5.5e-124: tmp = (v * (-t1 / u)) / (t1 + u) elif u <= 8.5e-69: tmp = -(v / t1) else: tmp = t1 / (u * ((t1 - u) / v)) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -5.5e-124) tmp = Float64(Float64(v * Float64(Float64(-t1) / u)) / Float64(t1 + u)); elseif (u <= 8.5e-69) tmp = Float64(-Float64(v / t1)); else tmp = Float64(t1 / Float64(u * Float64(Float64(t1 - u) / v))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -5.5e-124) tmp = (v * (-t1 / u)) / (t1 + u); elseif (u <= 8.5e-69) tmp = -(v / t1); else tmp = t1 / (u * ((t1 - u) / v)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -5.5e-124], N[(N[(v * N[((-t1) / u), $MachinePrecision]), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 8.5e-69], (-N[(v / t1), $MachinePrecision]), N[(t1 / N[(u * N[(N[(t1 - u), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -5.5 \cdot 10^{-124}:\\
\;\;\;\;\frac{v \cdot \frac{-t1}{u}}{t1 + u}\\
\mathbf{elif}\;u \leq 8.5 \cdot 10^{-69}:\\
\;\;\;\;-\frac{v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t1}{u \cdot \frac{t1 - u}{v}}\\
\end{array}
\end{array}
if u < -5.50000000000000016e-124Initial program 87.0%
times-frac94.6%
Simplified94.6%
associate-*r/95.7%
clear-num95.7%
associate-*l/95.8%
*-un-lft-identity95.8%
frac-2neg95.8%
distribute-neg-in95.8%
add-sqr-sqrt46.7%
sqrt-unprod82.8%
sqr-neg82.8%
sqrt-unprod39.2%
add-sqr-sqrt77.8%
sub-neg77.8%
remove-double-neg77.8%
Applied egg-rr77.8%
Taylor expanded in t1 around 0 79.0%
mul-1-neg79.0%
*-commutative79.0%
associate-*r/78.1%
*-commutative78.1%
distribute-rgt-neg-in78.1%
Simplified78.1%
if -5.50000000000000016e-124 < u < 8.50000000000000046e-69Initial program 68.2%
times-frac99.9%
Simplified99.9%
Taylor expanded in t1 around inf 91.3%
associate-*r/91.3%
neg-mul-191.3%
Simplified91.3%
if 8.50000000000000046e-69 < u Initial program 84.0%
times-frac94.5%
Simplified94.5%
Taylor expanded in t1 around 0 78.2%
associate-*r/78.2%
mul-1-neg78.2%
Simplified78.2%
*-commutative78.2%
clear-num78.2%
frac-times79.6%
*-un-lft-identity79.6%
add-sqr-sqrt35.4%
sqrt-unprod48.1%
sqr-neg48.1%
sqrt-unprod25.3%
add-sqr-sqrt48.0%
frac-2neg48.0%
add-sqr-sqrt22.3%
sqrt-unprod54.1%
sqr-neg54.1%
sqrt-unprod40.5%
add-sqr-sqrt79.6%
distribute-neg-in79.6%
add-sqr-sqrt35.5%
sqrt-unprod79.6%
sqr-neg79.6%
sqrt-unprod43.8%
add-sqr-sqrt79.6%
sub-neg79.6%
Applied egg-rr79.6%
Final simplification83.5%
(FPCore (u v t1) :precision binary64 (if (or (<= u -6e-92) (not (<= u 1.3e-68))) (* (/ t1 u) (/ (- v) u)) (- (/ v t1))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -6e-92) || !(u <= 1.3e-68)) {
tmp = (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 <= (-6d-92)) .or. (.not. (u <= 1.3d-68))) then
tmp = (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 <= -6e-92) || !(u <= 1.3e-68)) {
tmp = (t1 / u) * (-v / u);
} else {
tmp = -(v / t1);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -6e-92) or not (u <= 1.3e-68): tmp = (t1 / u) * (-v / u) else: tmp = -(v / t1) return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -6e-92) || !(u <= 1.3e-68)) tmp = Float64(Float64(t1 / u) * 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 <= -6e-92) || ~((u <= 1.3e-68))) tmp = (t1 / u) * (-v / u); else tmp = -(v / t1); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -6e-92], N[Not[LessEqual[u, 1.3e-68]], $MachinePrecision]], N[(N[(t1 / u), $MachinePrecision] * N[((-v) / u), $MachinePrecision]), $MachinePrecision], (-N[(v / t1), $MachinePrecision])]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -6 \cdot 10^{-92} \lor \neg \left(u \leq 1.3 \cdot 10^{-68}\right):\\
\;\;\;\;\frac{t1}{u} \cdot \frac{-v}{u}\\
\mathbf{else}:\\
\;\;\;\;-\frac{v}{t1}\\
\end{array}
\end{array}
if u < -6.00000000000000027e-92 or 1.2999999999999999e-68 < u Initial program 85.5%
times-frac94.5%
Simplified94.5%
Taylor expanded in t1 around 0 78.4%
associate-*r/78.4%
mul-1-neg78.4%
Simplified78.4%
Taylor expanded in t1 around 0 76.2%
if -6.00000000000000027e-92 < u < 1.2999999999999999e-68Initial program 68.8%
times-frac99.9%
Simplified99.9%
Taylor expanded in t1 around inf 90.5%
associate-*r/90.5%
neg-mul-190.5%
Simplified90.5%
Final simplification81.7%
(FPCore (u v t1) :precision binary64 (if (<= u -5.8e-92) (* (/ t1 u) (/ (- v) u)) (if (<= u 4.7e-70) (- (/ v t1)) (/ t1 (* (- u) (/ u v))))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -5.8e-92) {
tmp = (t1 / u) * (-v / u);
} else if (u <= 4.7e-70) {
tmp = -(v / t1);
} else {
tmp = t1 / (-u * (u / v));
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if (u <= (-5.8d-92)) then
tmp = (t1 / u) * (-v / u)
else if (u <= 4.7d-70) then
tmp = -(v / t1)
else
tmp = t1 / (-u * (u / v))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -5.8e-92) {
tmp = (t1 / u) * (-v / u);
} else if (u <= 4.7e-70) {
tmp = -(v / t1);
} else {
tmp = t1 / (-u * (u / v));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -5.8e-92: tmp = (t1 / u) * (-v / u) elif u <= 4.7e-70: tmp = -(v / t1) else: tmp = t1 / (-u * (u / v)) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -5.8e-92) tmp = Float64(Float64(t1 / u) * Float64(Float64(-v) / u)); elseif (u <= 4.7e-70) tmp = Float64(-Float64(v / t1)); else tmp = Float64(t1 / Float64(Float64(-u) * Float64(u / v))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -5.8e-92) tmp = (t1 / u) * (-v / u); elseif (u <= 4.7e-70) tmp = -(v / t1); else tmp = t1 / (-u * (u / v)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -5.8e-92], N[(N[(t1 / u), $MachinePrecision] * N[((-v) / u), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 4.7e-70], (-N[(v / t1), $MachinePrecision]), N[(t1 / N[((-u) * N[(u / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -5.8 \cdot 10^{-92}:\\
\;\;\;\;\frac{t1}{u} \cdot \frac{-v}{u}\\
\mathbf{elif}\;u \leq 4.7 \cdot 10^{-70}:\\
\;\;\;\;-\frac{v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t1}{\left(-u\right) \cdot \frac{u}{v}}\\
\end{array}
\end{array}
if u < -5.79999999999999969e-92Initial program 86.7%
times-frac94.4%
Simplified94.4%
Taylor expanded in t1 around 0 78.6%
associate-*r/78.6%
mul-1-neg78.6%
Simplified78.6%
Taylor expanded in t1 around 0 77.8%
if -5.79999999999999969e-92 < u < 4.6999999999999998e-70Initial program 68.8%
times-frac99.9%
Simplified99.9%
Taylor expanded in t1 around inf 90.5%
associate-*r/90.5%
neg-mul-190.5%
Simplified90.5%
if 4.6999999999999998e-70 < u Initial program 84.0%
times-frac94.5%
Simplified94.5%
Taylor expanded in t1 around 0 78.2%
associate-*r/78.2%
mul-1-neg78.2%
Simplified78.2%
*-commutative78.2%
clear-num78.2%
frac-times79.6%
*-un-lft-identity79.6%
add-sqr-sqrt35.4%
sqrt-unprod48.1%
sqr-neg48.1%
sqrt-unprod25.3%
add-sqr-sqrt48.0%
frac-2neg48.0%
add-sqr-sqrt22.3%
sqrt-unprod54.1%
sqr-neg54.1%
sqrt-unprod40.5%
add-sqr-sqrt79.6%
distribute-neg-in79.6%
add-sqr-sqrt35.5%
sqrt-unprod79.6%
sqr-neg79.6%
sqrt-unprod43.8%
add-sqr-sqrt79.6%
sub-neg79.6%
Applied egg-rr79.6%
Taylor expanded in t1 around 0 78.3%
neg-mul-178.3%
distribute-neg-frac78.3%
Simplified78.3%
Final simplification82.8%
(FPCore (u v t1) :precision binary64 (if (or (<= u -6.2e+165) (not (<= u 1.9e+211))) (* (/ v u) -0.5) (- (/ v t1))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -6.2e+165) || !(u <= 1.9e+211)) {
tmp = (v / u) * -0.5;
} else {
tmp = -(v / t1);
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if ((u <= (-6.2d+165)) .or. (.not. (u <= 1.9d+211))) then
tmp = (v / u) * (-0.5d0)
else
tmp = -(v / t1)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((u <= -6.2e+165) || !(u <= 1.9e+211)) {
tmp = (v / u) * -0.5;
} else {
tmp = -(v / t1);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -6.2e+165) or not (u <= 1.9e+211): tmp = (v / u) * -0.5 else: tmp = -(v / t1) return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -6.2e+165) || !(u <= 1.9e+211)) tmp = Float64(Float64(v / u) * -0.5); else tmp = Float64(-Float64(v / t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -6.2e+165) || ~((u <= 1.9e+211))) tmp = (v / u) * -0.5; else tmp = -(v / t1); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -6.2e+165], N[Not[LessEqual[u, 1.9e+211]], $MachinePrecision]], N[(N[(v / u), $MachinePrecision] * -0.5), $MachinePrecision], (-N[(v / t1), $MachinePrecision])]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -6.2 \cdot 10^{+165} \lor \neg \left(u \leq 1.9 \cdot 10^{+211}\right):\\
\;\;\;\;\frac{v}{u} \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;-\frac{v}{t1}\\
\end{array}
\end{array}
if u < -6.2000000000000003e165 or 1.90000000000000008e211 < u Initial program 89.9%
associate-/r*95.8%
*-commutative95.8%
associate-/l*100.0%
associate-/l/92.1%
+-commutative92.1%
remove-double-neg92.1%
unsub-neg92.1%
div-sub92.1%
sub-neg92.1%
*-inverses92.1%
metadata-eval92.1%
Simplified92.1%
Taylor expanded in t1 around inf 49.1%
mul-1-neg49.1%
unsub-neg49.1%
*-commutative49.1%
Simplified49.1%
Taylor expanded in u around inf 49.2%
if -6.2000000000000003e165 < u < 1.90000000000000008e211Initial program 76.6%
times-frac95.8%
Simplified95.8%
Taylor expanded in t1 around inf 60.0%
associate-*r/60.0%
neg-mul-160.0%
Simplified60.0%
Final simplification58.0%
(FPCore (u v t1) :precision binary64 (if (or (<= u -3.9e+173) (not (<= u 2.1e+211))) (/ v u) (- (/ v t1))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -3.9e+173) || !(u <= 2.1e+211)) {
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 <= (-3.9d+173)) .or. (.not. (u <= 2.1d+211))) 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 <= -3.9e+173) || !(u <= 2.1e+211)) {
tmp = v / u;
} else {
tmp = -(v / t1);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -3.9e+173) or not (u <= 2.1e+211): tmp = v / u else: tmp = -(v / t1) return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -3.9e+173) || !(u <= 2.1e+211)) 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 <= -3.9e+173) || ~((u <= 2.1e+211))) tmp = v / u; else tmp = -(v / t1); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -3.9e+173], N[Not[LessEqual[u, 2.1e+211]], $MachinePrecision]], N[(v / u), $MachinePrecision], (-N[(v / t1), $MachinePrecision])]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -3.9 \cdot 10^{+173} \lor \neg \left(u \leq 2.1 \cdot 10^{+211}\right):\\
\;\;\;\;\frac{v}{u}\\
\mathbf{else}:\\
\;\;\;\;-\frac{v}{t1}\\
\end{array}
\end{array}
if u < -3.8999999999999998e173 or 2.1e211 < u Initial program 89.9%
times-frac99.9%
Simplified99.9%
Taylor expanded in t1 around 0 99.9%
associate-*r/99.9%
mul-1-neg99.9%
Simplified99.9%
*-commutative99.9%
clear-num99.9%
frac-times92.1%
*-un-lft-identity92.1%
add-sqr-sqrt40.8%
sqrt-unprod79.2%
sqr-neg79.2%
sqrt-unprod49.2%
add-sqr-sqrt90.1%
frac-2neg90.1%
add-sqr-sqrt47.1%
sqrt-unprod75.2%
sqr-neg75.2%
sqrt-unprod43.0%
add-sqr-sqrt92.1%
distribute-neg-in92.1%
add-sqr-sqrt40.8%
sqrt-unprod92.1%
sqr-neg92.1%
sqrt-unprod51.3%
add-sqr-sqrt92.1%
sub-neg92.1%
Applied egg-rr92.1%
Taylor expanded in t1 around inf 48.9%
if -3.8999999999999998e173 < u < 2.1e211Initial program 76.6%
times-frac95.8%
Simplified95.8%
Taylor expanded in t1 around inf 60.0%
associate-*r/60.0%
neg-mul-160.0%
Simplified60.0%
Final simplification57.9%
(FPCore (u v t1) :precision binary64 (if (or (<= u -1.7e+167) (not (<= u 1.85e+211))) (/ (- v) u) (- (/ v t1))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -1.7e+167) || !(u <= 1.85e+211)) {
tmp = -v / u;
} else {
tmp = -(v / t1);
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if ((u <= (-1.7d+167)) .or. (.not. (u <= 1.85d+211))) then
tmp = -v / u
else
tmp = -(v / t1)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((u <= -1.7e+167) || !(u <= 1.85e+211)) {
tmp = -v / u;
} else {
tmp = -(v / t1);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -1.7e+167) or not (u <= 1.85e+211): tmp = -v / u else: tmp = -(v / t1) return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -1.7e+167) || !(u <= 1.85e+211)) tmp = Float64(Float64(-v) / u); else tmp = Float64(-Float64(v / t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -1.7e+167) || ~((u <= 1.85e+211))) tmp = -v / u; else tmp = -(v / t1); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -1.7e+167], N[Not[LessEqual[u, 1.85e+211]], $MachinePrecision]], N[((-v) / u), $MachinePrecision], (-N[(v / t1), $MachinePrecision])]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.7 \cdot 10^{+167} \lor \neg \left(u \leq 1.85 \cdot 10^{+211}\right):\\
\;\;\;\;\frac{-v}{u}\\
\mathbf{else}:\\
\;\;\;\;-\frac{v}{t1}\\
\end{array}
\end{array}
if u < -1.7e167 or 1.85000000000000005e211 < u Initial program 89.9%
times-frac99.9%
Simplified99.9%
Taylor expanded in t1 around 0 99.9%
associate-*r/99.9%
mul-1-neg99.9%
Simplified99.9%
Taylor expanded in t1 around inf 49.1%
associate-*r/49.1%
neg-mul-149.1%
Simplified49.1%
if -1.7e167 < u < 1.85000000000000005e211Initial program 76.6%
times-frac95.8%
Simplified95.8%
Taylor expanded in t1 around inf 60.0%
associate-*r/60.0%
neg-mul-160.0%
Simplified60.0%
Final simplification58.0%
(FPCore (u v t1) :precision binary64 (if (<= t1 1.85e+130) (/ v u) (/ v t1)))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= 1.85e+130) {
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 (t1 <= 1.85d+130) 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 (t1 <= 1.85e+130) {
tmp = v / u;
} else {
tmp = v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if t1 <= 1.85e+130: tmp = v / u else: tmp = v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if (t1 <= 1.85e+130) tmp = Float64(v / u); else tmp = Float64(v / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (t1 <= 1.85e+130) tmp = v / u; else tmp = v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[t1, 1.85e+130], N[(v / u), $MachinePrecision], N[(v / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq 1.85 \cdot 10^{+130}:\\
\;\;\;\;\frac{v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{t1}\\
\end{array}
\end{array}
if t1 < 1.8500000000000001e130Initial program 83.3%
times-frac96.0%
Simplified96.0%
Taylor expanded in t1 around 0 60.7%
associate-*r/60.7%
mul-1-neg60.7%
Simplified60.7%
*-commutative60.7%
clear-num60.6%
frac-times59.6%
*-un-lft-identity59.6%
add-sqr-sqrt31.3%
sqrt-unprod38.1%
sqr-neg38.1%
sqrt-unprod16.3%
add-sqr-sqrt35.0%
frac-2neg35.0%
add-sqr-sqrt17.0%
sqrt-unprod38.7%
sqr-neg38.7%
sqrt-unprod29.8%
add-sqr-sqrt59.6%
distribute-neg-in59.6%
add-sqr-sqrt31.4%
sqrt-unprod60.8%
sqr-neg60.8%
sqrt-unprod28.8%
add-sqr-sqrt58.9%
sub-neg58.9%
Applied egg-rr58.9%
Taylor expanded in t1 around inf 16.0%
if 1.8500000000000001e130 < t1 Initial program 53.3%
times-frac100.0%
Simplified100.0%
*-commutative100.0%
clear-num99.1%
frac-2neg99.1%
frac-times70.5%
*-un-lft-identity70.5%
remove-double-neg70.5%
distribute-neg-in70.5%
add-sqr-sqrt0.0%
sqrt-unprod43.5%
sqr-neg43.5%
sqrt-unprod43.2%
add-sqr-sqrt43.2%
sub-neg43.2%
Applied egg-rr43.2%
Taylor expanded in t1 around inf 42.7%
Final simplification19.8%
(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 79.1%
associate-/r*86.5%
*-commutative86.5%
associate-/l*97.4%
associate-/l/93.9%
+-commutative93.9%
remove-double-neg93.9%
unsub-neg93.9%
div-sub93.9%
sub-neg93.9%
*-inverses93.9%
metadata-eval93.9%
Simplified93.9%
Taylor expanded in t1 around inf 58.4%
mul-1-neg58.4%
unsub-neg58.4%
*-commutative58.4%
Simplified58.4%
Final simplification58.4%
(FPCore (u v t1) :precision binary64 (/ (- v) (- t1 u)))
double code(double u, double v, double t1) {
return -v / (t1 - u);
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = -v / (t1 - u)
end function
public static double code(double u, double v, double t1) {
return -v / (t1 - u);
}
def code(u, v, t1): return -v / (t1 - u)
function code(u, v, t1) return Float64(Float64(-v) / Float64(t1 - u)) end
function tmp = code(u, v, t1) tmp = -v / (t1 - u); end
code[u_, v_, t1_] := N[((-v) / N[(t1 - u), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-v}{t1 - u}
\end{array}
Initial program 79.1%
times-frac96.6%
Simplified96.6%
associate-*r/97.3%
clear-num97.3%
associate-*l/97.4%
*-un-lft-identity97.4%
frac-2neg97.4%
distribute-neg-in97.4%
add-sqr-sqrt46.0%
sqrt-unprod70.8%
sqr-neg70.8%
sqrt-unprod30.9%
add-sqr-sqrt57.9%
sub-neg57.9%
remove-double-neg57.9%
Applied egg-rr57.9%
Taylor expanded in t1 around inf 19.6%
div-inv19.6%
frac-2neg19.6%
metadata-eval19.6%
distribute-neg-in19.6%
add-sqr-sqrt7.9%
sqrt-unprod33.9%
sqr-neg33.9%
sqrt-unprod31.5%
add-sqr-sqrt58.1%
sub-neg58.1%
Applied egg-rr58.1%
*-commutative58.1%
associate-*l/58.3%
neg-mul-158.3%
Simplified58.3%
Final simplification58.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 79.1%
times-frac96.6%
Simplified96.6%
*-commutative96.6%
clear-num96.3%
frac-2neg96.3%
frac-times84.7%
*-un-lft-identity84.7%
remove-double-neg84.7%
distribute-neg-in84.7%
add-sqr-sqrt40.5%
sqrt-unprod67.3%
sqr-neg67.3%
sqrt-unprod29.7%
add-sqr-sqrt55.1%
sub-neg55.1%
Applied egg-rr55.1%
Taylor expanded in t1 around inf 11.3%
Final simplification11.3%
herbie shell --seed 2024017
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))