
(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 13 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 (if (<= (- z t) -2e+143) (+ x (/ (* (- z t) y) a)) (+ x (/ y (/ a (- z t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z - t) <= -2e+143) {
tmp = x + (((z - t) * y) / a);
} else {
tmp = x + (y / (a / (z - t)));
}
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 - t) <= (-2d+143)) then
tmp = x + (((z - t) * y) / a)
else
tmp = x + (y / (a / (z - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z - t) <= -2e+143) {
tmp = x + (((z - t) * y) / a);
} else {
tmp = x + (y / (a / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z - t) <= -2e+143: tmp = x + (((z - t) * y) / a) else: tmp = x + (y / (a / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(z - t) <= -2e+143) tmp = Float64(x + Float64(Float64(Float64(z - t) * y) / a)); else tmp = Float64(x + Float64(y / Float64(a / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z - t) <= -2e+143) tmp = x + (((z - t) * y) / a); else tmp = x + (y / (a / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(z - t), $MachinePrecision], -2e+143], N[(x + N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z - t \leq -2 \cdot 10^{+143}:\\
\;\;\;\;x + \frac{\left(z - t\right) \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\
\end{array}
\end{array}
if (-.f64 z t) < -2e143Initial program 98.5%
if -2e143 < (-.f64 z t) Initial program 96.0%
associate-/l*98.9%
Simplified98.9%
Final simplification98.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* y (/ t a)))))
(if (<= a -1.8e-13)
x
(if (<= a -1.7e-130)
(/ z (/ a y))
(if (<= a 4.2e-277)
t_1
(if (<= a 1.35e-236) (* z (/ y a)) (if (<= a 5e-80) t_1 x)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -(y * (t / a));
double tmp;
if (a <= -1.8e-13) {
tmp = x;
} else if (a <= -1.7e-130) {
tmp = z / (a / y);
} else if (a <= 4.2e-277) {
tmp = t_1;
} else if (a <= 1.35e-236) {
tmp = z * (y / a);
} else if (a <= 5e-80) {
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 * (t / a))
if (a <= (-1.8d-13)) then
tmp = x
else if (a <= (-1.7d-130)) then
tmp = z / (a / y)
else if (a <= 4.2d-277) then
tmp = t_1
else if (a <= 1.35d-236) then
tmp = z * (y / a)
else if (a <= 5d-80) 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 * (t / a));
double tmp;
if (a <= -1.8e-13) {
tmp = x;
} else if (a <= -1.7e-130) {
tmp = z / (a / y);
} else if (a <= 4.2e-277) {
tmp = t_1;
} else if (a <= 1.35e-236) {
tmp = z * (y / a);
} else if (a <= 5e-80) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -(y * (t / a)) tmp = 0 if a <= -1.8e-13: tmp = x elif a <= -1.7e-130: tmp = z / (a / y) elif a <= 4.2e-277: tmp = t_1 elif a <= 1.35e-236: tmp = z * (y / a) elif a <= 5e-80: tmp = t_1 else: tmp = x return tmp
function code(x, y, z, t, a) t_1 = Float64(-Float64(y * Float64(t / a))) tmp = 0.0 if (a <= -1.8e-13) tmp = x; elseif (a <= -1.7e-130) tmp = Float64(z / Float64(a / y)); elseif (a <= 4.2e-277) tmp = t_1; elseif (a <= 1.35e-236) tmp = Float64(z * Float64(y / a)); elseif (a <= 5e-80) tmp = t_1; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = -(y * (t / a)); tmp = 0.0; if (a <= -1.8e-13) tmp = x; elseif (a <= -1.7e-130) tmp = z / (a / y); elseif (a <= 4.2e-277) tmp = t_1; elseif (a <= 1.35e-236) tmp = z * (y / a); elseif (a <= 5e-80) tmp = t_1; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = (-N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[a, -1.8e-13], x, If[LessEqual[a, -1.7e-130], N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.2e-277], t$95$1, If[LessEqual[a, 1.35e-236], N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5e-80], t$95$1, x]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -y \cdot \frac{t}{a}\\
\mathbf{if}\;a \leq -1.8 \cdot 10^{-13}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -1.7 \cdot 10^{-130}:\\
\;\;\;\;\frac{z}{\frac{a}{y}}\\
\mathbf{elif}\;a \leq 4.2 \cdot 10^{-277}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 1.35 \cdot 10^{-236}:\\
\;\;\;\;z \cdot \frac{y}{a}\\
\mathbf{elif}\;a \leq 5 \cdot 10^{-80}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.7999999999999999e-13 or 5e-80 < a Initial program 95.0%
associate-*l/97.4%
Simplified97.4%
Taylor expanded in x around inf 59.5%
if -1.7999999999999999e-13 < a < -1.70000000000000003e-130Initial program 99.9%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around inf 89.6%
Taylor expanded in z around inf 64.1%
associate-*l/69.0%
associate-/l*74.1%
Applied egg-rr74.1%
if -1.70000000000000003e-130 < a < 4.1999999999999999e-277 or 1.35e-236 < a < 5e-80Initial program 99.8%
associate-*l/94.4%
Simplified94.4%
Taylor expanded in y around inf 77.4%
Taylor expanded in z around 0 59.2%
mul-1-neg59.2%
distribute-frac-neg59.2%
Simplified59.2%
if 4.1999999999999999e-277 < a < 1.35e-236Initial program 94.6%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around inf 67.4%
Taylor expanded in z around 0 67.4%
mul-1-neg67.4%
distribute-frac-neg67.4%
+-commutative67.4%
distribute-frac-neg67.4%
sub-neg67.4%
div-sub78.8%
Simplified78.8%
Taylor expanded in z around inf 48.7%
associate-*l/64.5%
Simplified64.5%
Final simplification60.9%
(FPCore (x y z t a)
:precision binary64
(if (<= a -6.4e-12)
x
(if (<= a -1.75e-130)
(/ z (/ a y))
(if (<= a 4e-277)
(/ (* t (- y)) a)
(if (<= a 7e-236)
(* z (/ y a))
(if (<= a 5.2e-80) (- (* y (/ t a))) x))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6.4e-12) {
tmp = x;
} else if (a <= -1.75e-130) {
tmp = z / (a / y);
} else if (a <= 4e-277) {
tmp = (t * -y) / a;
} else if (a <= 7e-236) {
tmp = z * (y / a);
} else if (a <= 5.2e-80) {
tmp = -(y * (t / 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.4d-12)) then
tmp = x
else if (a <= (-1.75d-130)) then
tmp = z / (a / y)
else if (a <= 4d-277) then
tmp = (t * -y) / a
else if (a <= 7d-236) then
tmp = z * (y / a)
else if (a <= 5.2d-80) then
tmp = -(y * (t / 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.4e-12) {
tmp = x;
} else if (a <= -1.75e-130) {
tmp = z / (a / y);
} else if (a <= 4e-277) {
tmp = (t * -y) / a;
} else if (a <= 7e-236) {
tmp = z * (y / a);
} else if (a <= 5.2e-80) {
tmp = -(y * (t / a));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -6.4e-12: tmp = x elif a <= -1.75e-130: tmp = z / (a / y) elif a <= 4e-277: tmp = (t * -y) / a elif a <= 7e-236: tmp = z * (y / a) elif a <= 5.2e-80: tmp = -(y * (t / a)) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -6.4e-12) tmp = x; elseif (a <= -1.75e-130) tmp = Float64(z / Float64(a / y)); elseif (a <= 4e-277) tmp = Float64(Float64(t * Float64(-y)) / a); elseif (a <= 7e-236) tmp = Float64(z * Float64(y / a)); elseif (a <= 5.2e-80) tmp = Float64(-Float64(y * Float64(t / a))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -6.4e-12) tmp = x; elseif (a <= -1.75e-130) tmp = z / (a / y); elseif (a <= 4e-277) tmp = (t * -y) / a; elseif (a <= 7e-236) tmp = z * (y / a); elseif (a <= 5.2e-80) tmp = -(y * (t / a)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -6.4e-12], x, If[LessEqual[a, -1.75e-130], N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4e-277], N[(N[(t * (-y)), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[a, 7e-236], N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.2e-80], (-N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), x]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.4 \cdot 10^{-12}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -1.75 \cdot 10^{-130}:\\
\;\;\;\;\frac{z}{\frac{a}{y}}\\
\mathbf{elif}\;a \leq 4 \cdot 10^{-277}:\\
\;\;\;\;\frac{t \cdot \left(-y\right)}{a}\\
\mathbf{elif}\;a \leq 7 \cdot 10^{-236}:\\
\;\;\;\;z \cdot \frac{y}{a}\\
\mathbf{elif}\;a \leq 5.2 \cdot 10^{-80}:\\
\;\;\;\;-y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -6.4000000000000002e-12 or 5.2000000000000002e-80 < a Initial program 95.0%
associate-*l/97.4%
Simplified97.4%
Taylor expanded in x around inf 59.5%
if -6.4000000000000002e-12 < a < -1.75e-130Initial program 99.9%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around inf 89.6%
Taylor expanded in z around inf 64.1%
associate-*l/69.0%
associate-/l*74.1%
Applied egg-rr74.1%
if -1.75e-130 < a < 3.99999999999999988e-277Initial program 99.9%
associate-*l/95.5%
Simplified95.5%
Taylor expanded in y around inf 79.9%
sub-div84.7%
associate-*l/91.1%
Applied egg-rr91.1%
Taylor expanded in z around 0 63.7%
associate-*r*63.7%
neg-mul-163.7%
Simplified63.7%
if 3.99999999999999988e-277 < a < 6.99999999999999988e-236Initial program 94.6%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around inf 67.4%
Taylor expanded in z around 0 67.4%
mul-1-neg67.4%
distribute-frac-neg67.4%
+-commutative67.4%
distribute-frac-neg67.4%
sub-neg67.4%
div-sub78.8%
Simplified78.8%
Taylor expanded in z around inf 48.7%
associate-*l/64.5%
Simplified64.5%
if 6.99999999999999988e-236 < a < 5.2000000000000002e-80Initial program 99.8%
associate-*l/92.5%
Simplified92.5%
Taylor expanded in y around inf 73.0%
Taylor expanded in z around 0 55.2%
mul-1-neg55.2%
distribute-frac-neg55.2%
Simplified55.2%
Final simplification61.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.25e-108) (not (<= y 8e-114))) (* y (/ (- z t) a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.25e-108) || !(y <= 8e-114)) {
tmp = y * ((z - t) / 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.25d-108)) .or. (.not. (y <= 8d-114))) then
tmp = y * ((z - t) / 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.25e-108) || !(y <= 8e-114)) {
tmp = y * ((z - t) / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.25e-108) or not (y <= 8e-114): tmp = y * ((z - t) / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.25e-108) || !(y <= 8e-114)) tmp = Float64(y * Float64(Float64(z - t) / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1.25e-108) || ~((y <= 8e-114))) tmp = y * ((z - t) / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.25e-108], N[Not[LessEqual[y, 8e-114]], $MachinePrecision]], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{-108} \lor \neg \left(y \leq 8 \cdot 10^{-114}\right):\\
\;\;\;\;y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.25e-108 or 8.0000000000000004e-114 < y Initial program 95.6%
associate-*l/97.8%
Simplified97.8%
Taylor expanded in y around inf 71.3%
Taylor expanded in z around 0 71.3%
mul-1-neg71.3%
distribute-frac-neg71.3%
+-commutative71.3%
distribute-frac-neg71.3%
sub-neg71.3%
div-sub74.2%
Simplified74.2%
if -1.25e-108 < y < 8.0000000000000004e-114Initial program 98.8%
associate-*l/95.4%
Simplified95.4%
Taylor expanded in x around inf 70.2%
Final simplification72.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.02e+120) (not (<= y 44.0))) (* y (/ (- z t) a)) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.02e+120) || !(y <= 44.0)) {
tmp = y * ((z - t) / 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 ((y <= (-1.02d+120)) .or. (.not. (y <= 44.0d0))) then
tmp = y * ((z - t) / 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 ((y <= -1.02e+120) || !(y <= 44.0)) {
tmp = y * ((z - t) / a);
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.02e+120) or not (y <= 44.0): tmp = y * ((z - t) / a) else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.02e+120) || !(y <= 44.0)) tmp = Float64(y * Float64(Float64(z - t) / a)); else tmp = Float64(x + Float64(z * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1.02e+120) || ~((y <= 44.0))) tmp = y * ((z - t) / a); else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.02e+120], N[Not[LessEqual[y, 44.0]], $MachinePrecision]], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.02 \cdot 10^{+120} \lor \neg \left(y \leq 44\right):\\
\;\;\;\;y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if y < -1.01999999999999997e120 or 44 < y Initial program 92.8%
associate-*l/96.4%
Simplified96.4%
Taylor expanded in y around inf 82.0%
Taylor expanded in z around 0 82.0%
mul-1-neg82.0%
distribute-frac-neg82.0%
+-commutative82.0%
distribute-frac-neg82.0%
sub-neg82.0%
div-sub85.8%
Simplified85.8%
if -1.01999999999999997e120 < y < 44Initial program 99.3%
associate-*l/97.4%
Simplified97.4%
Taylor expanded in t around 0 76.2%
associate-*l/77.5%
*-commutative77.5%
Simplified77.5%
Final simplification80.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -9.2e+120) (not (<= y 230.0))) (* y (/ (- z t) a)) (+ x (/ z (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -9.2e+120) || !(y <= 230.0)) {
tmp = y * ((z - t) / a);
} else {
tmp = x + (z / (a / y));
}
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.2d+120)) .or. (.not. (y <= 230.0d0))) then
tmp = y * ((z - t) / a)
else
tmp = x + (z / (a / y))
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.2e+120) || !(y <= 230.0)) {
tmp = y * ((z - t) / a);
} else {
tmp = x + (z / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -9.2e+120) or not (y <= 230.0): tmp = y * ((z - t) / a) else: tmp = x + (z / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -9.2e+120) || !(y <= 230.0)) tmp = Float64(y * Float64(Float64(z - t) / a)); else tmp = Float64(x + Float64(z / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -9.2e+120) || ~((y <= 230.0))) tmp = y * ((z - t) / a); else tmp = x + (z / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -9.2e+120], N[Not[LessEqual[y, 230.0]], $MachinePrecision]], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.2 \cdot 10^{+120} \lor \neg \left(y \leq 230\right):\\
\;\;\;\;y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\
\end{array}
\end{array}
if y < -9.1999999999999997e120 or 230 < y Initial program 92.8%
associate-*l/96.4%
Simplified96.4%
Taylor expanded in y around inf 82.0%
Taylor expanded in z around 0 82.0%
mul-1-neg82.0%
distribute-frac-neg82.0%
+-commutative82.0%
distribute-frac-neg82.0%
sub-neg82.0%
div-sub85.8%
Simplified85.8%
if -9.1999999999999997e120 < y < 230Initial program 99.3%
associate-*l/97.4%
Simplified97.4%
Taylor expanded in t around 0 76.2%
associate-*l/77.5%
*-commutative77.5%
Simplified77.5%
clear-num77.4%
div-inv77.5%
Applied egg-rr77.5%
Final simplification80.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.8e+52) (not (<= z 8500000000.0))) (+ x (/ z (/ a y))) (- x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.8e+52) || !(z <= 8500000000.0)) {
tmp = x + (z / (a / y));
} 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 <= (-1.8d+52)) .or. (.not. (z <= 8500000000.0d0))) then
tmp = x + (z / (a / y))
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 <= -1.8e+52) || !(z <= 8500000000.0)) {
tmp = x + (z / (a / y));
} else {
tmp = x - (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.8e+52) or not (z <= 8500000000.0): tmp = x + (z / (a / y)) else: tmp = x - (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.8e+52) || !(z <= 8500000000.0)) tmp = Float64(x + Float64(z / Float64(a / y))); 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 <= -1.8e+52) || ~((z <= 8500000000.0))) tmp = x + (z / (a / y)); else tmp = x - (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.8e+52], N[Not[LessEqual[z, 8500000000.0]], $MachinePrecision]], N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+52} \lor \neg \left(z \leq 8500000000\right):\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -1.8e52 or 8.5e9 < z Initial program 96.2%
associate-*l/98.9%
Simplified98.9%
Taylor expanded in t around 0 89.2%
associate-*l/91.9%
*-commutative91.9%
Simplified91.9%
clear-num91.9%
div-inv92.0%
Applied egg-rr92.0%
if -1.8e52 < z < 8.5e9Initial program 96.9%
associate-*l/95.7%
Simplified95.7%
Taylor expanded in z around 0 88.4%
mul-1-neg88.4%
associate-*l/88.5%
distribute-rgt-neg-out88.5%
+-commutative88.5%
*-commutative88.5%
distribute-lft-neg-out88.5%
unsub-neg88.5%
Simplified88.5%
Final simplification89.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.85e+54) (not (<= z 14500000000.0))) (+ x (/ z (/ a y))) (- x (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.85e+54) || !(z <= 14500000000.0)) {
tmp = x + (z / (a / y));
} else {
tmp = x - (t / (a / y));
}
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.85d+54)) .or. (.not. (z <= 14500000000.0d0))) then
tmp = x + (z / (a / y))
else
tmp = x - (t / (a / y))
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.85e+54) || !(z <= 14500000000.0)) {
tmp = x + (z / (a / y));
} else {
tmp = x - (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.85e+54) or not (z <= 14500000000.0): tmp = x + (z / (a / y)) else: tmp = x - (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.85e+54) || !(z <= 14500000000.0)) tmp = Float64(x + Float64(z / Float64(a / y))); else tmp = Float64(x - Float64(t / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.85e+54) || ~((z <= 14500000000.0))) tmp = x + (z / (a / y)); else tmp = x - (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.85e+54], N[Not[LessEqual[z, 14500000000.0]], $MachinePrecision]], N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+54} \lor \neg \left(z \leq 14500000000\right):\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -1.8500000000000001e54 or 1.45e10 < z Initial program 96.2%
associate-*l/98.9%
Simplified98.9%
Taylor expanded in t around 0 89.2%
associate-*l/91.9%
*-commutative91.9%
Simplified91.9%
clear-num91.9%
div-inv92.0%
Applied egg-rr92.0%
if -1.8500000000000001e54 < z < 1.45e10Initial program 96.9%
associate-*l/95.7%
Simplified95.7%
Taylor expanded in z around 0 88.4%
mul-1-neg88.4%
associate-*l/88.5%
distribute-rgt-neg-out88.5%
+-commutative88.5%
*-commutative88.5%
distribute-lft-neg-out88.5%
unsub-neg88.5%
Simplified88.5%
clear-num88.5%
div-inv88.6%
Applied egg-rr88.6%
Final simplification89.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.5e+60) (not (<= z 20000000000.0))) (+ x (/ z (/ a y))) (- x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.5e+60) || !(z <= 20000000000.0)) {
tmp = x + (z / (a / y));
} else {
tmp = x - (y / (a / t));
}
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 <= (-8.5d+60)) .or. (.not. (z <= 20000000000.0d0))) then
tmp = x + (z / (a / y))
else
tmp = x - (y / (a / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.5e+60) || !(z <= 20000000000.0)) {
tmp = x + (z / (a / y));
} else {
tmp = x - (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.5e+60) or not (z <= 20000000000.0): tmp = x + (z / (a / y)) else: tmp = x - (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.5e+60) || !(z <= 20000000000.0)) tmp = Float64(x + Float64(z / Float64(a / y))); else tmp = Float64(x - Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -8.5e+60) || ~((z <= 20000000000.0))) tmp = x + (z / (a / y)); else tmp = x - (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.5e+60], N[Not[LessEqual[z, 20000000000.0]], $MachinePrecision]], N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+60} \lor \neg \left(z \leq 20000000000\right):\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -8.50000000000000064e60 or 2e10 < z Initial program 96.2%
associate-*l/98.9%
Simplified98.9%
Taylor expanded in t around 0 89.2%
associate-*l/91.9%
*-commutative91.9%
Simplified91.9%
clear-num91.9%
div-inv92.0%
Applied egg-rr92.0%
if -8.50000000000000064e60 < z < 2e10Initial program 96.9%
associate-*l/95.7%
Simplified95.7%
*-commutative95.7%
clear-num95.7%
un-div-inv96.1%
Applied egg-rr96.1%
Taylor expanded in z around 0 88.4%
+-commutative88.4%
mul-1-neg88.4%
associate-*l/88.5%
distribute-lft-neg-out88.5%
cancel-sign-sub-inv88.5%
associate-/r/89.6%
Simplified89.6%
Final simplification90.5%
(FPCore (x y z t a) :precision binary64 (if (<= a -8.5e-13) x (if (<= a 9.6e-154) (* z (/ y a)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -8.5e-13) {
tmp = x;
} else if (a <= 9.6e-154) {
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 <= (-8.5d-13)) then
tmp = x
else if (a <= 9.6d-154) 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 <= -8.5e-13) {
tmp = x;
} else if (a <= 9.6e-154) {
tmp = z * (y / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -8.5e-13: tmp = x elif a <= 9.6e-154: tmp = z * (y / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -8.5e-13) tmp = x; elseif (a <= 9.6e-154) 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 <= -8.5e-13) tmp = x; elseif (a <= 9.6e-154) tmp = z * (y / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -8.5e-13], x, If[LessEqual[a, 9.6e-154], N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.5 \cdot 10^{-13}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 9.6 \cdot 10^{-154}:\\
\;\;\;\;z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -8.5000000000000001e-13 or 9.59999999999999947e-154 < a Initial program 95.3%
associate-*l/97.0%
Simplified97.0%
Taylor expanded in x around inf 56.8%
if -8.5000000000000001e-13 < a < 9.59999999999999947e-154Initial program 98.9%
associate-*l/96.9%
Simplified96.9%
Taylor expanded in y around inf 79.2%
Taylor expanded in z around 0 79.2%
mul-1-neg79.2%
distribute-frac-neg79.2%
+-commutative79.2%
distribute-frac-neg79.2%
sub-neg79.2%
div-sub84.7%
Simplified84.7%
Taylor expanded in z around inf 50.0%
associate-*l/54.1%
Simplified54.1%
Final simplification55.8%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.55e-11) x (if (<= a 2.5e-156) (/ z (/ a y)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.55e-11) {
tmp = x;
} else if (a <= 2.5e-156) {
tmp = z / (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 (a <= (-2.55d-11)) then
tmp = x
else if (a <= 2.5d-156) then
tmp = z / (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 (a <= -2.55e-11) {
tmp = x;
} else if (a <= 2.5e-156) {
tmp = z / (a / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.55e-11: tmp = x elif a <= 2.5e-156: tmp = z / (a / y) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.55e-11) tmp = x; elseif (a <= 2.5e-156) tmp = Float64(z / Float64(a / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.55e-11) tmp = x; elseif (a <= 2.5e-156) tmp = z / (a / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.55e-11], x, If[LessEqual[a, 2.5e-156], N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.55 \cdot 10^{-11}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 2.5 \cdot 10^{-156}:\\
\;\;\;\;\frac{z}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.54999999999999992e-11 or 2.50000000000000004e-156 < a Initial program 95.3%
associate-*l/97.0%
Simplified97.0%
Taylor expanded in x around inf 56.8%
if -2.54999999999999992e-11 < a < 2.50000000000000004e-156Initial program 98.9%
associate-*l/96.9%
Simplified96.9%
Taylor expanded in y around inf 79.2%
Taylor expanded in z around inf 48.7%
associate-*l/50.0%
associate-/l*54.6%
Applied egg-rr54.6%
Final simplification56.0%
(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 96.6%
associate-*l/97.0%
Simplified97.0%
Final simplification97.0%
(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 96.6%
associate-*l/97.0%
Simplified97.0%
Taylor expanded in x around inf 40.6%
Final simplification40.6%
(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 2023174
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E"
: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)))