
(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 11 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 (* (/ 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 92.8%
associate-*l/98.2%
Simplified98.2%
Final simplification98.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y) (/ a z))))
(if (<= a -1.05e+28)
x
(if (<= a 5.2e-277)
t_1
(if (<= a 9.4e-175) (/ t (/ a y)) (if (<= a 2.05e-14) t_1 x))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -y / (a / z);
double tmp;
if (a <= -1.05e+28) {
tmp = x;
} else if (a <= 5.2e-277) {
tmp = t_1;
} else if (a <= 9.4e-175) {
tmp = t / (a / y);
} else if (a <= 2.05e-14) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = -y / (a / z)
if (a <= (-1.05d+28)) then
tmp = x
else if (a <= 5.2d-277) then
tmp = t_1
else if (a <= 9.4d-175) then
tmp = t / (a / y)
else if (a <= 2.05d-14) then
tmp = t_1
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = -y / (a / z);
double tmp;
if (a <= -1.05e+28) {
tmp = x;
} else if (a <= 5.2e-277) {
tmp = t_1;
} else if (a <= 9.4e-175) {
tmp = t / (a / y);
} else if (a <= 2.05e-14) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -y / (a / z) tmp = 0 if a <= -1.05e+28: tmp = x elif a <= 5.2e-277: tmp = t_1 elif a <= 9.4e-175: tmp = t / (a / y) elif a <= 2.05e-14: tmp = t_1 else: tmp = x return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(-y) / Float64(a / z)) tmp = 0.0 if (a <= -1.05e+28) tmp = x; elseif (a <= 5.2e-277) tmp = t_1; elseif (a <= 9.4e-175) tmp = Float64(t / Float64(a / y)); elseif (a <= 2.05e-14) tmp = t_1; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = -y / (a / z); tmp = 0.0; if (a <= -1.05e+28) tmp = x; elseif (a <= 5.2e-277) tmp = t_1; elseif (a <= 9.4e-175) tmp = t / (a / y); elseif (a <= 2.05e-14) tmp = t_1; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[((-y) / N[(a / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.05e+28], x, If[LessEqual[a, 5.2e-277], t$95$1, If[LessEqual[a, 9.4e-175], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.05e-14], t$95$1, x]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-y}{\frac{a}{z}}\\
\mathbf{if}\;a \leq -1.05 \cdot 10^{+28}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 5.2 \cdot 10^{-277}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 9.4 \cdot 10^{-175}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;a \leq 2.05 \cdot 10^{-14}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.04999999999999995e28 or 2.0500000000000001e-14 < a Initial program 86.8%
associate-*l/98.1%
Simplified98.1%
Taylor expanded in x around inf 61.4%
if -1.04999999999999995e28 < a < 5.2e-277 or 9.39999999999999996e-175 < a < 2.0500000000000001e-14Initial program 99.8%
associate-*l/97.8%
Simplified97.8%
Taylor expanded in z around inf 63.4%
mul-1-neg63.4%
associate-/l*58.6%
Simplified58.6%
if 5.2e-277 < a < 9.39999999999999996e-175Initial program 99.9%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in t around inf 66.1%
associate-*l/66.1%
*-commutative66.1%
Simplified66.1%
clear-num66.1%
div-inv66.1%
Applied egg-rr66.1%
Final simplification60.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ (- z) a))))
(if (<= a -4.1e+27)
x
(if (<= a 4.6e-277)
t_1
(if (<= a 4.5e-175) (/ t (/ a y)) (if (<= a 4.35e-13) t_1 x))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (-z / a);
double tmp;
if (a <= -4.1e+27) {
tmp = x;
} else if (a <= 4.6e-277) {
tmp = t_1;
} else if (a <= 4.5e-175) {
tmp = t / (a / y);
} else if (a <= 4.35e-13) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = y * (-z / a)
if (a <= (-4.1d+27)) then
tmp = x
else if (a <= 4.6d-277) then
tmp = t_1
else if (a <= 4.5d-175) then
tmp = t / (a / y)
else if (a <= 4.35d-13) then
tmp = t_1
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * (-z / a);
double tmp;
if (a <= -4.1e+27) {
tmp = x;
} else if (a <= 4.6e-277) {
tmp = t_1;
} else if (a <= 4.5e-175) {
tmp = t / (a / y);
} else if (a <= 4.35e-13) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (-z / a) tmp = 0 if a <= -4.1e+27: tmp = x elif a <= 4.6e-277: tmp = t_1 elif a <= 4.5e-175: tmp = t / (a / y) elif a <= 4.35e-13: tmp = t_1 else: tmp = x return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(Float64(-z) / a)) tmp = 0.0 if (a <= -4.1e+27) tmp = x; elseif (a <= 4.6e-277) tmp = t_1; elseif (a <= 4.5e-175) tmp = Float64(t / Float64(a / y)); elseif (a <= 4.35e-13) tmp = t_1; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (-z / a); tmp = 0.0; if (a <= -4.1e+27) tmp = x; elseif (a <= 4.6e-277) tmp = t_1; elseif (a <= 4.5e-175) tmp = t / (a / y); elseif (a <= 4.35e-13) tmp = t_1; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[((-z) / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -4.1e+27], x, If[LessEqual[a, 4.6e-277], t$95$1, If[LessEqual[a, 4.5e-175], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.35e-13], t$95$1, x]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{-z}{a}\\
\mathbf{if}\;a \leq -4.1 \cdot 10^{+27}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 4.6 \cdot 10^{-277}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 4.5 \cdot 10^{-175}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;a \leq 4.35 \cdot 10^{-13}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -4.1000000000000002e27 or 4.35000000000000014e-13 < a Initial program 86.8%
associate-*l/98.1%
Simplified98.1%
Taylor expanded in x around inf 61.4%
if -4.1000000000000002e27 < a < 4.6e-277 or 4.49999999999999998e-175 < a < 4.35000000000000014e-13Initial program 99.8%
associate-*l/97.8%
Simplified97.8%
Taylor expanded in x around 0 89.5%
mul-1-neg89.5%
distribute-frac-neg89.5%
distribute-rgt-neg-in89.5%
associate-*r/81.3%
Simplified81.3%
Taylor expanded in z around inf 58.6%
associate-*r/58.6%
neg-mul-158.6%
Simplified58.6%
if 4.6e-277 < a < 4.49999999999999998e-175Initial program 99.9%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in t around inf 66.1%
associate-*l/66.1%
*-commutative66.1%
Simplified66.1%
clear-num66.1%
div-inv66.1%
Applied egg-rr66.1%
Final simplification60.9%
(FPCore (x y z t a)
:precision binary64
(if (<= a -5.2e+28)
x
(if (<= a 2.55e-278)
(/ (* y (- z)) a)
(if (<= a 1e-244) (* (/ y a) t) (if (<= a 5e-12) (* z (/ y (- a))) x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5.2e+28) {
tmp = x;
} else if (a <= 2.55e-278) {
tmp = (y * -z) / a;
} else if (a <= 1e-244) {
tmp = (y / a) * t;
} else if (a <= 5e-12) {
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 <= (-5.2d+28)) then
tmp = x
else if (a <= 2.55d-278) then
tmp = (y * -z) / a
else if (a <= 1d-244) then
tmp = (y / a) * t
else if (a <= 5d-12) 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 <= -5.2e+28) {
tmp = x;
} else if (a <= 2.55e-278) {
tmp = (y * -z) / a;
} else if (a <= 1e-244) {
tmp = (y / a) * t;
} else if (a <= 5e-12) {
tmp = z * (y / -a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -5.2e+28: tmp = x elif a <= 2.55e-278: tmp = (y * -z) / a elif a <= 1e-244: tmp = (y / a) * t elif a <= 5e-12: tmp = z * (y / -a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -5.2e+28) tmp = x; elseif (a <= 2.55e-278) tmp = Float64(Float64(y * Float64(-z)) / a); elseif (a <= 1e-244) tmp = Float64(Float64(y / a) * t); elseif (a <= 5e-12) tmp = Float64(z * Float64(y / Float64(-a))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -5.2e+28) tmp = x; elseif (a <= 2.55e-278) tmp = (y * -z) / a; elseif (a <= 1e-244) tmp = (y / a) * t; elseif (a <= 5e-12) tmp = z * (y / -a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5.2e+28], x, If[LessEqual[a, 2.55e-278], N[(N[(y * (-z)), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[a, 1e-244], N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[a, 5e-12], N[(z * N[(y / (-a)), $MachinePrecision]), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.2 \cdot 10^{+28}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 2.55 \cdot 10^{-278}:\\
\;\;\;\;\frac{y \cdot \left(-z\right)}{a}\\
\mathbf{elif}\;a \leq 10^{-244}:\\
\;\;\;\;\frac{y}{a} \cdot t\\
\mathbf{elif}\;a \leq 5 \cdot 10^{-12}:\\
\;\;\;\;z \cdot \frac{y}{-a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -5.2000000000000004e28 or 4.9999999999999997e-12 < a Initial program 86.8%
associate-*l/98.1%
Simplified98.1%
Taylor expanded in x around inf 61.4%
if -5.2000000000000004e28 < a < 2.55000000000000005e-278Initial program 99.9%
associate-*l/97.2%
Simplified97.2%
Taylor expanded in x around 0 89.9%
mul-1-neg89.9%
distribute-frac-neg89.9%
distribute-rgt-neg-in89.9%
associate-*r/81.5%
Simplified81.5%
Taylor expanded in y around 0 89.9%
Taylor expanded in t around 0 58.1%
associate-*r*58.1%
neg-mul-158.1%
Simplified58.1%
if 2.55000000000000005e-278 < a < 9.9999999999999993e-245Initial program 100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in t around inf 70.2%
associate-*l/70.2%
*-commutative70.2%
Simplified70.2%
if 9.9999999999999993e-245 < a < 4.9999999999999997e-12Initial program 99.8%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in z around inf 72.8%
mul-1-neg72.8%
associate-*l/77.7%
*-commutative77.7%
distribute-rgt-neg-in77.7%
distribute-frac-neg77.7%
*-lft-identity77.7%
metadata-eval77.7%
times-frac77.7%
neg-mul-177.7%
neg-mul-177.7%
remove-double-neg77.7%
Simplified77.7%
Final simplification63.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1e-14) (not (<= y 1.9e-74))) (* y (/ (- t z) a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1e-14) || !(y <= 1.9e-74)) {
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 <= (-1d-14)) .or. (.not. (y <= 1.9d-74))) 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 <= -1e-14) || !(y <= 1.9e-74)) {
tmp = y * ((t - z) / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1e-14) or not (y <= 1.9e-74): tmp = y * ((t - z) / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1e-14) || !(y <= 1.9e-74)) 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 <= -1e-14) || ~((y <= 1.9e-74))) tmp = y * ((t - z) / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1e-14], N[Not[LessEqual[y, 1.9e-74]], $MachinePrecision]], N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-14} \lor \neg \left(y \leq 1.9 \cdot 10^{-74}\right):\\
\;\;\;\;y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -9.99999999999999999e-15 or 1.8999999999999998e-74 < y Initial program 88.4%
associate-*l/98.7%
Simplified98.7%
Taylor expanded in x around 0 71.8%
mul-1-neg71.8%
distribute-frac-neg71.8%
distribute-rgt-neg-in71.8%
associate-*r/80.5%
Simplified80.5%
Taylor expanded in z around 0 78.6%
mul-1-neg78.6%
sub-neg78.6%
div-sub80.5%
Simplified80.5%
if -9.99999999999999999e-15 < y < 1.8999999999999998e-74Initial program 99.9%
associate-*l/97.5%
Simplified97.5%
Taylor expanded in x around inf 66.4%
Final simplification75.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5.4e+104) (not (<= t 1.7e+45))) (+ x (* (/ y a) t)) (- x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.4e+104) || !(t <= 1.7e+45)) {
tmp = x + ((y / a) * t);
} else {
tmp = x - ((y * 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 ((t <= (-5.4d+104)) .or. (.not. (t <= 1.7d+45))) then
tmp = x + ((y / a) * t)
else
tmp = x - ((y * 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 ((t <= -5.4e+104) || !(t <= 1.7e+45)) {
tmp = x + ((y / a) * t);
} else {
tmp = x - ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5.4e+104) or not (t <= 1.7e+45): tmp = x + ((y / a) * t) else: tmp = x - ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5.4e+104) || !(t <= 1.7e+45)) tmp = Float64(x + Float64(Float64(y / a) * t)); else tmp = Float64(x - Float64(Float64(y * z) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -5.4e+104) || ~((t <= 1.7e+45))) tmp = x + ((y / a) * t); else tmp = x - ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5.4e+104], N[Not[LessEqual[t, 1.7e+45]], $MachinePrecision]], N[(x + N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.4 \cdot 10^{+104} \lor \neg \left(t \leq 1.7 \cdot 10^{+45}\right):\\
\;\;\;\;x + \frac{y}{a} \cdot t\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if t < -5.39999999999999969e104 or 1.7e45 < t Initial program 86.3%
associate-*l/99.4%
Simplified99.4%
Taylor expanded in z around 0 78.3%
cancel-sign-sub-inv78.3%
metadata-eval78.3%
*-lft-identity78.3%
+-commutative78.3%
associate-*l/89.0%
*-commutative89.0%
Simplified89.0%
if -5.39999999999999969e104 < t < 1.7e45Initial program 96.8%
associate-*l/97.5%
Simplified97.5%
Taylor expanded in z around inf 89.6%
Final simplification89.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.1e+179) (* z (/ y (- a))) (if (<= z 6.6e+183) (+ x (* (/ y a) t)) (* y (/ (- t z) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.1e+179) {
tmp = z * (y / -a);
} else if (z <= 6.6e+183) {
tmp = x + ((y / a) * t);
} 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 <= (-2.1d+179)) then
tmp = z * (y / -a)
else if (z <= 6.6d+183) then
tmp = x + ((y / a) * t)
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 <= -2.1e+179) {
tmp = z * (y / -a);
} else if (z <= 6.6e+183) {
tmp = x + ((y / a) * t);
} else {
tmp = y * ((t - z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.1e+179: tmp = z * (y / -a) elif z <= 6.6e+183: tmp = x + ((y / a) * t) else: tmp = y * ((t - z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.1e+179) tmp = Float64(z * Float64(y / Float64(-a))); elseif (z <= 6.6e+183) tmp = Float64(x + Float64(Float64(y / a) * t)); 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 <= -2.1e+179) tmp = z * (y / -a); elseif (z <= 6.6e+183) tmp = x + ((y / a) * t); else tmp = y * ((t - z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.1e+179], N[(z * N[(y / (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.6e+183], N[(x + N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{+179}:\\
\;\;\;\;z \cdot \frac{y}{-a}\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{+183}:\\
\;\;\;\;x + \frac{y}{a} \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{t - z}{a}\\
\end{array}
\end{array}
if z < -2.0999999999999999e179Initial program 90.5%
associate-*l/98.3%
Simplified98.3%
Taylor expanded in z around inf 70.4%
mul-1-neg70.4%
associate-*l/75.2%
*-commutative75.2%
distribute-rgt-neg-in75.2%
distribute-frac-neg75.2%
*-lft-identity75.2%
metadata-eval75.2%
times-frac75.2%
neg-mul-175.2%
neg-mul-175.2%
remove-double-neg75.2%
Simplified75.2%
if -2.0999999999999999e179 < z < 6.60000000000000019e183Initial program 94.8%
associate-*l/98.9%
Simplified98.9%
Taylor expanded in z around 0 76.1%
cancel-sign-sub-inv76.1%
metadata-eval76.1%
*-lft-identity76.1%
+-commutative76.1%
associate-*l/82.2%
*-commutative82.2%
Simplified82.2%
if 6.60000000000000019e183 < z Initial program 84.2%
associate-*l/94.4%
Simplified94.4%
Taylor expanded in x around 0 70.5%
mul-1-neg70.5%
distribute-frac-neg70.5%
distribute-rgt-neg-in70.5%
associate-*r/80.9%
Simplified80.9%
Taylor expanded in z around 0 78.1%
mul-1-neg78.1%
sub-neg78.1%
div-sub80.9%
Simplified80.9%
Final simplification81.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -6.2e+26) x (if (<= a 3.05e-16) (* z (/ y (- a))) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6.2e+26) {
tmp = x;
} else if (a <= 3.05e-16) {
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 <= (-6.2d+26)) then
tmp = x
else if (a <= 3.05d-16) 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 <= -6.2e+26) {
tmp = x;
} else if (a <= 3.05e-16) {
tmp = z * (y / -a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -6.2e+26: tmp = x elif a <= 3.05e-16: tmp = z * (y / -a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -6.2e+26) tmp = x; elseif (a <= 3.05e-16) tmp = Float64(z * Float64(y / Float64(-a))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -6.2e+26) tmp = x; elseif (a <= 3.05e-16) tmp = z * (y / -a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -6.2e+26], x, If[LessEqual[a, 3.05e-16], N[(z * N[(y / (-a)), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.2 \cdot 10^{+26}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 3.05 \cdot 10^{-16}:\\
\;\;\;\;z \cdot \frac{y}{-a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -6.1999999999999999e26 or 3.04999999999999976e-16 < a Initial program 86.8%
associate-*l/98.1%
Simplified98.1%
Taylor expanded in x around inf 61.4%
if -6.1999999999999999e26 < a < 3.04999999999999976e-16Initial program 99.9%
associate-*l/98.3%
Simplified98.3%
Taylor expanded in z around inf 60.0%
mul-1-neg60.0%
associate-*l/61.2%
*-commutative61.2%
distribute-rgt-neg-in61.2%
distribute-frac-neg61.2%
*-lft-identity61.2%
metadata-eval61.2%
times-frac61.2%
neg-mul-161.2%
neg-mul-161.2%
remove-double-neg61.2%
Simplified61.2%
Final simplification61.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -4.8e+32) (not (<= y 3.3e-24))) (* (/ y a) t) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -4.8e+32) || !(y <= 3.3e-24)) {
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 ((y <= (-4.8d+32)) .or. (.not. (y <= 3.3d-24))) 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 ((y <= -4.8e+32) || !(y <= 3.3e-24)) {
tmp = (y / a) * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -4.8e+32) or not (y <= 3.3e-24): tmp = (y / a) * t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -4.8e+32) || !(y <= 3.3e-24)) 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 ((y <= -4.8e+32) || ~((y <= 3.3e-24))) tmp = (y / a) * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -4.8e+32], N[Not[LessEqual[y, 3.3e-24]], $MachinePrecision]], N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{+32} \lor \neg \left(y \leq 3.3 \cdot 10^{-24}\right):\\
\;\;\;\;\frac{y}{a} \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -4.79999999999999983e32 or 3.29999999999999984e-24 < y Initial program 87.1%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in t around inf 41.6%
associate-*l/48.9%
*-commutative48.9%
Simplified48.9%
if -4.79999999999999983e32 < y < 3.29999999999999984e-24Initial program 99.8%
associate-*l/97.8%
Simplified97.8%
Taylor expanded in x around inf 62.3%
Final simplification54.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -9.6e+33) (not (<= y 1.6e-22))) (/ t (/ a y)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -9.6e+33) || !(y <= 1.6e-22)) {
tmp = t / (a / y);
} 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 <= (-9.6d+33)) .or. (.not. (y <= 1.6d-22))) then
tmp = t / (a / y)
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 <= -9.6e+33) || !(y <= 1.6e-22)) {
tmp = t / (a / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -9.6e+33) or not (y <= 1.6e-22): tmp = t / (a / y) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -9.6e+33) || !(y <= 1.6e-22)) tmp = Float64(t / Float64(a / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -9.6e+33) || ~((y <= 1.6e-22))) tmp = t / (a / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -9.6e+33], N[Not[LessEqual[y, 1.6e-22]], $MachinePrecision]], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.6 \cdot 10^{+33} \lor \neg \left(y \leq 1.6 \cdot 10^{-22}\right):\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -9.5999999999999999e33 or 1.59999999999999994e-22 < y Initial program 87.1%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in t around inf 41.6%
associate-*l/48.9%
*-commutative48.9%
Simplified48.9%
clear-num48.9%
div-inv49.0%
Applied egg-rr49.0%
if -9.5999999999999999e33 < y < 1.59999999999999994e-22Initial program 99.8%
associate-*l/97.8%
Simplified97.8%
Taylor expanded in x around inf 62.3%
Final simplification54.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 92.8%
associate-*l/98.2%
Simplified98.2%
Taylor expanded in x around inf 38.7%
Final simplification38.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 2023187
(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)))