
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1): return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1) return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = (-t1 * v) / ((t1 + u) * (t1 + u)); end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1): return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1) return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = (-t1 * v) / ((t1 + u) * (t1 + u)); end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\end{array}
(FPCore (u v t1) :precision binary64 (* (/ (- t1) (+ t1 u)) (/ v (+ t1 u))))
double code(double u, double v, double t1) {
return (-t1 / (t1 + u)) * (v / (t1 + u));
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = (-t1 / (t1 + u)) * (v / (t1 + u))
end function
public static double code(double u, double v, double t1) {
return (-t1 / (t1 + u)) * (v / (t1 + u));
}
def code(u, v, t1): return (-t1 / (t1 + u)) * (v / (t1 + u))
function code(u, v, t1) return Float64(Float64(Float64(-t1) / Float64(t1 + u)) * Float64(v / Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = (-t1 / (t1 + u)) * (v / (t1 + u)); end
code[u_, v_, t1_] := N[(N[((-t1) / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}
\end{array}
Initial program 76.9%
+-commutative76.9%
+-commutative76.9%
times-frac97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Final simplification97.7%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) (+ t1 (* u 2.0)))))
(if (<= t1 -6.2e-46)
t_1
(if (<= t1 3e-90)
(/ (* v (/ t1 u)) (- u))
(if (or (<= t1 7.5e+26) (not (<= t1 6.5e+41)))
t_1
(* (/ v (+ t1 u)) (/ (- t1) u)))))))
double code(double u, double v, double t1) {
double t_1 = -v / (t1 + (u * 2.0));
double tmp;
if (t1 <= -6.2e-46) {
tmp = t_1;
} else if (t1 <= 3e-90) {
tmp = (v * (t1 / u)) / -u;
} else if ((t1 <= 7.5e+26) || !(t1 <= 6.5e+41)) {
tmp = t_1;
} else {
tmp = (v / (t1 + u)) * (-t1 / u);
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: t_1
real(8) :: tmp
t_1 = -v / (t1 + (u * 2.0d0))
if (t1 <= (-6.2d-46)) then
tmp = t_1
else if (t1 <= 3d-90) then
tmp = (v * (t1 / u)) / -u
else if ((t1 <= 7.5d+26) .or. (.not. (t1 <= 6.5d+41))) then
tmp = t_1
else
tmp = (v / (t1 + u)) * (-t1 / u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = -v / (t1 + (u * 2.0));
double tmp;
if (t1 <= -6.2e-46) {
tmp = t_1;
} else if (t1 <= 3e-90) {
tmp = (v * (t1 / u)) / -u;
} else if ((t1 <= 7.5e+26) || !(t1 <= 6.5e+41)) {
tmp = t_1;
} else {
tmp = (v / (t1 + u)) * (-t1 / u);
}
return tmp;
}
def code(u, v, t1): t_1 = -v / (t1 + (u * 2.0)) tmp = 0 if t1 <= -6.2e-46: tmp = t_1 elif t1 <= 3e-90: tmp = (v * (t1 / u)) / -u elif (t1 <= 7.5e+26) or not (t1 <= 6.5e+41): tmp = t_1 else: tmp = (v / (t1 + u)) * (-t1 / u) return tmp
function code(u, v, t1) t_1 = Float64(Float64(-v) / Float64(t1 + Float64(u * 2.0))) tmp = 0.0 if (t1 <= -6.2e-46) tmp = t_1; elseif (t1 <= 3e-90) tmp = Float64(Float64(v * Float64(t1 / u)) / Float64(-u)); elseif ((t1 <= 7.5e+26) || !(t1 <= 6.5e+41)) tmp = t_1; else tmp = Float64(Float64(v / Float64(t1 + u)) * Float64(Float64(-t1) / u)); end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -v / (t1 + (u * 2.0)); tmp = 0.0; if (t1 <= -6.2e-46) tmp = t_1; elseif (t1 <= 3e-90) tmp = (v * (t1 / u)) / -u; elseif ((t1 <= 7.5e+26) || ~((t1 <= 6.5e+41))) tmp = t_1; else tmp = (v / (t1 + u)) * (-t1 / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(t1 + N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -6.2e-46], t$95$1, If[LessEqual[t1, 3e-90], N[(N[(v * N[(t1 / u), $MachinePrecision]), $MachinePrecision] / (-u)), $MachinePrecision], If[Or[LessEqual[t1, 7.5e+26], N[Not[LessEqual[t1, 6.5e+41]], $MachinePrecision]], t$95$1, N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[((-t1) / u), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{t1 + u \cdot 2}\\
\mathbf{if}\;t1 \leq -6.2 \cdot 10^{-46}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t1 \leq 3 \cdot 10^{-90}:\\
\;\;\;\;\frac{v \cdot \frac{t1}{u}}{-u}\\
\mathbf{elif}\;t1 \leq 7.5 \cdot 10^{+26} \lor \neg \left(t1 \leq 6.5 \cdot 10^{+41}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{t1 + u} \cdot \frac{-t1}{u}\\
\end{array}
\end{array}
if t1 < -6.2000000000000002e-46 or 3.0000000000000002e-90 < t1 < 7.49999999999999941e26 or 6.49999999999999975e41 < t1 Initial program 71.8%
+-commutative71.8%
+-commutative71.8%
*-commutative71.8%
associate-*l/73.8%
distribute-rgt-neg-in73.8%
distribute-lft-neg-in73.8%
distribute-frac-neg73.8%
/-rgt-identity73.8%
metadata-eval73.8%
associate-/r/77.3%
associate-/r*77.3%
times-frac95.5%
metadata-eval95.5%
/-rgt-identity95.5%
+-commutative95.5%
remove-double-neg95.5%
unsub-neg95.5%
div-sub95.5%
sub-neg95.5%
distribute-frac-neg95.5%
remove-double-neg95.5%
*-inverses95.5%
Simplified95.5%
Taylor expanded in t1 around inf 82.0%
*-commutative82.0%
Simplified82.0%
if -6.2000000000000002e-46 < t1 < 3.0000000000000002e-90Initial program 84.8%
+-commutative84.8%
+-commutative84.8%
times-frac94.1%
+-commutative94.1%
+-commutative94.1%
Simplified94.1%
Taylor expanded in t1 around 0 78.2%
mul-1-neg78.2%
Simplified78.2%
Taylor expanded in t1 around 0 81.8%
associate-*r/84.9%
frac-2neg84.9%
add-sqr-sqrt54.1%
sqrt-unprod53.8%
sqr-neg53.8%
sqrt-unprod33.9%
add-sqr-sqrt41.7%
distribute-lft-neg-out41.7%
*-commutative41.7%
add-sqr-sqrt35.0%
sqrt-unprod57.8%
sqr-neg57.8%
sqrt-unprod57.7%
add-sqr-sqrt84.9%
Applied egg-rr84.9%
if 7.49999999999999941e26 < t1 < 6.49999999999999975e41Initial program 83.8%
+-commutative83.8%
+-commutative83.8%
times-frac99.3%
+-commutative99.3%
+-commutative99.3%
Simplified99.3%
Taylor expanded in t1 around 0 92.8%
mul-1-neg92.8%
Simplified92.8%
Final simplification83.3%
(FPCore (u v t1)
:precision binary64
(if (or (<= t1 -1.65e-43)
(not
(or (<= t1 3.35e-90) (and (not (<= t1 2.3e+27)) (<= t1 2.05e+42)))))
(/ (- v) (+ t1 u))
(* (/ (- t1) u) (/ v u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.65e-43) || !((t1 <= 3.35e-90) || (!(t1 <= 2.3e+27) && (t1 <= 2.05e+42)))) {
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 <= (-1.65d-43)) .or. (.not. (t1 <= 3.35d-90) .or. (.not. (t1 <= 2.3d+27)) .and. (t1 <= 2.05d+42))) 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 <= -1.65e-43) || !((t1 <= 3.35e-90) || (!(t1 <= 2.3e+27) && (t1 <= 2.05e+42)))) {
tmp = -v / (t1 + u);
} else {
tmp = (-t1 / u) * (v / u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -1.65e-43) or not ((t1 <= 3.35e-90) or (not (t1 <= 2.3e+27) and (t1 <= 2.05e+42))): tmp = -v / (t1 + u) else: tmp = (-t1 / u) * (v / u) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -1.65e-43) || !((t1 <= 3.35e-90) || (!(t1 <= 2.3e+27) && (t1 <= 2.05e+42)))) 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 <= -1.65e-43) || ~(((t1 <= 3.35e-90) || (~((t1 <= 2.3e+27)) && (t1 <= 2.05e+42))))) tmp = -v / (t1 + u); else tmp = (-t1 / u) * (v / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -1.65e-43], N[Not[Or[LessEqual[t1, 3.35e-90], And[N[Not[LessEqual[t1, 2.3e+27]], $MachinePrecision], LessEqual[t1, 2.05e+42]]]], $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 -1.65 \cdot 10^{-43} \lor \neg \left(t1 \leq 3.35 \cdot 10^{-90} \lor \neg \left(t1 \leq 2.3 \cdot 10^{+27}\right) \land t1 \leq 2.05 \cdot 10^{+42}\right):\\
\;\;\;\;\frac{-v}{t1 + u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\
\end{array}
\end{array}
if t1 < -1.65000000000000008e-43 or 3.3500000000000002e-90 < t1 < 2.3000000000000001e27 or 2.05e42 < t1 Initial program 71.8%
+-commutative71.8%
+-commutative71.8%
times-frac99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in t1 around inf 81.8%
if -1.65000000000000008e-43 < t1 < 3.3500000000000002e-90 or 2.3000000000000001e27 < t1 < 2.05e42Initial program 84.7%
+-commutative84.7%
+-commutative84.7%
times-frac94.5%
+-commutative94.5%
+-commutative94.5%
Simplified94.5%
Taylor expanded in t1 around 0 79.0%
mul-1-neg79.0%
Simplified79.0%
Taylor expanded in t1 around 0 82.4%
Final simplification82.0%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- t1) u)) (t_2 (/ (- v) (+ t1 u))))
(if (<= t1 -2.25e-45)
t_2
(if (<= t1 3.35e-90)
(/ v (/ u t_1))
(if (or (<= t1 1.5e+27) (not (<= t1 1.22e+42))) t_2 (* t_1 (/ v u)))))))
double code(double u, double v, double t1) {
double t_1 = -t1 / u;
double t_2 = -v / (t1 + u);
double tmp;
if (t1 <= -2.25e-45) {
tmp = t_2;
} else if (t1 <= 3.35e-90) {
tmp = v / (u / t_1);
} else if ((t1 <= 1.5e+27) || !(t1 <= 1.22e+42)) {
tmp = t_2;
} else {
tmp = t_1 * (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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = -t1 / u
t_2 = -v / (t1 + u)
if (t1 <= (-2.25d-45)) then
tmp = t_2
else if (t1 <= 3.35d-90) then
tmp = v / (u / t_1)
else if ((t1 <= 1.5d+27) .or. (.not. (t1 <= 1.22d+42))) then
tmp = t_2
else
tmp = t_1 * (v / u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = -t1 / u;
double t_2 = -v / (t1 + u);
double tmp;
if (t1 <= -2.25e-45) {
tmp = t_2;
} else if (t1 <= 3.35e-90) {
tmp = v / (u / t_1);
} else if ((t1 <= 1.5e+27) || !(t1 <= 1.22e+42)) {
tmp = t_2;
} else {
tmp = t_1 * (v / u);
}
return tmp;
}
def code(u, v, t1): t_1 = -t1 / u t_2 = -v / (t1 + u) tmp = 0 if t1 <= -2.25e-45: tmp = t_2 elif t1 <= 3.35e-90: tmp = v / (u / t_1) elif (t1 <= 1.5e+27) or not (t1 <= 1.22e+42): tmp = t_2 else: tmp = t_1 * (v / u) return tmp
function code(u, v, t1) t_1 = Float64(Float64(-t1) / u) t_2 = Float64(Float64(-v) / Float64(t1 + u)) tmp = 0.0 if (t1 <= -2.25e-45) tmp = t_2; elseif (t1 <= 3.35e-90) tmp = Float64(v / Float64(u / t_1)); elseif ((t1 <= 1.5e+27) || !(t1 <= 1.22e+42)) tmp = t_2; else tmp = Float64(t_1 * Float64(v / u)); end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -t1 / u; t_2 = -v / (t1 + u); tmp = 0.0; if (t1 <= -2.25e-45) tmp = t_2; elseif (t1 <= 3.35e-90) tmp = v / (u / t_1); elseif ((t1 <= 1.5e+27) || ~((t1 <= 1.22e+42))) tmp = t_2; else tmp = t_1 * (v / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-t1) / u), $MachinePrecision]}, Block[{t$95$2 = N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -2.25e-45], t$95$2, If[LessEqual[t1, 3.35e-90], N[(v / N[(u / t$95$1), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t1, 1.5e+27], N[Not[LessEqual[t1, 1.22e+42]], $MachinePrecision]], t$95$2, N[(t$95$1 * N[(v / u), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-t1}{u}\\
t_2 := \frac{-v}{t1 + u}\\
\mathbf{if}\;t1 \leq -2.25 \cdot 10^{-45}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t1 \leq 3.35 \cdot 10^{-90}:\\
\;\;\;\;\frac{v}{\frac{u}{t_1}}\\
\mathbf{elif}\;t1 \leq 1.5 \cdot 10^{+27} \lor \neg \left(t1 \leq 1.22 \cdot 10^{+42}\right):\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \frac{v}{u}\\
\end{array}
\end{array}
if t1 < -2.2499999999999999e-45 or 3.3500000000000002e-90 < t1 < 1.49999999999999988e27 or 1.22e42 < t1 Initial program 71.8%
+-commutative71.8%
+-commutative71.8%
times-frac99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in t1 around inf 81.8%
if -2.2499999999999999e-45 < t1 < 3.3500000000000002e-90Initial program 84.8%
+-commutative84.8%
+-commutative84.8%
times-frac94.1%
+-commutative94.1%
+-commutative94.1%
Simplified94.1%
Taylor expanded in t1 around 0 78.2%
mul-1-neg78.2%
Simplified78.2%
expm1-log1p-u70.9%
expm1-udef51.6%
Applied egg-rr55.5%
expm1-def73.9%
expm1-log1p83.8%
associate-/l*82.3%
Simplified82.3%
Taylor expanded in t1 around 0 83.4%
mul-1-neg83.4%
Simplified83.4%
if 1.49999999999999988e27 < t1 < 1.22e42Initial program 83.8%
+-commutative83.8%
+-commutative83.8%
times-frac99.3%
+-commutative99.3%
+-commutative99.3%
Simplified99.3%
Taylor expanded in t1 around 0 92.8%
mul-1-neg92.8%
Simplified92.8%
Taylor expanded in t1 around 0 92.6%
Final simplification82.6%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- t1) u)) (t_2 (/ (- v) (+ t1 (* u 2.0)))))
(if (<= t1 -3.4e-46)
t_2
(if (<= t1 2.3e-90)
(/ v (/ u t_1))
(if (or (<= t1 2.2e+27) (not (<= t1 7.5e+41))) t_2 (* t_1 (/ v u)))))))
double code(double u, double v, double t1) {
double t_1 = -t1 / u;
double t_2 = -v / (t1 + (u * 2.0));
double tmp;
if (t1 <= -3.4e-46) {
tmp = t_2;
} else if (t1 <= 2.3e-90) {
tmp = v / (u / t_1);
} else if ((t1 <= 2.2e+27) || !(t1 <= 7.5e+41)) {
tmp = t_2;
} else {
tmp = t_1 * (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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = -t1 / u
t_2 = -v / (t1 + (u * 2.0d0))
if (t1 <= (-3.4d-46)) then
tmp = t_2
else if (t1 <= 2.3d-90) then
tmp = v / (u / t_1)
else if ((t1 <= 2.2d+27) .or. (.not. (t1 <= 7.5d+41))) then
tmp = t_2
else
tmp = t_1 * (v / u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = -t1 / u;
double t_2 = -v / (t1 + (u * 2.0));
double tmp;
if (t1 <= -3.4e-46) {
tmp = t_2;
} else if (t1 <= 2.3e-90) {
tmp = v / (u / t_1);
} else if ((t1 <= 2.2e+27) || !(t1 <= 7.5e+41)) {
tmp = t_2;
} else {
tmp = t_1 * (v / u);
}
return tmp;
}
def code(u, v, t1): t_1 = -t1 / u t_2 = -v / (t1 + (u * 2.0)) tmp = 0 if t1 <= -3.4e-46: tmp = t_2 elif t1 <= 2.3e-90: tmp = v / (u / t_1) elif (t1 <= 2.2e+27) or not (t1 <= 7.5e+41): tmp = t_2 else: tmp = t_1 * (v / u) return tmp
function code(u, v, t1) t_1 = Float64(Float64(-t1) / u) t_2 = Float64(Float64(-v) / Float64(t1 + Float64(u * 2.0))) tmp = 0.0 if (t1 <= -3.4e-46) tmp = t_2; elseif (t1 <= 2.3e-90) tmp = Float64(v / Float64(u / t_1)); elseif ((t1 <= 2.2e+27) || !(t1 <= 7.5e+41)) tmp = t_2; else tmp = Float64(t_1 * Float64(v / u)); end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -t1 / u; t_2 = -v / (t1 + (u * 2.0)); tmp = 0.0; if (t1 <= -3.4e-46) tmp = t_2; elseif (t1 <= 2.3e-90) tmp = v / (u / t_1); elseif ((t1 <= 2.2e+27) || ~((t1 <= 7.5e+41))) tmp = t_2; else tmp = t_1 * (v / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-t1) / u), $MachinePrecision]}, Block[{t$95$2 = N[((-v) / N[(t1 + N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -3.4e-46], t$95$2, If[LessEqual[t1, 2.3e-90], N[(v / N[(u / t$95$1), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t1, 2.2e+27], N[Not[LessEqual[t1, 7.5e+41]], $MachinePrecision]], t$95$2, N[(t$95$1 * N[(v / u), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-t1}{u}\\
t_2 := \frac{-v}{t1 + u \cdot 2}\\
\mathbf{if}\;t1 \leq -3.4 \cdot 10^{-46}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t1 \leq 2.3 \cdot 10^{-90}:\\
\;\;\;\;\frac{v}{\frac{u}{t_1}}\\
\mathbf{elif}\;t1 \leq 2.2 \cdot 10^{+27} \lor \neg \left(t1 \leq 7.5 \cdot 10^{+41}\right):\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \frac{v}{u}\\
\end{array}
\end{array}
if t1 < -3.39999999999999996e-46 or 2.2999999999999998e-90 < t1 < 2.1999999999999999e27 or 7.50000000000000072e41 < t1 Initial program 71.8%
+-commutative71.8%
+-commutative71.8%
*-commutative71.8%
associate-*l/73.8%
distribute-rgt-neg-in73.8%
distribute-lft-neg-in73.8%
distribute-frac-neg73.8%
/-rgt-identity73.8%
metadata-eval73.8%
associate-/r/77.3%
associate-/r*77.3%
times-frac95.5%
metadata-eval95.5%
/-rgt-identity95.5%
+-commutative95.5%
remove-double-neg95.5%
unsub-neg95.5%
div-sub95.5%
sub-neg95.5%
distribute-frac-neg95.5%
remove-double-neg95.5%
*-inverses95.5%
Simplified95.5%
Taylor expanded in t1 around inf 82.0%
*-commutative82.0%
Simplified82.0%
if -3.39999999999999996e-46 < t1 < 2.2999999999999998e-90Initial program 84.8%
+-commutative84.8%
+-commutative84.8%
times-frac94.1%
+-commutative94.1%
+-commutative94.1%
Simplified94.1%
Taylor expanded in t1 around 0 78.2%
mul-1-neg78.2%
Simplified78.2%
expm1-log1p-u70.9%
expm1-udef51.6%
Applied egg-rr55.5%
expm1-def73.9%
expm1-log1p83.8%
associate-/l*82.3%
Simplified82.3%
Taylor expanded in t1 around 0 83.4%
mul-1-neg83.4%
Simplified83.4%
if 2.1999999999999999e27 < t1 < 7.50000000000000072e41Initial program 83.8%
+-commutative83.8%
+-commutative83.8%
times-frac99.3%
+-commutative99.3%
+-commutative99.3%
Simplified99.3%
Taylor expanded in t1 around 0 92.8%
mul-1-neg92.8%
Simplified92.8%
Taylor expanded in t1 around 0 92.6%
Final simplification82.8%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) (+ t1 (* u 2.0)))))
(if (<= t1 -8.6e-49)
t_1
(if (<= t1 3.35e-90)
(/ (* v (/ t1 u)) (- u))
(if (or (<= t1 7.5e+27) (not (<= t1 1.15e+42)))
t_1
(* (/ (- t1) u) (/ v u)))))))
double code(double u, double v, double t1) {
double t_1 = -v / (t1 + (u * 2.0));
double tmp;
if (t1 <= -8.6e-49) {
tmp = t_1;
} else if (t1 <= 3.35e-90) {
tmp = (v * (t1 / u)) / -u;
} else if ((t1 <= 7.5e+27) || !(t1 <= 1.15e+42)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = -v / (t1 + (u * 2.0d0))
if (t1 <= (-8.6d-49)) then
tmp = t_1
else if (t1 <= 3.35d-90) then
tmp = (v * (t1 / u)) / -u
else if ((t1 <= 7.5d+27) .or. (.not. (t1 <= 1.15d+42))) then
tmp = t_1
else
tmp = (-t1 / u) * (v / u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = -v / (t1 + (u * 2.0));
double tmp;
if (t1 <= -8.6e-49) {
tmp = t_1;
} else if (t1 <= 3.35e-90) {
tmp = (v * (t1 / u)) / -u;
} else if ((t1 <= 7.5e+27) || !(t1 <= 1.15e+42)) {
tmp = t_1;
} else {
tmp = (-t1 / u) * (v / u);
}
return tmp;
}
def code(u, v, t1): t_1 = -v / (t1 + (u * 2.0)) tmp = 0 if t1 <= -8.6e-49: tmp = t_1 elif t1 <= 3.35e-90: tmp = (v * (t1 / u)) / -u elif (t1 <= 7.5e+27) or not (t1 <= 1.15e+42): tmp = t_1 else: tmp = (-t1 / u) * (v / u) return tmp
function code(u, v, t1) t_1 = Float64(Float64(-v) / Float64(t1 + Float64(u * 2.0))) tmp = 0.0 if (t1 <= -8.6e-49) tmp = t_1; elseif (t1 <= 3.35e-90) tmp = Float64(Float64(v * Float64(t1 / u)) / Float64(-u)); elseif ((t1 <= 7.5e+27) || !(t1 <= 1.15e+42)) tmp = t_1; else tmp = Float64(Float64(Float64(-t1) / u) * Float64(v / u)); end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -v / (t1 + (u * 2.0)); tmp = 0.0; if (t1 <= -8.6e-49) tmp = t_1; elseif (t1 <= 3.35e-90) tmp = (v * (t1 / u)) / -u; elseif ((t1 <= 7.5e+27) || ~((t1 <= 1.15e+42))) tmp = t_1; else tmp = (-t1 / u) * (v / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(t1 + N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -8.6e-49], t$95$1, If[LessEqual[t1, 3.35e-90], N[(N[(v * N[(t1 / u), $MachinePrecision]), $MachinePrecision] / (-u)), $MachinePrecision], If[Or[LessEqual[t1, 7.5e+27], N[Not[LessEqual[t1, 1.15e+42]], $MachinePrecision]], t$95$1, N[(N[((-t1) / u), $MachinePrecision] * N[(v / u), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{t1 + u \cdot 2}\\
\mathbf{if}\;t1 \leq -8.6 \cdot 10^{-49}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t1 \leq 3.35 \cdot 10^{-90}:\\
\;\;\;\;\frac{v \cdot \frac{t1}{u}}{-u}\\
\mathbf{elif}\;t1 \leq 7.5 \cdot 10^{+27} \lor \neg \left(t1 \leq 1.15 \cdot 10^{+42}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\
\end{array}
\end{array}
if t1 < -8.60000000000000033e-49 or 3.3500000000000002e-90 < t1 < 7.5000000000000002e27 or 1.15e42 < t1 Initial program 71.8%
+-commutative71.8%
+-commutative71.8%
*-commutative71.8%
associate-*l/73.8%
distribute-rgt-neg-in73.8%
distribute-lft-neg-in73.8%
distribute-frac-neg73.8%
/-rgt-identity73.8%
metadata-eval73.8%
associate-/r/77.3%
associate-/r*77.3%
times-frac95.5%
metadata-eval95.5%
/-rgt-identity95.5%
+-commutative95.5%
remove-double-neg95.5%
unsub-neg95.5%
div-sub95.5%
sub-neg95.5%
distribute-frac-neg95.5%
remove-double-neg95.5%
*-inverses95.5%
Simplified95.5%
Taylor expanded in t1 around inf 82.0%
*-commutative82.0%
Simplified82.0%
if -8.60000000000000033e-49 < t1 < 3.3500000000000002e-90Initial program 84.8%
+-commutative84.8%
+-commutative84.8%
times-frac94.1%
+-commutative94.1%
+-commutative94.1%
Simplified94.1%
Taylor expanded in t1 around 0 78.2%
mul-1-neg78.2%
Simplified78.2%
Taylor expanded in t1 around 0 81.8%
associate-*r/84.9%
frac-2neg84.9%
add-sqr-sqrt54.1%
sqrt-unprod53.8%
sqr-neg53.8%
sqrt-unprod33.9%
add-sqr-sqrt41.7%
distribute-lft-neg-out41.7%
*-commutative41.7%
add-sqr-sqrt35.0%
sqrt-unprod57.8%
sqr-neg57.8%
sqrt-unprod57.7%
add-sqr-sqrt84.9%
Applied egg-rr84.9%
if 7.5000000000000002e27 < t1 < 1.15e42Initial program 83.8%
+-commutative83.8%
+-commutative83.8%
times-frac99.3%
+-commutative99.3%
+-commutative99.3%
Simplified99.3%
Taylor expanded in t1 around 0 92.8%
mul-1-neg92.8%
Simplified92.8%
Taylor expanded in t1 around 0 92.6%
Final simplification83.3%
(FPCore (u v t1) :precision binary64 (if (<= u -5.8e+56) (* (/ v (+ t1 u)) (/ (- t1) u)) (if (<= u 1.5e-59) (- (/ v t1)) (/ (/ v (/ (+ t1 u) t1)) (- t1 u)))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -5.8e+56) {
tmp = (v / (t1 + u)) * (-t1 / u);
} else if (u <= 1.5e-59) {
tmp = -(v / t1);
} else {
tmp = (v / ((t1 + u) / t1)) / (t1 - u);
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if (u <= (-5.8d+56)) then
tmp = (v / (t1 + u)) * (-t1 / u)
else if (u <= 1.5d-59) then
tmp = -(v / t1)
else
tmp = (v / ((t1 + u) / t1)) / (t1 - u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -5.8e+56) {
tmp = (v / (t1 + u)) * (-t1 / u);
} else if (u <= 1.5e-59) {
tmp = -(v / t1);
} else {
tmp = (v / ((t1 + u) / t1)) / (t1 - u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -5.8e+56: tmp = (v / (t1 + u)) * (-t1 / u) elif u <= 1.5e-59: tmp = -(v / t1) else: tmp = (v / ((t1 + u) / t1)) / (t1 - u) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -5.8e+56) tmp = Float64(Float64(v / Float64(t1 + u)) * Float64(Float64(-t1) / u)); elseif (u <= 1.5e-59) tmp = Float64(-Float64(v / t1)); else tmp = Float64(Float64(v / Float64(Float64(t1 + u) / t1)) / Float64(t1 - u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -5.8e+56) tmp = (v / (t1 + u)) * (-t1 / u); elseif (u <= 1.5e-59) tmp = -(v / t1); else tmp = (v / ((t1 + u) / t1)) / (t1 - u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -5.8e+56], N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[((-t1) / u), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 1.5e-59], (-N[(v / t1), $MachinePrecision]), N[(N[(v / N[(N[(t1 + u), $MachinePrecision] / t1), $MachinePrecision]), $MachinePrecision] / N[(t1 - u), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -5.8 \cdot 10^{+56}:\\
\;\;\;\;\frac{v}{t1 + u} \cdot \frac{-t1}{u}\\
\mathbf{elif}\;u \leq 1.5 \cdot 10^{-59}:\\
\;\;\;\;-\frac{v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{v}{\frac{t1 + u}{t1}}}{t1 - u}\\
\end{array}
\end{array}
if u < -5.80000000000000014e56Initial program 78.0%
+-commutative78.0%
+-commutative78.0%
times-frac98.8%
+-commutative98.8%
+-commutative98.8%
Simplified98.8%
Taylor expanded in t1 around 0 87.3%
mul-1-neg87.3%
Simplified87.3%
if -5.80000000000000014e56 < u < 1.5e-59Initial program 74.9%
+-commutative74.9%
+-commutative74.9%
*-commutative74.9%
associate-*l/75.1%
distribute-rgt-neg-in75.1%
distribute-lft-neg-in75.1%
distribute-frac-neg75.1%
/-rgt-identity75.1%
metadata-eval75.1%
associate-/r/85.0%
associate-/r*85.0%
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 81.5%
if 1.5e-59 < u Initial program 79.7%
+-commutative79.7%
+-commutative79.7%
times-frac97.0%
+-commutative97.0%
+-commutative97.0%
Simplified97.0%
clear-num97.0%
frac-2neg97.0%
frac-times93.1%
*-un-lft-identity93.1%
add-sqr-sqrt49.4%
sqrt-unprod62.4%
sqr-neg62.4%
sqrt-unprod25.9%
add-sqr-sqrt49.9%
add-sqr-sqrt20.4%
sqrt-unprod59.1%
sqr-neg59.1%
sqrt-unprod53.7%
add-sqr-sqrt93.1%
distribute-neg-in93.1%
add-sqr-sqrt39.2%
sqrt-unprod76.6%
sqr-neg76.6%
sqrt-unprod42.0%
add-sqr-sqrt72.1%
sub-neg72.1%
Applied egg-rr72.1%
associate-/r*77.6%
Simplified77.6%
Final simplification81.8%
(FPCore (u v t1) :precision binary64 (if (or (<= u -2.7e+55) (not (<= u 7.8e-60))) (/ (* t1 (/ v u)) (- u)) (- (/ v t1))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -2.7e+55) || !(u <= 7.8e-60)) {
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 <= (-2.7d+55)) .or. (.not. (u <= 7.8d-60))) 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 <= -2.7e+55) || !(u <= 7.8e-60)) {
tmp = (t1 * (v / u)) / -u;
} else {
tmp = -(v / t1);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -2.7e+55) or not (u <= 7.8e-60): tmp = (t1 * (v / u)) / -u else: tmp = -(v / t1) return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -2.7e+55) || !(u <= 7.8e-60)) tmp = Float64(Float64(t1 * Float64(v / u)) / Float64(-u)); else tmp = Float64(-Float64(v / t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -2.7e+55) || ~((u <= 7.8e-60))) tmp = (t1 * (v / u)) / -u; else tmp = -(v / t1); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -2.7e+55], N[Not[LessEqual[u, 7.8e-60]], $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 -2.7 \cdot 10^{+55} \lor \neg \left(u \leq 7.8 \cdot 10^{-60}\right):\\
\;\;\;\;\frac{t1 \cdot \frac{v}{u}}{-u}\\
\mathbf{else}:\\
\;\;\;\;-\frac{v}{t1}\\
\end{array}
\end{array}
if u < -2.69999999999999977e55 or 7.8000000000000004e-60 < u Initial program 78.9%
+-commutative78.9%
+-commutative78.9%
times-frac97.8%
+-commutative97.8%
+-commutative97.8%
Simplified97.8%
Taylor expanded in t1 around 0 81.1%
mul-1-neg81.1%
Simplified81.1%
Taylor expanded in t1 around 0 78.2%
add-sqr-sqrt48.4%
sqrt-unprod58.8%
sqr-neg58.8%
sqrt-unprod34.2%
add-sqr-sqrt50.2%
frac-2neg50.2%
associate-*l/50.2%
add-sqr-sqrt25.6%
sqrt-unprod58.6%
sqr-neg58.6%
sqrt-unprod40.7%
add-sqr-sqrt79.5%
Applied egg-rr79.5%
if -2.69999999999999977e55 < u < 7.8000000000000004e-60Initial program 74.9%
+-commutative74.9%
+-commutative74.9%
*-commutative74.9%
associate-*l/75.1%
distribute-rgt-neg-in75.1%
distribute-lft-neg-in75.1%
distribute-frac-neg75.1%
/-rgt-identity75.1%
metadata-eval75.1%
associate-/r/85.0%
associate-/r*85.0%
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 81.5%
Final simplification80.5%
(FPCore (u v t1) :precision binary64 (if (or (<= u -1.8e+216) (not (<= u 2.1e+161))) (* v (/ (/ t1 u) u)) (/ (- v) (+ t1 u))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -1.8e+216) || !(u <= 2.1e+161)) {
tmp = v * ((t1 / u) / u);
} else {
tmp = -v / (t1 + u);
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if ((u <= (-1.8d+216)) .or. (.not. (u <= 2.1d+161))) then
tmp = v * ((t1 / u) / u)
else
tmp = -v / (t1 + u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((u <= -1.8e+216) || !(u <= 2.1e+161)) {
tmp = v * ((t1 / u) / u);
} else {
tmp = -v / (t1 + u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -1.8e+216) or not (u <= 2.1e+161): tmp = v * ((t1 / u) / u) else: tmp = -v / (t1 + u) return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -1.8e+216) || !(u <= 2.1e+161)) tmp = Float64(v * Float64(Float64(t1 / u) / u)); else tmp = Float64(Float64(-v) / Float64(t1 + u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -1.8e+216) || ~((u <= 2.1e+161))) tmp = v * ((t1 / u) / u); else tmp = -v / (t1 + u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -1.8e+216], N[Not[LessEqual[u, 2.1e+161]], $MachinePrecision]], N[(v * N[(N[(t1 / u), $MachinePrecision] / u), $MachinePrecision]), $MachinePrecision], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.8 \cdot 10^{+216} \lor \neg \left(u \leq 2.1 \cdot 10^{+161}\right):\\
\;\;\;\;v \cdot \frac{\frac{t1}{u}}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1 + u}\\
\end{array}
\end{array}
if u < -1.8000000000000001e216 or 2.1e161 < u Initial program 83.2%
+-commutative83.2%
+-commutative83.2%
times-frac99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in t1 around 0 97.9%
mul-1-neg97.9%
Simplified97.9%
Taylor expanded in t1 around 0 97.9%
*-commutative97.9%
clear-num97.9%
distribute-neg-frac97.9%
frac-times93.3%
*-un-lft-identity93.3%
add-sqr-sqrt47.1%
sqrt-unprod75.1%
sqr-neg75.1%
sqrt-unprod38.1%
add-sqr-sqrt83.1%
Applied egg-rr83.1%
associate-/r*83.0%
add-sqr-sqrt47.2%
sqrt-unprod83.3%
sqr-neg83.3%
sqrt-unprod42.6%
add-sqr-sqrt97.9%
associate-/r*93.3%
associate-/l/97.9%
associate-/r/85.6%
add-sqr-sqrt36.8%
sqrt-unprod83.3%
sqr-neg83.3%
sqrt-unprod47.3%
add-sqr-sqrt83.2%
Applied egg-rr83.2%
if -1.8000000000000001e216 < u < 2.1e161Initial program 75.5%
+-commutative75.5%
+-commutative75.5%
times-frac97.2%
+-commutative97.2%
+-commutative97.2%
Simplified97.2%
Taylor expanded in t1 around inf 66.9%
Final simplification69.9%
(FPCore (u v t1) :precision binary64 (if (<= u -8.5e+100) (/ t1 (* u (/ u v))) (if (<= u 1.8e+161) (/ (- v) (+ t1 u)) (* v (/ (/ t1 u) u)))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -8.5e+100) {
tmp = t1 / (u * (u / v));
} else if (u <= 1.8e+161) {
tmp = -v / (t1 + u);
} else {
tmp = v * ((t1 / u) / 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 <= (-8.5d+100)) then
tmp = t1 / (u * (u / v))
else if (u <= 1.8d+161) then
tmp = -v / (t1 + u)
else
tmp = v * ((t1 / u) / u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -8.5e+100) {
tmp = t1 / (u * (u / v));
} else if (u <= 1.8e+161) {
tmp = -v / (t1 + u);
} else {
tmp = v * ((t1 / u) / u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -8.5e+100: tmp = t1 / (u * (u / v)) elif u <= 1.8e+161: tmp = -v / (t1 + u) else: tmp = v * ((t1 / u) / u) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -8.5e+100) tmp = Float64(t1 / Float64(u * Float64(u / v))); elseif (u <= 1.8e+161) tmp = Float64(Float64(-v) / Float64(t1 + u)); else tmp = Float64(v * Float64(Float64(t1 / u) / u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -8.5e+100) tmp = t1 / (u * (u / v)); elseif (u <= 1.8e+161) tmp = -v / (t1 + u); else tmp = v * ((t1 / u) / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -8.5e+100], N[(t1 / N[(u * N[(u / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 1.8e+161], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], N[(v * N[(N[(t1 / u), $MachinePrecision] / u), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -8.5 \cdot 10^{+100}:\\
\;\;\;\;\frac{t1}{u \cdot \frac{u}{v}}\\
\mathbf{elif}\;u \leq 1.8 \cdot 10^{+161}:\\
\;\;\;\;\frac{-v}{t1 + u}\\
\mathbf{else}:\\
\;\;\;\;v \cdot \frac{\frac{t1}{u}}{u}\\
\end{array}
\end{array}
if u < -8.50000000000000043e100Initial program 73.1%
+-commutative73.1%
+-commutative73.1%
times-frac98.4%
+-commutative98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in t1 around 0 89.7%
mul-1-neg89.7%
Simplified89.7%
Taylor expanded in t1 around 0 87.6%
*-commutative87.6%
clear-num87.6%
distribute-neg-frac87.6%
frac-times82.2%
*-un-lft-identity82.2%
add-sqr-sqrt50.6%
sqrt-unprod64.8%
sqr-neg64.8%
sqrt-unprod20.6%
add-sqr-sqrt62.1%
Applied egg-rr62.1%
if -8.50000000000000043e100 < u < 1.79999999999999992e161Initial program 76.7%
+-commutative76.7%
+-commutative76.7%
times-frac97.3%
+-commutative97.3%
+-commutative97.3%
Simplified97.3%
Taylor expanded in t1 around inf 70.0%
if 1.79999999999999992e161 < u Initial program 85.3%
+-commutative85.3%
+-commutative85.3%
times-frac99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in t1 around 0 99.9%
mul-1-neg99.9%
Simplified99.9%
Taylor expanded in t1 around 0 99.9%
*-commutative99.9%
clear-num99.9%
distribute-neg-frac99.9%
frac-times99.8%
*-un-lft-identity99.8%
add-sqr-sqrt38.5%
sqrt-unprod73.7%
sqr-neg73.7%
sqrt-unprod46.8%
add-sqr-sqrt85.3%
Applied egg-rr85.3%
associate-/r*85.3%
add-sqr-sqrt85.3%
sqrt-unprod85.5%
sqr-neg85.5%
sqrt-unprod0.0%
add-sqr-sqrt99.9%
associate-/r*99.8%
associate-/l/99.9%
associate-/r/88.2%
add-sqr-sqrt0.0%
sqrt-unprod85.5%
sqr-neg85.5%
sqrt-unprod85.4%
add-sqr-sqrt85.4%
Applied egg-rr85.4%
Final simplification70.2%
(FPCore (u v t1) :precision binary64 (if (<= u -6.5e+100) (/ t1 (* u (/ u v))) (if (<= u 2e+161) (/ (- v) (+ t1 u)) (/ v (* u (/ u t1))))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -6.5e+100) {
tmp = t1 / (u * (u / v));
} else if (u <= 2e+161) {
tmp = -v / (t1 + u);
} else {
tmp = v / (u * (u / t1));
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if (u <= (-6.5d+100)) then
tmp = t1 / (u * (u / v))
else if (u <= 2d+161) then
tmp = -v / (t1 + u)
else
tmp = v / (u * (u / t1))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -6.5e+100) {
tmp = t1 / (u * (u / v));
} else if (u <= 2e+161) {
tmp = -v / (t1 + u);
} else {
tmp = v / (u * (u / t1));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -6.5e+100: tmp = t1 / (u * (u / v)) elif u <= 2e+161: tmp = -v / (t1 + u) else: tmp = v / (u * (u / t1)) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -6.5e+100) tmp = Float64(t1 / Float64(u * Float64(u / v))); elseif (u <= 2e+161) tmp = Float64(Float64(-v) / Float64(t1 + u)); else tmp = Float64(v / Float64(u * Float64(u / t1))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -6.5e+100) tmp = t1 / (u * (u / v)); elseif (u <= 2e+161) tmp = -v / (t1 + u); else tmp = v / (u * (u / t1)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -6.5e+100], N[(t1 / N[(u * N[(u / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 2e+161], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], N[(v / N[(u * N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -6.5 \cdot 10^{+100}:\\
\;\;\;\;\frac{t1}{u \cdot \frac{u}{v}}\\
\mathbf{elif}\;u \leq 2 \cdot 10^{+161}:\\
\;\;\;\;\frac{-v}{t1 + u}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u \cdot \frac{u}{t1}}\\
\end{array}
\end{array}
if u < -6.50000000000000001e100Initial program 73.1%
+-commutative73.1%
+-commutative73.1%
times-frac98.4%
+-commutative98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in t1 around 0 89.7%
mul-1-neg89.7%
Simplified89.7%
Taylor expanded in t1 around 0 87.6%
*-commutative87.6%
clear-num87.6%
distribute-neg-frac87.6%
frac-times82.2%
*-un-lft-identity82.2%
add-sqr-sqrt50.6%
sqrt-unprod64.8%
sqr-neg64.8%
sqrt-unprod20.6%
add-sqr-sqrt62.1%
Applied egg-rr62.1%
if -6.50000000000000001e100 < u < 2.0000000000000001e161Initial program 76.7%
+-commutative76.7%
+-commutative76.7%
times-frac97.3%
+-commutative97.3%
+-commutative97.3%
Simplified97.3%
Taylor expanded in t1 around inf 70.0%
if 2.0000000000000001e161 < u Initial program 85.3%
+-commutative85.3%
+-commutative85.3%
times-frac99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in t1 around 0 99.9%
mul-1-neg99.9%
Simplified99.9%
Taylor expanded in t1 around 0 99.9%
add-sqr-sqrt69.2%
sqrt-unprod85.4%
sqr-neg85.4%
sqrt-unprod58.3%
add-sqr-sqrt85.3%
clear-num85.3%
frac-times85.5%
*-un-lft-identity85.5%
Applied egg-rr85.5%
Final simplification70.2%
(FPCore (u v t1) :precision binary64 (if (or (<= u -8.5e+123) (not (<= u 1.82e+161))) (/ v u) (- (/ v t1))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -8.5e+123) || !(u <= 1.82e+161)) {
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.5d+123)) .or. (.not. (u <= 1.82d+161))) 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.5e+123) || !(u <= 1.82e+161)) {
tmp = v / u;
} else {
tmp = -(v / t1);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -8.5e+123) or not (u <= 1.82e+161): tmp = v / u else: tmp = -(v / t1) return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -8.5e+123) || !(u <= 1.82e+161)) 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.5e+123) || ~((u <= 1.82e+161))) tmp = v / u; else tmp = -(v / t1); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -8.5e+123], N[Not[LessEqual[u, 1.82e+161]], $MachinePrecision]], N[(v / u), $MachinePrecision], (-N[(v / t1), $MachinePrecision])]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -8.5 \cdot 10^{+123} \lor \neg \left(u \leq 1.82 \cdot 10^{+161}\right):\\
\;\;\;\;\frac{v}{u}\\
\mathbf{else}:\\
\;\;\;\;-\frac{v}{t1}\\
\end{array}
\end{array}
if u < -8.5e123 or 1.81999999999999991e161 < u Initial program 75.6%
+-commutative75.6%
+-commutative75.6%
times-frac99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in t1 around 0 93.9%
mul-1-neg93.9%
Simplified93.9%
expm1-log1p-u93.9%
expm1-udef74.4%
Applied egg-rr74.4%
expm1-def93.9%
expm1-log1p93.9%
associate-/l*80.3%
Simplified80.3%
Taylor expanded in u around 0 40.8%
if -8.5e123 < u < 1.81999999999999991e161Initial program 77.4%
+-commutative77.4%
+-commutative77.4%
*-commutative77.4%
associate-*l/77.5%
distribute-rgt-neg-in77.5%
distribute-lft-neg-in77.5%
distribute-frac-neg77.5%
/-rgt-identity77.5%
metadata-eval77.5%
associate-/r/84.2%
associate-/r*84.2%
times-frac98.4%
metadata-eval98.4%
/-rgt-identity98.4%
+-commutative98.4%
remove-double-neg98.4%
unsub-neg98.4%
div-sub98.4%
sub-neg98.4%
distribute-frac-neg98.4%
remove-double-neg98.4%
*-inverses98.4%
Simplified98.4%
Taylor expanded in t1 around inf 66.8%
Final simplification60.3%
(FPCore (u v t1) :precision binary64 (if (or (<= u -3e+123) (not (<= u 1.75e+161))) (/ (- v) u) (- (/ v t1))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -3e+123) || !(u <= 1.75e+161)) {
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 <= (-3d+123)) .or. (.not. (u <= 1.75d+161))) 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 <= -3e+123) || !(u <= 1.75e+161)) {
tmp = -v / u;
} else {
tmp = -(v / t1);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -3e+123) or not (u <= 1.75e+161): tmp = -v / u else: tmp = -(v / t1) return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -3e+123) || !(u <= 1.75e+161)) 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 <= -3e+123) || ~((u <= 1.75e+161))) tmp = -v / u; else tmp = -(v / t1); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -3e+123], N[Not[LessEqual[u, 1.75e+161]], $MachinePrecision]], N[((-v) / u), $MachinePrecision], (-N[(v / t1), $MachinePrecision])]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -3 \cdot 10^{+123} \lor \neg \left(u \leq 1.75 \cdot 10^{+161}\right):\\
\;\;\;\;\frac{-v}{u}\\
\mathbf{else}:\\
\;\;\;\;-\frac{v}{t1}\\
\end{array}
\end{array}
if u < -3.00000000000000008e123 or 1.74999999999999994e161 < u Initial program 75.9%
+-commutative75.9%
+-commutative75.9%
times-frac99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in t1 around 0 94.0%
mul-1-neg94.0%
Simplified94.0%
Taylor expanded in t1 around inf 40.5%
associate-*r/40.5%
neg-mul-140.5%
Simplified40.5%
if -3.00000000000000008e123 < u < 1.74999999999999994e161Initial program 77.3%
+-commutative77.3%
+-commutative77.3%
*-commutative77.3%
associate-*l/77.4%
distribute-rgt-neg-in77.4%
distribute-lft-neg-in77.4%
distribute-frac-neg77.4%
/-rgt-identity77.4%
metadata-eval77.4%
associate-/r/84.1%
associate-/r*84.1%
times-frac98.4%
metadata-eval98.4%
/-rgt-identity98.4%
+-commutative98.4%
remove-double-neg98.4%
unsub-neg98.4%
div-sub98.4%
sub-neg98.4%
distribute-frac-neg98.4%
remove-double-neg98.4%
*-inverses98.4%
Simplified98.4%
Taylor expanded in t1 around inf 67.1%
Final simplification60.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 76.9%
+-commutative76.9%
+-commutative76.9%
times-frac97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in t1 around inf 63.1%
Final simplification63.1%
(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 76.9%
+-commutative76.9%
+-commutative76.9%
times-frac97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in t1 around 0 51.7%
mul-1-neg51.7%
Simplified51.7%
expm1-log1p-u48.6%
expm1-udef35.1%
Applied egg-rr39.1%
expm1-def47.2%
expm1-log1p51.5%
associate-/l*47.9%
Simplified47.9%
Taylor expanded in u around 0 15.8%
Final simplification15.8%
herbie shell --seed 2023301
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))