
(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 8 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.4%
associate-/l*93.9%
Simplified93.9%
Taylor expanded in y around 0 94.4%
associate-*l/97.4%
*-commutative97.4%
Simplified97.4%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.5e+124) (* y (/ t (- a))) (if (<= t 3e-307) x (if (<= t 6e+42) (* y (/ z a)) (* t (/ (- y) a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.5e+124) {
tmp = y * (t / -a);
} else if (t <= 3e-307) {
tmp = x;
} else if (t <= 6e+42) {
tmp = y * (z / a);
} else {
tmp = 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 <= (-1.5d+124)) then
tmp = y * (t / -a)
else if (t <= 3d-307) then
tmp = x
else if (t <= 6d+42) then
tmp = y * (z / a)
else
tmp = 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 <= -1.5e+124) {
tmp = y * (t / -a);
} else if (t <= 3e-307) {
tmp = x;
} else if (t <= 6e+42) {
tmp = y * (z / a);
} else {
tmp = t * (-y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.5e+124: tmp = y * (t / -a) elif t <= 3e-307: tmp = x elif t <= 6e+42: tmp = y * (z / a) else: tmp = t * (-y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.5e+124) tmp = Float64(y * Float64(t / Float64(-a))); elseif (t <= 3e-307) tmp = x; elseif (t <= 6e+42) tmp = Float64(y * Float64(z / a)); else tmp = Float64(t * Float64(Float64(-y) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.5e+124) tmp = y * (t / -a); elseif (t <= 3e-307) tmp = x; elseif (t <= 6e+42) tmp = y * (z / a); else tmp = t * (-y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.5e+124], N[(y * N[(t / (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3e-307], x, If[LessEqual[t, 6e+42], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], N[(t * N[((-y) / a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.5 \cdot 10^{+124}:\\
\;\;\;\;y \cdot \frac{t}{-a}\\
\mathbf{elif}\;t \leq 3 \cdot 10^{-307}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 6 \cdot 10^{+42}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{-y}{a}\\
\end{array}
\end{array}
if t < -1.5e124Initial program 89.9%
+-commutative89.9%
associate-/l*99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in y around inf 67.9%
Taylor expanded in z around 0 47.8%
mul-1-neg47.8%
distribute-frac-neg247.8%
associate-*l/57.6%
*-commutative57.6%
Simplified57.6%
if -1.5e124 < t < 2.9999999999999999e-307Initial program 96.3%
+-commutative96.3%
associate-/l*92.8%
fma-define92.8%
Simplified92.8%
Taylor expanded in y around 0 62.2%
if 2.9999999999999999e-307 < t < 6.00000000000000058e42Initial program 93.2%
+-commutative93.2%
associate-/l*97.1%
fma-define97.1%
Simplified97.1%
Taylor expanded in y around inf 70.4%
Taylor expanded in z around inf 55.5%
associate-*r/58.1%
Simplified58.1%
if 6.00000000000000058e42 < t Initial program 94.5%
+-commutative94.5%
associate-/l*88.8%
fma-define88.8%
Simplified88.8%
Taylor expanded in y around inf 63.4%
Taylor expanded in z around 0 65.8%
mul-1-neg65.8%
distribute-frac-neg265.8%
associate-/l*67.3%
Simplified67.3%
Final simplification61.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (/ (- y) a))))
(if (<= t -1.4e+124)
t_1
(if (<= t 1.5e-307) x (if (<= t 1.2e+44) (* y (/ z a)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * (-y / a);
double tmp;
if (t <= -1.4e+124) {
tmp = t_1;
} else if (t <= 1.5e-307) {
tmp = x;
} else if (t <= 1.2e+44) {
tmp = y * (z / a);
} else {
tmp = 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 = t * (-y / a)
if (t <= (-1.4d+124)) then
tmp = t_1
else if (t <= 1.5d-307) then
tmp = x
else if (t <= 1.2d+44) then
tmp = y * (z / a)
else
tmp = 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 = t * (-y / a);
double tmp;
if (t <= -1.4e+124) {
tmp = t_1;
} else if (t <= 1.5e-307) {
tmp = x;
} else if (t <= 1.2e+44) {
tmp = y * (z / a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t * (-y / a) tmp = 0 if t <= -1.4e+124: tmp = t_1 elif t <= 1.5e-307: tmp = x elif t <= 1.2e+44: tmp = y * (z / a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t * Float64(Float64(-y) / a)) tmp = 0.0 if (t <= -1.4e+124) tmp = t_1; elseif (t <= 1.5e-307) tmp = x; elseif (t <= 1.2e+44) tmp = Float64(y * Float64(z / a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t * (-y / a); tmp = 0.0; if (t <= -1.4e+124) tmp = t_1; elseif (t <= 1.5e-307) tmp = x; elseif (t <= 1.2e+44) tmp = y * (z / a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[((-y) / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.4e+124], t$95$1, If[LessEqual[t, 1.5e-307], x, If[LessEqual[t, 1.2e+44], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{-y}{a}\\
\mathbf{if}\;t \leq -1.4 \cdot 10^{+124}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{-307}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{+44}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.4e124 or 1.20000000000000007e44 < t Initial program 92.9%
+-commutative92.9%
associate-/l*92.7%
fma-define92.7%
Simplified92.7%
Taylor expanded in y around inf 65.0%
Taylor expanded in z around 0 59.4%
mul-1-neg59.4%
distribute-frac-neg259.4%
associate-/l*62.7%
Simplified62.7%
if -1.4e124 < t < 1.5e-307Initial program 96.3%
+-commutative96.3%
associate-/l*92.8%
fma-define92.8%
Simplified92.8%
Taylor expanded in y around 0 62.2%
if 1.5e-307 < t < 1.20000000000000007e44Initial program 93.2%
+-commutative93.2%
associate-/l*97.1%
fma-define97.1%
Simplified97.1%
Taylor expanded in y around inf 70.4%
Taylor expanded in z around inf 55.5%
associate-*r/58.1%
Simplified58.1%
Final simplification61.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6.8e-8) (not (<= z 2.2e-70))) (+ x (* z (/ y a))) (- x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.8e-8) || !(z <= 2.2e-70)) {
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 ((z <= (-6.8d-8)) .or. (.not. (z <= 2.2d-70))) 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 ((z <= -6.8e-8) || !(z <= 2.2e-70)) {
tmp = x + (z * (y / a));
} else {
tmp = x - (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6.8e-8) or not (z <= 2.2e-70): tmp = x + (z * (y / a)) else: tmp = x - (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6.8e-8) || !(z <= 2.2e-70)) tmp = Float64(x + Float64(z * Float64(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 ((z <= -6.8e-8) || ~((z <= 2.2e-70))) tmp = x + (z * (y / a)); else tmp = x - (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6.8e-8], N[Not[LessEqual[z, 2.2e-70]], $MachinePrecision]], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{-8} \lor \neg \left(z \leq 2.2 \cdot 10^{-70}\right):\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -6.8e-8 or 2.1999999999999999e-70 < z Initial program 92.8%
associate-/l*92.1%
Simplified92.1%
Taylor expanded in y around 0 92.8%
associate-*l/96.8%
*-commutative96.8%
Simplified96.8%
Taylor expanded in z around inf 86.6%
if -6.8e-8 < z < 2.1999999999999999e-70Initial program 96.5%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in y around 0 96.5%
associate-*l/98.3%
*-commutative98.3%
Simplified98.3%
Taylor expanded in z around 0 94.3%
neg-mul-194.3%
Simplified94.3%
Taylor expanded in x around 0 91.2%
metadata-eval91.2%
associate-*r/94.3%
cancel-sign-sub-inv94.3%
*-lft-identity94.3%
Simplified94.3%
Final simplification89.9%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.25e+193) (* y (/ t (- a))) (if (<= t 1.4e+46) (+ x (* z (/ y a))) (* t (/ (- y) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.25e+193) {
tmp = y * (t / -a);
} else if (t <= 1.4e+46) {
tmp = x + (z * (y / a));
} else {
tmp = 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 <= (-1.25d+193)) then
tmp = y * (t / -a)
else if (t <= 1.4d+46) then
tmp = x + (z * (y / a))
else
tmp = 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 <= -1.25e+193) {
tmp = y * (t / -a);
} else if (t <= 1.4e+46) {
tmp = x + (z * (y / a));
} else {
tmp = t * (-y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.25e+193: tmp = y * (t / -a) elif t <= 1.4e+46: tmp = x + (z * (y / a)) else: tmp = t * (-y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.25e+193) tmp = Float64(y * Float64(t / Float64(-a))); elseif (t <= 1.4e+46) tmp = Float64(x + Float64(z * Float64(y / a))); else tmp = Float64(t * Float64(Float64(-y) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.25e+193) tmp = y * (t / -a); elseif (t <= 1.4e+46) tmp = x + (z * (y / a)); else tmp = t * (-y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.25e+193], N[(y * N[(t / (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.4e+46], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[((-y) / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.25 \cdot 10^{+193}:\\
\;\;\;\;y \cdot \frac{t}{-a}\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{+46}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{-y}{a}\\
\end{array}
\end{array}
if t < -1.24999999999999993e193Initial program 88.5%
+-commutative88.5%
associate-/l*99.7%
fma-define99.7%
Simplified99.7%
Taylor expanded in y around inf 75.5%
Taylor expanded in z around 0 58.2%
mul-1-neg58.2%
distribute-frac-neg258.2%
associate-*l/69.4%
*-commutative69.4%
Simplified69.4%
if -1.24999999999999993e193 < t < 1.40000000000000009e46Initial program 94.8%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in y around 0 94.8%
associate-*l/98.1%
*-commutative98.1%
Simplified98.1%
Taylor expanded in z around inf 85.9%
if 1.40000000000000009e46 < t Initial program 94.5%
+-commutative94.5%
associate-/l*88.8%
fma-define88.8%
Simplified88.8%
Taylor expanded in y around inf 63.4%
Taylor expanded in z around 0 65.8%
mul-1-neg65.8%
distribute-frac-neg265.8%
associate-/l*67.3%
Simplified67.3%
Final simplification81.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.9e+41) (not (<= y 2.55e-31))) (* y (/ z a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.9e+41) || !(y <= 2.55e-31)) {
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 ((y <= (-1.9d+41)) .or. (.not. (y <= 2.55d-31))) 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 ((y <= -1.9e+41) || !(y <= 2.55e-31)) {
tmp = y * (z / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.9e+41) or not (y <= 2.55e-31): tmp = y * (z / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.9e+41) || !(y <= 2.55e-31)) 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 ((y <= -1.9e+41) || ~((y <= 2.55e-31))) tmp = y * (z / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.9e+41], N[Not[LessEqual[y, 2.55e-31]], $MachinePrecision]], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{+41} \lor \neg \left(y \leq 2.55 \cdot 10^{-31}\right):\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.9000000000000001e41 or 2.5499999999999999e-31 < y Initial program 90.2%
+-commutative90.2%
associate-/l*99.1%
fma-define99.1%
Simplified99.1%
Taylor expanded in y around inf 79.4%
Taylor expanded in z around inf 42.7%
associate-*r/46.3%
Simplified46.3%
if -1.9000000000000001e41 < y < 2.5499999999999999e-31Initial program 98.4%
+-commutative98.4%
associate-/l*88.9%
fma-define88.9%
Simplified88.9%
Taylor expanded in y around 0 62.6%
Final simplification54.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.4%
associate-/l*93.9%
Simplified93.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.4%
+-commutative94.4%
associate-/l*93.9%
fma-define93.9%
Simplified93.9%
Taylor expanded in y around 0 40.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 2024111
(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)))