
(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 (fma (/ y a) (- t z) x))
double code(double x, double y, double z, double t, double a) {
return fma((y / a), (t - z), x);
}
function code(x, y, z, t, a) return fma(Float64(y / a), Float64(t - z), x) end
code[x_, y_, z_, t_, a_] := N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{y}{a}, t - z, x\right)
\end{array}
Initial program 93.7%
sub-neg93.7%
+-commutative93.7%
associate-*l/97.7%
distribute-rgt-neg-in97.7%
fma-def97.7%
sub-neg97.7%
+-commutative97.7%
distribute-neg-in97.7%
unsub-neg97.7%
remove-double-neg97.7%
Simplified97.7%
Final simplification97.7%
(FPCore (x y z t a)
:precision binary64
(if (or (<= y -100000000.0)
(and (not (<= y -7e-33))
(or (<= y -3.15e-58)
(and (not (<= y -1.6e-108))
(or (<= y -9.3e-181) (not (<= y 2.4e-60)))))))
(* y (/ (- t z) a))
x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -100000000.0) || (!(y <= -7e-33) && ((y <= -3.15e-58) || (!(y <= -1.6e-108) && ((y <= -9.3e-181) || !(y <= 2.4e-60)))))) {
tmp = y * ((t - 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 <= (-100000000.0d0)) .or. (.not. (y <= (-7d-33))) .and. (y <= (-3.15d-58)) .or. (.not. (y <= (-1.6d-108))) .and. (y <= (-9.3d-181)) .or. (.not. (y <= 2.4d-60))) then
tmp = y * ((t - 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 <= -100000000.0) || (!(y <= -7e-33) && ((y <= -3.15e-58) || (!(y <= -1.6e-108) && ((y <= -9.3e-181) || !(y <= 2.4e-60)))))) {
tmp = y * ((t - z) / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -100000000.0) or (not (y <= -7e-33) and ((y <= -3.15e-58) or (not (y <= -1.6e-108) and ((y <= -9.3e-181) or not (y <= 2.4e-60))))): tmp = y * ((t - z) / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -100000000.0) || (!(y <= -7e-33) && ((y <= -3.15e-58) || (!(y <= -1.6e-108) && ((y <= -9.3e-181) || !(y <= 2.4e-60)))))) tmp = Float64(y * Float64(Float64(t - z) / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -100000000.0) || (~((y <= -7e-33)) && ((y <= -3.15e-58) || (~((y <= -1.6e-108)) && ((y <= -9.3e-181) || ~((y <= 2.4e-60))))))) tmp = y * ((t - z) / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -100000000.0], And[N[Not[LessEqual[y, -7e-33]], $MachinePrecision], Or[LessEqual[y, -3.15e-58], And[N[Not[LessEqual[y, -1.6e-108]], $MachinePrecision], Or[LessEqual[y, -9.3e-181], N[Not[LessEqual[y, 2.4e-60]], $MachinePrecision]]]]]], N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -100000000 \lor \neg \left(y \leq -7 \cdot 10^{-33}\right) \land \left(y \leq -3.15 \cdot 10^{-58} \lor \neg \left(y \leq -1.6 \cdot 10^{-108}\right) \land \left(y \leq -9.3 \cdot 10^{-181} \lor \neg \left(y \leq 2.4 \cdot 10^{-60}\right)\right)\right):\\
\;\;\;\;y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1e8 or -6.9999999999999997e-33 < y < -3.14999999999999999e-58 or -1.6e-108 < y < -9.3000000000000001e-181 or 2.40000000000000009e-60 < y Initial program 90.0%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in x around 0 71.6%
mul-1-neg71.6%
associate-*r/77.7%
distribute-rgt-neg-in77.7%
distribute-neg-frac77.7%
neg-sub077.7%
associate--r-77.7%
neg-sub077.7%
+-commutative77.7%
sub-neg77.7%
Simplified77.7%
if -1e8 < y < -6.9999999999999997e-33 or -3.14999999999999999e-58 < y < -1.6e-108 or -9.3000000000000001e-181 < y < 2.40000000000000009e-60Initial program 99.0%
associate-*l/96.3%
Simplified96.3%
Taylor expanded in x around inf 66.2%
Final simplification72.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* z (/ y (- a)))))
(if (<= z -9.6e+87)
t_1
(if (<= z 4.4e-274) x (if (<= z 1.45e+68) (* (/ y a) t) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = z * (y / -a);
double tmp;
if (z <= -9.6e+87) {
tmp = t_1;
} else if (z <= 4.4e-274) {
tmp = x;
} else if (z <= 1.45e+68) {
tmp = (y / a) * t;
} 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 = z * (y / -a)
if (z <= (-9.6d+87)) then
tmp = t_1
else if (z <= 4.4d-274) then
tmp = x
else if (z <= 1.45d+68) then
tmp = (y / a) * t
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 = z * (y / -a);
double tmp;
if (z <= -9.6e+87) {
tmp = t_1;
} else if (z <= 4.4e-274) {
tmp = x;
} else if (z <= 1.45e+68) {
tmp = (y / a) * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = z * (y / -a) tmp = 0 if z <= -9.6e+87: tmp = t_1 elif z <= 4.4e-274: tmp = x elif z <= 1.45e+68: tmp = (y / a) * t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(z * Float64(y / Float64(-a))) tmp = 0.0 if (z <= -9.6e+87) tmp = t_1; elseif (z <= 4.4e-274) tmp = x; elseif (z <= 1.45e+68) tmp = Float64(Float64(y / a) * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = z * (y / -a); tmp = 0.0; if (z <= -9.6e+87) tmp = t_1; elseif (z <= 4.4e-274) tmp = x; elseif (z <= 1.45e+68) tmp = (y / a) * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(y / (-a)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.6e+87], t$95$1, If[LessEqual[z, 4.4e-274], x, If[LessEqual[z, 1.45e+68], N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{y}{-a}\\
\mathbf{if}\;z \leq -9.6 \cdot 10^{+87}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-274}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+68}:\\
\;\;\;\;\frac{y}{a} \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -9.59999999999999926e87 or 1.45000000000000006e68 < z Initial program 89.2%
associate-*l/97.7%
Simplified97.7%
Taylor expanded in z around inf 60.7%
mul-1-neg60.7%
associate-*l/64.2%
*-commutative64.2%
distribute-rgt-neg-in64.2%
distribute-frac-neg64.2%
*-lft-identity64.2%
metadata-eval64.2%
times-frac64.2%
neg-mul-164.2%
remove-double-neg64.2%
neg-mul-164.2%
Simplified64.2%
if -9.59999999999999926e87 < z < 4.3999999999999999e-274Initial program 96.9%
associate-*l/96.8%
Simplified96.8%
Taylor expanded in x around inf 60.3%
if 4.3999999999999999e-274 < z < 1.45000000000000006e68Initial program 95.0%
associate-*l/98.7%
Simplified98.7%
Taylor expanded in t around inf 57.0%
*-commutative57.0%
associate-*r/63.1%
Simplified63.1%
Final simplification62.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.65e-22) (not (<= z 7e+67))) (- x (/ y (/ a z))) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.65e-22) || !(z <= 7e+67)) {
tmp = x - (y / (a / z));
} else {
tmp = x + ((y * t) / 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 <= (-1.65d-22)) .or. (.not. (z <= 7d+67))) then
tmp = x - (y / (a / z))
else
tmp = x + ((y * t) / 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 <= -1.65e-22) || !(z <= 7e+67)) {
tmp = x - (y / (a / z));
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.65e-22) or not (z <= 7e+67): tmp = x - (y / (a / z)) else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.65e-22) || !(z <= 7e+67)) tmp = Float64(x - Float64(y / Float64(a / z))); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.65e-22) || ~((z <= 7e+67))) tmp = x - (y / (a / z)); else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.65e-22], N[Not[LessEqual[z, 7e+67]], $MachinePrecision]], N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{-22} \lor \neg \left(z \leq 7 \cdot 10^{+67}\right):\\
\;\;\;\;x - \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -1.65e-22 or 7e67 < z Initial program 90.7%
associate-/l*92.4%
Simplified92.4%
Taylor expanded in z around inf 82.8%
if -1.65e-22 < z < 7e67Initial program 96.0%
sub-neg96.0%
+-commutative96.0%
associate-*l/97.9%
distribute-rgt-neg-in97.9%
fma-def97.9%
sub-neg97.9%
+-commutative97.9%
distribute-neg-in97.9%
unsub-neg97.9%
remove-double-neg97.9%
Simplified97.9%
Taylor expanded in z around 0 91.4%
Final simplification87.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -1e+88) (* z (/ y (- a))) (if (<= z 3.7e+37) (+ x (/ (* y t) a)) (* y (/ (- t z) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1e+88) {
tmp = z * (y / -a);
} else if (z <= 3.7e+37) {
tmp = x + ((y * t) / a);
} else {
tmp = y * ((t - z) / 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 <= (-1d+88)) then
tmp = z * (y / -a)
else if (z <= 3.7d+37) then
tmp = x + ((y * t) / a)
else
tmp = y * ((t - z) / 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 <= -1e+88) {
tmp = z * (y / -a);
} else if (z <= 3.7e+37) {
tmp = x + ((y * t) / a);
} else {
tmp = y * ((t - z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1e+88: tmp = z * (y / -a) elif z <= 3.7e+37: tmp = x + ((y * t) / a) else: tmp = y * ((t - z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1e+88) tmp = Float64(z * Float64(y / Float64(-a))); elseif (z <= 3.7e+37) tmp = Float64(x + Float64(Float64(y * t) / a)); else tmp = Float64(y * Float64(Float64(t - z) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1e+88) tmp = z * (y / -a); elseif (z <= 3.7e+37) tmp = x + ((y * t) / a); else tmp = y * ((t - z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1e+88], N[(z * N[(y / (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.7e+37], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+88}:\\
\;\;\;\;z \cdot \frac{y}{-a}\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{+37}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{t - z}{a}\\
\end{array}
\end{array}
if z < -9.99999999999999959e87Initial program 87.8%
associate-*l/97.8%
Simplified97.8%
Taylor expanded in z around inf 64.7%
mul-1-neg64.7%
associate-*l/70.4%
*-commutative70.4%
distribute-rgt-neg-in70.4%
distribute-frac-neg70.4%
*-lft-identity70.4%
metadata-eval70.4%
times-frac70.4%
neg-mul-170.4%
remove-double-neg70.4%
neg-mul-170.4%
Simplified70.4%
if -9.99999999999999959e87 < z < 3.6999999999999999e37Initial program 97.0%
sub-neg97.0%
+-commutative97.0%
associate-*l/97.6%
distribute-rgt-neg-in97.6%
fma-def97.6%
sub-neg97.6%
+-commutative97.6%
distribute-neg-in97.6%
unsub-neg97.6%
remove-double-neg97.6%
Simplified97.6%
Taylor expanded in z around 0 89.9%
if 3.6999999999999999e37 < z Initial program 88.5%
associate-*l/97.9%
Simplified97.9%
Taylor expanded in x around 0 63.3%
mul-1-neg63.3%
associate-*r/66.9%
distribute-rgt-neg-in66.9%
distribute-neg-frac66.9%
neg-sub066.9%
associate--r-66.9%
neg-sub066.9%
+-commutative66.9%
sub-neg66.9%
Simplified66.9%
Final simplification81.9%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.7e+25) x (if (<= a 5e-129) (* (/ y a) t) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.7e+25) {
tmp = x;
} else if (a <= 5e-129) {
tmp = (y / a) * t;
} 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 <= (-1.7d+25)) then
tmp = x
else if (a <= 5d-129) then
tmp = (y / a) * t
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 <= -1.7e+25) {
tmp = x;
} else if (a <= 5e-129) {
tmp = (y / a) * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.7e+25: tmp = x elif a <= 5e-129: tmp = (y / a) * t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.7e+25) tmp = x; elseif (a <= 5e-129) tmp = Float64(Float64(y / a) * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.7e+25) tmp = x; elseif (a <= 5e-129) tmp = (y / a) * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.7e+25], x, If[LessEqual[a, 5e-129], N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.7 \cdot 10^{+25}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 5 \cdot 10^{-129}:\\
\;\;\;\;\frac{y}{a} \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.69999999999999992e25 or 5.00000000000000027e-129 < a Initial program 89.0%
associate-*l/97.1%
Simplified97.1%
Taylor expanded in x around inf 59.0%
if -1.69999999999999992e25 < a < 5.00000000000000027e-129Initial program 99.1%
associate-*l/98.3%
Simplified98.3%
Taylor expanded in t around inf 52.6%
*-commutative52.6%
associate-*r/55.8%
Simplified55.8%
Final simplification57.5%
(FPCore (x y z t a) :precision binary64 (+ x (* (/ y a) (- t z))))
double code(double x, double y, double z, double t, double a) {
return x + ((y / a) * (t - z));
}
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 / a) * (t - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y / a) * (t - z));
}
def code(x, y, z, t, a): return x + ((y / a) * (t - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y / a) * Float64(t - z))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y / a) * (t - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{a} \cdot \left(t - z\right)
\end{array}
Initial program 93.7%
associate-*l/97.7%
Simplified97.7%
Final simplification97.7%
(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 93.7%
associate-*l/97.7%
Simplified97.7%
Taylor expanded in x around inf 40.7%
Final simplification40.7%
(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 2023199
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, F"
:precision binary64
:herbie-target
(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)))