
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) a)))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / a);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / a);
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / a)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / a)) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / a); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) a)))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / a);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / a);
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / a)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / a)) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / a); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* (- z t) (/ y a))))
double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((z - t) * (y / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / a));
}
def code(x, y, z, t, a): return x + ((z - t) * (y / a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z - t) * Float64(y / a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((z - t) * (y / a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z - t\right) \cdot \frac{y}{a}
\end{array}
Initial program 94.7%
associate-/l*93.6%
Simplified93.6%
Taylor expanded in y around 0 94.7%
*-commutative94.7%
associate-*r/99.1%
Simplified99.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -0.78) (not (<= z 1e-29))) (* z (+ (/ y a) (/ x z))) (- x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -0.78) || !(z <= 1e-29)) {
tmp = z * ((y / a) + (x / z));
} else {
tmp = x - (t * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-0.78d0)) .or. (.not. (z <= 1d-29))) then
tmp = z * ((y / a) + (x / z))
else
tmp = x - (t * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -0.78) || !(z <= 1e-29)) {
tmp = z * ((y / a) + (x / z));
} else {
tmp = x - (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -0.78) or not (z <= 1e-29): tmp = z * ((y / a) + (x / z)) else: tmp = x - (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -0.78) || !(z <= 1e-29)) tmp = Float64(z * Float64(Float64(y / a) + Float64(x / z))); else tmp = Float64(x - Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -0.78) || ~((z <= 1e-29))) tmp = z * ((y / a) + (x / z)); else tmp = x - (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -0.78], N[Not[LessEqual[z, 1e-29]], $MachinePrecision]], N[(z * N[(N[(y / a), $MachinePrecision] + N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.78 \lor \neg \left(z \leq 10^{-29}\right):\\
\;\;\;\;z \cdot \left(\frac{y}{a} + \frac{x}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -0.78000000000000003 or 9.99999999999999943e-30 < z Initial program 94.2%
associate-/l*92.7%
Simplified92.7%
Taylor expanded in t around 0 83.5%
+-commutative83.5%
associate-/l*81.4%
Simplified81.4%
Taylor expanded in z around inf 87.0%
+-commutative87.0%
Simplified87.0%
if -0.78000000000000003 < z < 9.99999999999999943e-30Initial program 95.1%
associate-/l*94.4%
Simplified94.4%
Taylor expanded in y around 0 95.1%
*-commutative95.1%
associate-*r/98.4%
Simplified98.4%
Taylor expanded in z around 0 88.9%
associate-*l/88.2%
*-commutative88.2%
neg-mul-188.2%
unsub-neg88.2%
*-commutative88.2%
associate-*l/88.9%
associate-*r/93.0%
Simplified93.0%
Final simplification90.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3e-46) (not (<= t 6.8e+82))) (- x (* t (/ y a))) (+ x (/ (* z y) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3e-46) || !(t <= 6.8e+82)) {
tmp = x - (t * (y / a));
} else {
tmp = x + ((z * y) / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-3d-46)) .or. (.not. (t <= 6.8d+82))) then
tmp = x - (t * (y / a))
else
tmp = x + ((z * y) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3e-46) || !(t <= 6.8e+82)) {
tmp = x - (t * (y / a));
} else {
tmp = x + ((z * y) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3e-46) or not (t <= 6.8e+82): tmp = x - (t * (y / a)) else: tmp = x + ((z * y) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3e-46) || !(t <= 6.8e+82)) tmp = Float64(x - Float64(t * Float64(y / a))); else tmp = Float64(x + Float64(Float64(z * y) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3e-46) || ~((t <= 6.8e+82))) tmp = x - (t * (y / a)); else tmp = x + ((z * y) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3e-46], N[Not[LessEqual[t, 6.8e+82]], $MachinePrecision]], N[(x - N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3 \cdot 10^{-46} \lor \neg \left(t \leq 6.8 \cdot 10^{+82}\right):\\
\;\;\;\;x - t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z \cdot y}{a}\\
\end{array}
\end{array}
if t < -2.99999999999999987e-46 or 6.79999999999999989e82 < t Initial program 92.3%
associate-/l*93.1%
Simplified93.1%
Taylor expanded in y around 0 92.3%
*-commutative92.3%
associate-*r/99.0%
Simplified99.0%
Taylor expanded in z around 0 83.5%
associate-*l/83.5%
*-commutative83.5%
neg-mul-183.5%
unsub-neg83.5%
*-commutative83.5%
associate-*l/83.5%
associate-*r/87.9%
Simplified87.9%
if -2.99999999999999987e-46 < t < 6.79999999999999989e82Initial program 97.0%
associate-/l*94.2%
Simplified94.2%
Taylor expanded in z around inf 92.1%
Final simplification90.0%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.8e-46) (- x (/ y (/ a t))) (if (<= t 6.8e+82) (+ x (/ (* z y) a)) (- x (* t (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.8e-46) {
tmp = x - (y / (a / t));
} else if (t <= 6.8e+82) {
tmp = x + ((z * y) / a);
} else {
tmp = x - (t * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-2.8d-46)) then
tmp = x - (y / (a / t))
else if (t <= 6.8d+82) then
tmp = x + ((z * y) / a)
else
tmp = x - (t * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.8e-46) {
tmp = x - (y / (a / t));
} else if (t <= 6.8e+82) {
tmp = x + ((z * y) / a);
} else {
tmp = x - (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.8e-46: tmp = x - (y / (a / t)) elif t <= 6.8e+82: tmp = x + ((z * y) / a) else: tmp = x - (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.8e-46) tmp = Float64(x - Float64(y / Float64(a / t))); elseif (t <= 6.8e+82) tmp = Float64(x + Float64(Float64(z * y) / a)); else tmp = Float64(x - Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.8e-46) tmp = x - (y / (a / t)); elseif (t <= 6.8e+82) tmp = x + ((z * y) / a); else tmp = x - (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.8e-46], N[(x - N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.8e+82], N[(x + N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x - N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{-46}:\\
\;\;\;\;x - \frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;t \leq 6.8 \cdot 10^{+82}:\\
\;\;\;\;x + \frac{z \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -2.7999999999999998e-46Initial program 96.0%
associate-/l*93.4%
Simplified93.4%
Taylor expanded in y around 0 96.0%
*-commutative96.0%
associate-*r/98.4%
Simplified98.4%
Taylor expanded in z around 0 84.7%
associate-*l/83.4%
*-commutative83.4%
neg-mul-183.4%
unsub-neg83.4%
*-commutative83.4%
associate-*l/84.7%
associate-*r/85.8%
Simplified85.8%
associate-*r/84.7%
*-commutative84.7%
add-sqr-sqrt39.9%
sqrt-unprod61.2%
sqr-neg61.2%
sqrt-unprod24.1%
add-sqr-sqrt39.5%
associate-*l/39.8%
associate-/r/41.0%
add-sqr-sqrt24.3%
sqrt-unprod61.3%
sqr-neg61.3%
sqrt-unprod39.9%
add-sqr-sqrt86.0%
Applied egg-rr86.0%
if -2.7999999999999998e-46 < t < 6.79999999999999989e82Initial program 97.0%
associate-/l*94.2%
Simplified94.2%
Taylor expanded in z around inf 92.1%
if 6.79999999999999989e82 < t Initial program 87.3%
associate-/l*92.7%
Simplified92.7%
Taylor expanded in y around 0 87.3%
*-commutative87.3%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in z around 0 81.8%
associate-*l/83.6%
*-commutative83.6%
neg-mul-183.6%
unsub-neg83.6%
*-commutative83.6%
associate-*l/81.8%
associate-*r/90.8%
Simplified90.8%
Final simplification90.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -3.5e-123) x (if (<= a 0.74) (* z (/ y a)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.5e-123) {
tmp = x;
} else if (a <= 0.74) {
tmp = z * (y / a);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-3.5d-123)) then
tmp = x
else if (a <= 0.74d0) then
tmp = z * (y / a)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.5e-123) {
tmp = x;
} else if (a <= 0.74) {
tmp = z * (y / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.5e-123: tmp = x elif a <= 0.74: tmp = z * (y / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.5e-123) tmp = x; elseif (a <= 0.74) tmp = Float64(z * Float64(y / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3.5e-123) tmp = x; elseif (a <= 0.74) tmp = z * (y / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.5e-123], x, If[LessEqual[a, 0.74], N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.5 \cdot 10^{-123}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 0.74:\\
\;\;\;\;z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -3.4999999999999999e-123 or 0.73999999999999999 < a Initial program 91.5%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in x around inf 66.1%
if -3.4999999999999999e-123 < a < 0.73999999999999999Initial program 99.0%
associate-/l*88.9%
Simplified88.9%
Taylor expanded in t around 0 67.8%
+-commutative67.8%
associate-/l*61.9%
Simplified61.9%
Taylor expanded in z around inf 67.6%
+-commutative67.6%
Simplified67.6%
Taylor expanded in y around inf 55.9%
(FPCore (x y z t a) :precision binary64 (if (<= a -8.2e-126) x (if (<= a 0.74) (* y (/ z a)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -8.2e-126) {
tmp = x;
} else if (a <= 0.74) {
tmp = y * (z / a);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-8.2d-126)) then
tmp = x
else if (a <= 0.74d0) then
tmp = y * (z / a)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -8.2e-126) {
tmp = x;
} else if (a <= 0.74) {
tmp = y * (z / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -8.2e-126: tmp = x elif a <= 0.74: tmp = y * (z / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -8.2e-126) tmp = x; elseif (a <= 0.74) tmp = Float64(y * Float64(z / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -8.2e-126) tmp = x; elseif (a <= 0.74) tmp = y * (z / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -8.2e-126], x, If[LessEqual[a, 0.74], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.2 \cdot 10^{-126}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 0.74:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -8.1999999999999995e-126 or 0.73999999999999999 < a Initial program 91.5%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in x around inf 66.1%
if -8.1999999999999995e-126 < a < 0.73999999999999999Initial program 99.0%
associate-/l*88.9%
Simplified88.9%
Taylor expanded in t around 0 67.8%
+-commutative67.8%
associate-/l*61.9%
Simplified61.9%
Taylor expanded in z around inf 67.6%
+-commutative67.6%
Simplified67.6%
Taylor expanded in y around inf 55.9%
Taylor expanded in z around 0 49.9%
associate-*r/46.6%
Simplified46.6%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) a))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / a));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / a))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / a))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a}
\end{array}
Initial program 94.7%
associate-/l*93.6%
Simplified93.6%
(FPCore (x y z t a) :precision binary64 (+ x (/ (* z y) a)))
double code(double x, double y, double z, double t, double a) {
return x + ((z * y) / a);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((z * y) / a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z * y) / a);
}
def code(x, y, z, t, a): return x + ((z * y) / a)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z * y) / a)) end
function tmp = code(x, y, z, t, a) tmp = x + ((z * y) / a); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{z \cdot y}{a}
\end{array}
Initial program 94.7%
associate-/l*93.6%
Simplified93.6%
Taylor expanded in z around inf 72.9%
Final simplification72.9%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 94.7%
associate-/l*93.6%
Simplified93.6%
Taylor expanded in x around inf 46.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ a (- z t))))
(if (< y -1.0761266216389975e-10)
(+ x (/ 1.0 (/ t_1 y)))
(if (< y 2.894426862792089e-49)
(+ x (/ (* y (- z t)) a))
(+ x (/ y t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a / (z - t);
double tmp;
if (y < -1.0761266216389975e-10) {
tmp = x + (1.0 / (t_1 / y));
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) / a);
} else {
tmp = x + (y / t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = a / (z - t)
if (y < (-1.0761266216389975d-10)) then
tmp = x + (1.0d0 / (t_1 / y))
else if (y < 2.894426862792089d-49) then
tmp = x + ((y * (z - t)) / a)
else
tmp = x + (y / t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a / (z - t);
double tmp;
if (y < -1.0761266216389975e-10) {
tmp = x + (1.0 / (t_1 / y));
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) / a);
} else {
tmp = x + (y / t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a / (z - t) tmp = 0 if y < -1.0761266216389975e-10: tmp = x + (1.0 / (t_1 / y)) elif y < 2.894426862792089e-49: tmp = x + ((y * (z - t)) / a) else: tmp = x + (y / t_1) return tmp
function code(x, y, z, t, a) t_1 = Float64(a / Float64(z - t)) tmp = 0.0 if (y < -1.0761266216389975e-10) tmp = Float64(x + Float64(1.0 / Float64(t_1 / y))); elseif (y < 2.894426862792089e-49) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) / a)); else tmp = Float64(x + Float64(y / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a / (z - t); tmp = 0.0; if (y < -1.0761266216389975e-10) tmp = x + (1.0 / (t_1 / y)); elseif (y < 2.894426862792089e-49) tmp = x + ((y * (z - t)) / a); else tmp = x + (y / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -1.0761266216389975e-10], N[(x + N[(1.0 / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Less[y, 2.894426862792089e-49], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a}{z - t}\\
\mathbf{if}\;y < -1.0761266216389975 \cdot 10^{-10}:\\
\;\;\;\;x + \frac{1}{\frac{t\_1}{y}}\\
\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{t\_1}\\
\end{array}
\end{array}
herbie shell --seed 2024084
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E"
:precision binary64
:alt
(if (< y -1.0761266216389975e-10) (+ x (/ 1.0 (/ (/ a (- z t)) y))) (if (< y 2.894426862792089e-49) (+ x (/ (* y (- z t)) a)) (+ x (/ y (/ a (- z t))))))
(+ x (/ (* y (- z t)) a)))