
(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 9 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(t1 / Float64(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}{\left(-t1\right) - u} \cdot \frac{v}{t1 + u}
\end{array}
Initial program 75.1%
times-frac98.9%
distribute-frac-neg98.9%
distribute-neg-frac298.9%
+-commutative98.9%
distribute-neg-in98.9%
unsub-neg98.9%
Simplified98.9%
Final simplification98.9%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ v (- t1))) (t_2 (* t1 (/ (/ v (- (- t1) u)) (+ t1 u)))))
(if (<= t1 -2e+122)
t_1
(if (<= t1 -1.7e-175)
t_2
(if (<= t1 2.9e-260)
(* (/ t1 (- u)) (/ v u))
(if (<= t1 9.2e+125) t_2 t_1))))))
double code(double u, double v, double t1) {
double t_1 = v / -t1;
double t_2 = t1 * ((v / (-t1 - u)) / (t1 + u));
double tmp;
if (t1 <= -2e+122) {
tmp = t_1;
} else if (t1 <= -1.7e-175) {
tmp = t_2;
} else if (t1 <= 2.9e-260) {
tmp = (t1 / -u) * (v / u);
} else if (t1 <= 9.2e+125) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = v / -t1
t_2 = t1 * ((v / (-t1 - u)) / (t1 + u))
if (t1 <= (-2d+122)) then
tmp = t_1
else if (t1 <= (-1.7d-175)) then
tmp = t_2
else if (t1 <= 2.9d-260) then
tmp = (t1 / -u) * (v / u)
else if (t1 <= 9.2d+125) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = v / -t1;
double t_2 = t1 * ((v / (-t1 - u)) / (t1 + u));
double tmp;
if (t1 <= -2e+122) {
tmp = t_1;
} else if (t1 <= -1.7e-175) {
tmp = t_2;
} else if (t1 <= 2.9e-260) {
tmp = (t1 / -u) * (v / u);
} else if (t1 <= 9.2e+125) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = v / -t1 t_2 = t1 * ((v / (-t1 - u)) / (t1 + u)) tmp = 0 if t1 <= -2e+122: tmp = t_1 elif t1 <= -1.7e-175: tmp = t_2 elif t1 <= 2.9e-260: tmp = (t1 / -u) * (v / u) elif t1 <= 9.2e+125: tmp = t_2 else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(v / Float64(-t1)) t_2 = Float64(t1 * Float64(Float64(v / Float64(Float64(-t1) - u)) / Float64(t1 + u))) tmp = 0.0 if (t1 <= -2e+122) tmp = t_1; elseif (t1 <= -1.7e-175) tmp = t_2; elseif (t1 <= 2.9e-260) tmp = Float64(Float64(t1 / Float64(-u)) * Float64(v / u)); elseif (t1 <= 9.2e+125) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = v / -t1; t_2 = t1 * ((v / (-t1 - u)) / (t1 + u)); tmp = 0.0; if (t1 <= -2e+122) tmp = t_1; elseif (t1 <= -1.7e-175) tmp = t_2; elseif (t1 <= 2.9e-260) tmp = (t1 / -u) * (v / u); elseif (t1 <= 9.2e+125) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(v / (-t1)), $MachinePrecision]}, Block[{t$95$2 = N[(t1 * N[(N[(v / N[((-t1) - u), $MachinePrecision]), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -2e+122], t$95$1, If[LessEqual[t1, -1.7e-175], t$95$2, If[LessEqual[t1, 2.9e-260], N[(N[(t1 / (-u)), $MachinePrecision] * N[(v / u), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 9.2e+125], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{v}{-t1}\\
t_2 := t1 \cdot \frac{\frac{v}{\left(-t1\right) - u}}{t1 + u}\\
\mathbf{if}\;t1 \leq -2 \cdot 10^{+122}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq -1.7 \cdot 10^{-175}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t1 \leq 2.9 \cdot 10^{-260}:\\
\;\;\;\;\frac{t1}{-u} \cdot \frac{v}{u}\\
\mathbf{elif}\;t1 \leq 9.2 \cdot 10^{+125}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -2.00000000000000003e122 or 9.20000000000000051e125 < t1 Initial program 60.7%
associate-/l*62.0%
distribute-lft-neg-out62.0%
distribute-rgt-neg-in62.0%
associate-/r*77.7%
distribute-neg-frac277.7%
Simplified77.7%
Taylor expanded in t1 around inf 95.3%
associate-*r/95.3%
neg-mul-195.3%
Simplified95.3%
if -2.00000000000000003e122 < t1 < -1.7e-175 or 2.8999999999999999e-260 < t1 < 9.20000000000000051e125Initial program 83.8%
associate-/l*85.4%
distribute-lft-neg-out85.4%
distribute-rgt-neg-in85.4%
associate-/r*95.2%
distribute-neg-frac295.2%
Simplified95.2%
if -1.7e-175 < t1 < 2.8999999999999999e-260Initial program 76.9%
times-frac97.8%
distribute-frac-neg97.8%
distribute-neg-frac297.8%
+-commutative97.8%
distribute-neg-in97.8%
unsub-neg97.8%
Simplified97.8%
Taylor expanded in t1 around 0 91.8%
associate-*r/91.8%
mul-1-neg91.8%
Simplified91.8%
Taylor expanded in t1 around 0 95.9%
Final simplification95.4%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -6.4e-22) (not (<= t1 2.5e-119))) (/ v (- (- t1) u)) (* (/ t1 (- u)) (/ v u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -6.4e-22) || !(t1 <= 2.5e-119)) {
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 <= (-6.4d-22)) .or. (.not. (t1 <= 2.5d-119))) 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 <= -6.4e-22) || !(t1 <= 2.5e-119)) {
tmp = v / (-t1 - u);
} else {
tmp = (t1 / -u) * (v / u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -6.4e-22) or not (t1 <= 2.5e-119): tmp = v / (-t1 - u) else: tmp = (t1 / -u) * (v / u) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -6.4e-22) || !(t1 <= 2.5e-119)) tmp = Float64(v / Float64(Float64(-t1) - u)); else tmp = Float64(Float64(t1 / Float64(-u)) * Float64(v / u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -6.4e-22) || ~((t1 <= 2.5e-119))) tmp = v / (-t1 - u); else tmp = (t1 / -u) * (v / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -6.4e-22], N[Not[LessEqual[t1, 2.5e-119]], $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 -6.4 \cdot 10^{-22} \lor \neg \left(t1 \leq 2.5 \cdot 10^{-119}\right):\\
\;\;\;\;\frac{v}{\left(-t1\right) - u}\\
\mathbf{else}:\\
\;\;\;\;\frac{t1}{-u} \cdot \frac{v}{u}\\
\end{array}
\end{array}
if t1 < -6.39999999999999975e-22 or 2.49999999999999996e-119 < t1 Initial program 71.3%
times-frac99.8%
distribute-frac-neg99.8%
distribute-neg-frac299.8%
+-commutative99.8%
distribute-neg-in99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in t1 around inf 80.6%
if -6.39999999999999975e-22 < t1 < 2.49999999999999996e-119Initial program 81.9%
times-frac97.3%
distribute-frac-neg97.3%
distribute-neg-frac297.3%
+-commutative97.3%
distribute-neg-in97.3%
unsub-neg97.3%
Simplified97.3%
Taylor expanded in t1 around 0 87.7%
associate-*r/87.7%
mul-1-neg87.7%
Simplified87.7%
Taylor expanded in t1 around 0 90.0%
Final simplification84.1%
(FPCore (u v t1) :precision binary64 (if (<= t1 -7.8e-27) (/ v (- (- t1) u)) (if (<= t1 8e-113) (* (/ t1 (- u)) (/ v u)) (/ -1.0 (/ (+ t1 u) v)))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -7.8e-27) {
tmp = v / (-t1 - u);
} else if (t1 <= 8e-113) {
tmp = (t1 / -u) * (v / u);
} else {
tmp = -1.0 / ((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 (t1 <= (-7.8d-27)) then
tmp = v / (-t1 - u)
else if (t1 <= 8d-113) then
tmp = (t1 / -u) * (v / u)
else
tmp = (-1.0d0) / ((t1 + u) / v)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (t1 <= -7.8e-27) {
tmp = v / (-t1 - u);
} else if (t1 <= 8e-113) {
tmp = (t1 / -u) * (v / u);
} else {
tmp = -1.0 / ((t1 + u) / v);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if t1 <= -7.8e-27: tmp = v / (-t1 - u) elif t1 <= 8e-113: tmp = (t1 / -u) * (v / u) else: tmp = -1.0 / ((t1 + u) / v) return tmp
function code(u, v, t1) tmp = 0.0 if (t1 <= -7.8e-27) tmp = Float64(v / Float64(Float64(-t1) - u)); elseif (t1 <= 8e-113) tmp = Float64(Float64(t1 / Float64(-u)) * Float64(v / u)); else tmp = Float64(-1.0 / Float64(Float64(t1 + u) / v)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (t1 <= -7.8e-27) tmp = v / (-t1 - u); elseif (t1 <= 8e-113) tmp = (t1 / -u) * (v / u); else tmp = -1.0 / ((t1 + u) / v); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[t1, -7.8e-27], N[(v / N[((-t1) - u), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 8e-113], N[(N[(t1 / (-u)), $MachinePrecision] * N[(v / u), $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[(N[(t1 + u), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -7.8 \cdot 10^{-27}:\\
\;\;\;\;\frac{v}{\left(-t1\right) - u}\\
\mathbf{elif}\;t1 \leq 8 \cdot 10^{-113}:\\
\;\;\;\;\frac{t1}{-u} \cdot \frac{v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{t1 + u}{v}}\\
\end{array}
\end{array}
if t1 < -7.79999999999999944e-27Initial program 75.3%
times-frac99.9%
distribute-frac-neg99.9%
distribute-neg-frac299.9%
+-commutative99.9%
distribute-neg-in99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in t1 around inf 85.3%
if -7.79999999999999944e-27 < t1 < 7.99999999999999983e-113Initial program 81.9%
times-frac97.3%
distribute-frac-neg97.3%
distribute-neg-frac297.3%
+-commutative97.3%
distribute-neg-in97.3%
unsub-neg97.3%
Simplified97.3%
Taylor expanded in t1 around 0 87.7%
associate-*r/87.7%
mul-1-neg87.7%
Simplified87.7%
Taylor expanded in t1 around 0 90.0%
if 7.99999999999999983e-113 < t1 Initial program 68.4%
times-frac99.8%
distribute-frac-neg99.8%
distribute-neg-frac299.8%
+-commutative99.8%
distribute-neg-in99.8%
unsub-neg99.8%
Simplified99.8%
clear-num99.6%
inv-pow99.6%
Applied egg-rr99.6%
unpow-199.6%
Simplified99.6%
Taylor expanded in t1 around inf 77.4%
Final simplification84.1%
(FPCore (u v t1) :precision binary64 (if (or (<= u -2.5e+76) (not (<= u 3.8e+119))) (/ t1 (* u (/ u v))) (/ v (- t1))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -2.5e+76) || !(u <= 3.8e+119)) {
tmp = t1 / (u * (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.5d+76)) .or. (.not. (u <= 3.8d+119))) then
tmp = t1 / (u * (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.5e+76) || !(u <= 3.8e+119)) {
tmp = t1 / (u * (u / v));
} else {
tmp = v / -t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -2.5e+76) or not (u <= 3.8e+119): tmp = t1 / (u * (u / v)) else: tmp = v / -t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -2.5e+76) || !(u <= 3.8e+119)) tmp = Float64(t1 / Float64(u * Float64(u / v))); else tmp = Float64(v / Float64(-t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -2.5e+76) || ~((u <= 3.8e+119))) tmp = t1 / (u * (u / v)); else tmp = v / -t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -2.5e+76], N[Not[LessEqual[u, 3.8e+119]], $MachinePrecision]], N[(t1 / N[(u * N[(u / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(v / (-t1)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.5 \cdot 10^{+76} \lor \neg \left(u \leq 3.8 \cdot 10^{+119}\right):\\
\;\;\;\;\frac{t1}{u \cdot \frac{u}{v}}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{-t1}\\
\end{array}
\end{array}
if u < -2.49999999999999996e76 or 3.7999999999999999e119 < u Initial program 73.3%
associate-/l*74.7%
distribute-lft-neg-out74.7%
distribute-rgt-neg-in74.7%
associate-/r*93.8%
distribute-neg-frac293.8%
Simplified93.8%
Taylor expanded in t1 around 0 87.6%
clear-num86.7%
un-div-inv86.7%
div-inv86.8%
add-sqr-sqrt49.1%
sqrt-unprod70.9%
sqr-neg70.9%
sqrt-unprod29.7%
add-sqr-sqrt63.0%
clear-num63.0%
Applied egg-rr63.0%
associate-/r*62.9%
+-commutative62.9%
Simplified62.9%
Taylor expanded in t1 around 0 62.6%
div-inv62.6%
associate-/l*62.7%
Applied egg-rr62.7%
associate-/l/62.7%
associate-*r/62.7%
*-rgt-identity62.7%
Simplified62.7%
if -2.49999999999999996e76 < u < 3.7999999999999999e119Initial program 76.0%
associate-/l*78.5%
distribute-lft-neg-out78.5%
distribute-rgt-neg-in78.5%
associate-/r*85.0%
distribute-neg-frac285.0%
Simplified85.0%
Taylor expanded in t1 around inf 71.1%
associate-*r/71.1%
neg-mul-171.1%
Simplified71.1%
Final simplification68.3%
(FPCore (u v t1) :precision binary64 (if (or (<= u -4.8e+69) (not (<= u 1.8e+129))) (/ 1.0 (/ u v)) (/ v (- t1))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -4.8e+69) || !(u <= 1.8e+129)) {
tmp = 1.0 / (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 <= (-4.8d+69)) .or. (.not. (u <= 1.8d+129))) then
tmp = 1.0d0 / (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 <= -4.8e+69) || !(u <= 1.8e+129)) {
tmp = 1.0 / (u / v);
} else {
tmp = v / -t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -4.8e+69) or not (u <= 1.8e+129): tmp = 1.0 / (u / v) else: tmp = v / -t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -4.8e+69) || !(u <= 1.8e+129)) tmp = Float64(1.0 / Float64(u / v)); else tmp = Float64(v / Float64(-t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -4.8e+69) || ~((u <= 1.8e+129))) tmp = 1.0 / (u / v); else tmp = v / -t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -4.8e+69], N[Not[LessEqual[u, 1.8e+129]], $MachinePrecision]], N[(1.0 / N[(u / v), $MachinePrecision]), $MachinePrecision], N[(v / (-t1)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -4.8 \cdot 10^{+69} \lor \neg \left(u \leq 1.8 \cdot 10^{+129}\right):\\
\;\;\;\;\frac{1}{\frac{u}{v}}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{-t1}\\
\end{array}
\end{array}
if u < -4.8000000000000003e69 or 1.8000000000000001e129 < u Initial program 73.6%
associate-/l*75.0%
distribute-lft-neg-out75.0%
distribute-rgt-neg-in75.0%
associate-/r*93.9%
distribute-neg-frac293.9%
Simplified93.9%
Taylor expanded in t1 around 0 87.8%
clear-num86.9%
un-div-inv86.9%
div-inv86.9%
add-sqr-sqrt50.9%
sqrt-unprod72.3%
sqr-neg72.3%
sqrt-unprod29.3%
add-sqr-sqrt62.2%
clear-num62.2%
Applied egg-rr62.2%
associate-/r*62.2%
+-commutative62.2%
Simplified62.2%
Taylor expanded in t1 around inf 38.9%
if -4.8000000000000003e69 < u < 1.8000000000000001e129Initial program 75.9%
associate-/l*78.4%
distribute-lft-neg-out78.4%
distribute-rgt-neg-in78.4%
associate-/r*84.9%
distribute-neg-frac284.9%
Simplified84.9%
Taylor expanded in t1 around inf 71.4%
associate-*r/71.4%
neg-mul-171.4%
Simplified71.4%
Final simplification60.8%
(FPCore (u v t1) :precision binary64 (if (<= u 2.15e+133) (/ v (- t1)) (/ v u)))
double code(double u, double v, double t1) {
double tmp;
if (u <= 2.15e+133) {
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 <= 2.15d+133) 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 <= 2.15e+133) {
tmp = v / -t1;
} else {
tmp = v / u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= 2.15e+133: tmp = v / -t1 else: tmp = v / u return tmp
function code(u, v, t1) tmp = 0.0 if (u <= 2.15e+133) tmp = Float64(v / Float64(-t1)); else tmp = Float64(v / u); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= 2.15e+133) tmp = v / -t1; else tmp = v / u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, 2.15e+133], N[(v / (-t1)), $MachinePrecision], N[(v / u), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq 2.15 \cdot 10^{+133}:\\
\;\;\;\;\frac{v}{-t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u}\\
\end{array}
\end{array}
if u < 2.14999999999999997e133Initial program 74.5%
associate-/l*77.0%
distribute-lft-neg-out77.0%
distribute-rgt-neg-in77.0%
associate-/r*86.9%
distribute-neg-frac286.9%
Simplified86.9%
Taylor expanded in t1 around inf 61.4%
associate-*r/61.4%
neg-mul-161.4%
Simplified61.4%
if 2.14999999999999997e133 < u Initial program 78.6%
associate-/l*78.8%
distribute-lft-neg-out78.8%
distribute-rgt-neg-in78.8%
associate-/r*94.0%
distribute-neg-frac294.0%
Simplified94.0%
Taylor expanded in t1 around 0 94.0%
clear-num92.0%
un-div-inv91.8%
div-inv91.8%
add-sqr-sqrt8.4%
sqrt-unprod76.2%
sqr-neg76.2%
sqrt-unprod67.5%
add-sqr-sqrt76.0%
clear-num76.0%
Applied egg-rr76.0%
associate-/r*75.9%
+-commutative75.9%
Simplified75.9%
Taylor expanded in t1 around inf 42.6%
Final simplification58.8%
(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(v / Float64(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}{\left(-t1\right) - u}
\end{array}
Initial program 75.1%
times-frac98.9%
distribute-frac-neg98.9%
distribute-neg-frac298.9%
+-commutative98.9%
distribute-neg-in98.9%
unsub-neg98.9%
Simplified98.9%
Taylor expanded in t1 around inf 61.9%
Final simplification61.9%
(FPCore (u v t1) :precision binary64 (/ v u))
double code(double u, double v, double t1) {
return v / 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 / u
end function
public static double code(double u, double v, double t1) {
return v / u;
}
def code(u, v, t1): return v / u
function code(u, v, t1) return Float64(v / u) end
function tmp = code(u, v, t1) tmp = v / u; end
code[u_, v_, t1_] := N[(v / u), $MachinePrecision]
\begin{array}{l}
\\
\frac{v}{u}
\end{array}
Initial program 75.1%
associate-/l*77.3%
distribute-lft-neg-out77.3%
distribute-rgt-neg-in77.3%
associate-/r*87.9%
distribute-neg-frac287.9%
Simplified87.9%
Taylor expanded in t1 around 0 56.7%
clear-num57.0%
un-div-inv57.0%
div-inv57.0%
add-sqr-sqrt30.2%
sqrt-unprod49.0%
sqr-neg49.0%
sqrt-unprod16.7%
add-sqr-sqrt34.7%
clear-num34.7%
Applied egg-rr34.7%
associate-/r*27.5%
+-commutative27.5%
Simplified27.5%
Taylor expanded in t1 around inf 16.3%
Final simplification16.3%
herbie shell --seed 2024077
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))