
(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
(let* ((t_1 (* (- z t) y)))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 5e+217)))
(+ x (/ y (/ a (- z t))))
(+ x (/ t_1 a)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) * y;
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 5e+217)) {
tmp = x + (y / (a / (z - t)));
} else {
tmp = x + (t_1 / a);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) * y;
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 5e+217)) {
tmp = x + (y / (a / (z - t)));
} else {
tmp = x + (t_1 / a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) * y tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 5e+217): tmp = x + (y / (a / (z - t))) else: tmp = x + (t_1 / a) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) * y) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 5e+217)) tmp = Float64(x + Float64(y / Float64(a / Float64(z - t)))); else tmp = Float64(x + Float64(t_1 / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) * y; tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 5e+217))) tmp = x + (y / (a / (z - t))); else tmp = x + (t_1 / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 5e+217]], $MachinePrecision]], N[(x + N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t$95$1 / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z - t\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 5 \cdot 10^{+217}\right):\\
\;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t\_1}{a}\\
\end{array}
\end{array}
if (*.f64 y (-.f64 z t)) < -inf.0 or 5.00000000000000041e217 < (*.f64 y (-.f64 z t)) Initial program 65.1%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 65.1%
associate-*l/99.8%
associate-/r/99.9%
Simplified99.9%
if -inf.0 < (*.f64 y (-.f64 z t)) < 5.00000000000000041e217Initial program 99.4%
Final simplification99.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* (- z t) y) a)))
(if (or (<= t_1 -2e+153) (not (<= t_1 4e+85)))
(* (- z t) (/ y a))
(+ x (/ y (/ a z))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((z - t) * y) / a;
double tmp;
if ((t_1 <= -2e+153) || !(t_1 <= 4e+85)) {
tmp = (z - t) * (y / a);
} else {
tmp = x + (y / (a / z));
}
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 - t) * y) / a
if ((t_1 <= (-2d+153)) .or. (.not. (t_1 <= 4d+85))) then
tmp = (z - t) * (y / a)
else
tmp = x + (y / (a / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((z - t) * y) / a;
double tmp;
if ((t_1 <= -2e+153) || !(t_1 <= 4e+85)) {
tmp = (z - t) * (y / a);
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((z - t) * y) / a tmp = 0 if (t_1 <= -2e+153) or not (t_1 <= 4e+85): tmp = (z - t) * (y / a) else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(z - t) * y) / a) tmp = 0.0 if ((t_1 <= -2e+153) || !(t_1 <= 4e+85)) tmp = Float64(Float64(z - t) * Float64(y / a)); else tmp = Float64(x + Float64(y / Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((z - t) * y) / a; tmp = 0.0; if ((t_1 <= -2e+153) || ~((t_1 <= 4e+85))) tmp = (z - t) * (y / a); else tmp = x + (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / a), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+153], N[Not[LessEqual[t$95$1, 4e+85]], $MachinePrecision]], N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(z - t\right) \cdot y}{a}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+153} \lor \neg \left(t\_1 \leq 4 \cdot 10^{+85}\right):\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) a) < -2e153 or 4.0000000000000001e85 < (/.f64 (*.f64 y (-.f64 z t)) a) Initial program 83.8%
associate-/l*87.1%
Simplified87.1%
Taylor expanded in y around inf 81.4%
associate--l+81.4%
div-sub85.5%
Simplified85.5%
Taylor expanded in x around 0 75.4%
div-sub80.3%
Simplified80.3%
Taylor expanded in y around 0 80.2%
associate-*l/96.0%
associate-/r/87.7%
Simplified80.9%
associate-/r/89.8%
Applied egg-rr89.8%
if -2e153 < (/.f64 (*.f64 y (-.f64 z t)) a) < 4.0000000000000001e85Initial program 99.2%
associate-/l*96.3%
Simplified96.3%
Taylor expanded in t around 0 87.1%
+-commutative87.1%
associate-/l*86.5%
Simplified86.5%
clear-num86.5%
un-div-inv87.2%
Applied egg-rr87.2%
Final simplification88.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.5e-170) (not (<= a 2.7e-194))) (+ x (/ y (/ a (- z t)))) (/ (* (- z t) y) a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.5e-170) || !(a <= 2.7e-194)) {
tmp = x + (y / (a / (z - t)));
} else {
tmp = ((z - 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 ((a <= (-2.5d-170)) .or. (.not. (a <= 2.7d-194))) then
tmp = x + (y / (a / (z - t)))
else
tmp = ((z - 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 ((a <= -2.5e-170) || !(a <= 2.7e-194)) {
tmp = x + (y / (a / (z - t)));
} else {
tmp = ((z - t) * y) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.5e-170) or not (a <= 2.7e-194): tmp = x + (y / (a / (z - t))) else: tmp = ((z - t) * y) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.5e-170) || !(a <= 2.7e-194)) tmp = Float64(x + Float64(y / Float64(a / Float64(z - t)))); else tmp = Float64(Float64(Float64(z - t) * y) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.5e-170) || ~((a <= 2.7e-194))) tmp = x + (y / (a / (z - t))); else tmp = ((z - t) * y) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.5e-170], N[Not[LessEqual[a, 2.7e-194]], $MachinePrecision]], N[(x + N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.5 \cdot 10^{-170} \lor \neg \left(a \leq 2.7 \cdot 10^{-194}\right):\\
\;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(z - t\right) \cdot y}{a}\\
\end{array}
\end{array}
if a < -2.50000000000000005e-170 or 2.7e-194 < a Initial program 89.8%
associate-/l*97.0%
Simplified97.0%
Taylor expanded in y around 0 89.8%
associate-*l/97.8%
associate-/r/98.4%
Simplified98.4%
if -2.50000000000000005e-170 < a < 2.7e-194Initial program 98.1%
associate-/l*74.7%
Simplified74.7%
Taylor expanded in y around inf 64.3%
associate--l+64.3%
div-sub72.9%
Simplified72.9%
Taylor expanded in x around 0 62.7%
div-sub73.0%
Simplified73.0%
Taylor expanded in y around 0 96.5%
Final simplification97.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.05e-170) (not (<= a 2.3e-194))) (+ x (* y (/ (- z t) a))) (/ (* (- z t) y) a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.05e-170) || !(a <= 2.3e-194)) {
tmp = x + (y * ((z - t) / a));
} else {
tmp = ((z - 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 ((a <= (-2.05d-170)) .or. (.not. (a <= 2.3d-194))) then
tmp = x + (y * ((z - t) / a))
else
tmp = ((z - 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 ((a <= -2.05e-170) || !(a <= 2.3e-194)) {
tmp = x + (y * ((z - t) / a));
} else {
tmp = ((z - t) * y) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.05e-170) or not (a <= 2.3e-194): tmp = x + (y * ((z - t) / a)) else: tmp = ((z - t) * y) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.05e-170) || !(a <= 2.3e-194)) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / a))); else tmp = Float64(Float64(Float64(z - t) * y) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.05e-170) || ~((a <= 2.3e-194))) tmp = x + (y * ((z - t) / a)); else tmp = ((z - t) * y) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.05e-170], N[Not[LessEqual[a, 2.3e-194]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.05 \cdot 10^{-170} \lor \neg \left(a \leq 2.3 \cdot 10^{-194}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(z - t\right) \cdot y}{a}\\
\end{array}
\end{array}
if a < -2.04999999999999983e-170 or 2.30000000000000003e-194 < a Initial program 89.8%
associate-/l*97.0%
Simplified97.0%
if -2.04999999999999983e-170 < a < 2.30000000000000003e-194Initial program 98.1%
associate-/l*74.7%
Simplified74.7%
Taylor expanded in y around inf 64.3%
associate--l+64.3%
div-sub72.9%
Simplified72.9%
Taylor expanded in x around 0 62.7%
div-sub73.0%
Simplified73.0%
Taylor expanded in y around 0 96.5%
Final simplification96.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3.8e-27) (not (<= a 7.8e-15))) (+ x (* y (/ z a))) (* (- z t) (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.8e-27) || !(a <= 7.8e-15)) {
tmp = x + (y * (z / a));
} else {
tmp = (z - 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 ((a <= (-3.8d-27)) .or. (.not. (a <= 7.8d-15))) then
tmp = x + (y * (z / a))
else
tmp = (z - 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 ((a <= -3.8e-27) || !(a <= 7.8e-15)) {
tmp = x + (y * (z / a));
} else {
tmp = (z - t) * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -3.8e-27) or not (a <= 7.8e-15): tmp = x + (y * (z / a)) else: tmp = (z - t) * (y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3.8e-27) || !(a <= 7.8e-15)) tmp = Float64(x + Float64(y * Float64(z / a))); else tmp = Float64(Float64(z - t) * Float64(y / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -3.8e-27) || ~((a <= 7.8e-15))) tmp = x + (y * (z / a)); else tmp = (z - t) * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3.8e-27], N[Not[LessEqual[a, 7.8e-15]], $MachinePrecision]], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.8 \cdot 10^{-27} \lor \neg \left(a \leq 7.8 \cdot 10^{-15}\right):\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{a}\\
\end{array}
\end{array}
if a < -3.8e-27 or 7.80000000000000053e-15 < a Initial program 84.7%
associate-/l*99.1%
Simplified99.1%
Taylor expanded in t around 0 75.7%
+-commutative75.7%
associate-/l*82.6%
Simplified82.6%
if -3.8e-27 < a < 7.80000000000000053e-15Initial program 99.1%
associate-/l*84.3%
Simplified84.3%
Taylor expanded in y around inf 73.4%
associate--l+73.4%
div-sub77.4%
Simplified77.4%
Taylor expanded in x around 0 64.4%
div-sub69.3%
Simplified69.3%
Taylor expanded in y around 0 81.8%
associate-*l/96.1%
associate-/r/86.8%
Simplified70.2%
associate-/r/79.3%
Applied egg-rr79.3%
Final simplification81.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.9e+123) (not (<= t 1.2e+56))) (* (- z t) (/ y a)) (+ x (/ (* z y) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.9e+123) || !(t <= 1.2e+56)) {
tmp = (z - t) * (y / a);
} else {
tmp = x + ((z * y) / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-4.9d+123)) .or. (.not. (t <= 1.2d+56))) then
tmp = (z - t) * (y / a)
else
tmp = x + ((z * y) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.9e+123) || !(t <= 1.2e+56)) {
tmp = (z - t) * (y / a);
} else {
tmp = x + ((z * y) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.9e+123) or not (t <= 1.2e+56): tmp = (z - t) * (y / a) else: tmp = x + ((z * y) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.9e+123) || !(t <= 1.2e+56)) tmp = Float64(Float64(z - t) * Float64(y / a)); else tmp = Float64(x + Float64(Float64(z * y) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4.9e+123) || ~((t <= 1.2e+56))) tmp = (z - t) * (y / a); else tmp = x + ((z * y) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.9e+123], N[Not[LessEqual[t, 1.2e+56]], $MachinePrecision]], N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.9 \cdot 10^{+123} \lor \neg \left(t \leq 1.2 \cdot 10^{+56}\right):\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z \cdot y}{a}\\
\end{array}
\end{array}
if t < -4.89999999999999976e123 or 1.20000000000000007e56 < t Initial program 87.1%
associate-/l*86.1%
Simplified86.1%
Taylor expanded in y around inf 75.0%
associate--l+75.0%
div-sub78.2%
Simplified78.2%
Taylor expanded in x around 0 59.2%
div-sub63.5%
Simplified63.5%
Taylor expanded in y around 0 64.5%
associate-*l/96.8%
associate-/r/88.5%
Simplified64.9%
associate-/r/72.5%
Applied egg-rr72.5%
if -4.89999999999999976e123 < t < 1.20000000000000007e56Initial program 94.5%
associate-/l*95.3%
Simplified95.3%
Taylor expanded in z around inf 84.4%
Final simplification79.9%
(FPCore (x y z t a) :precision binary64 (if (<= a -9.6e+110) x (if (<= a 5.8e+105) (* (- z t) (/ y a)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -9.6e+110) {
tmp = x;
} else if (a <= 5.8e+105) {
tmp = (z - t) * (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 <= (-9.6d+110)) then
tmp = x
else if (a <= 5.8d+105) then
tmp = (z - t) * (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 <= -9.6e+110) {
tmp = x;
} else if (a <= 5.8e+105) {
tmp = (z - t) * (y / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -9.6e+110: tmp = x elif a <= 5.8e+105: tmp = (z - t) * (y / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -9.6e+110) tmp = x; elseif (a <= 5.8e+105) tmp = Float64(Float64(z - t) * Float64(y / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -9.6e+110) tmp = x; elseif (a <= 5.8e+105) tmp = (z - t) * (y / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -9.6e+110], x, If[LessEqual[a, 5.8e+105], N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.6 \cdot 10^{+110}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 5.8 \cdot 10^{+105}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -9.60000000000000049e110 or 5.8000000000000002e105 < a Initial program 86.1%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around inf 76.6%
if -9.60000000000000049e110 < a < 5.8000000000000002e105Initial program 94.1%
associate-/l*88.4%
Simplified88.4%
Taylor expanded in y around inf 79.8%
associate--l+79.8%
div-sub82.6%
Simplified82.6%
Taylor expanded in x around 0 63.0%
div-sub66.4%
Simplified66.4%
Taylor expanded in y around 0 70.5%
associate-*l/96.6%
associate-/r/90.2%
Simplified67.1%
associate-/r/73.4%
Applied egg-rr73.4%
Final simplification74.4%
(FPCore (x y z t a) :precision binary64 (if (<= a -9.6e+110) x (if (<= a 6.2e+102) (* y (/ (- z t) a)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -9.6e+110) {
tmp = x;
} else if (a <= 6.2e+102) {
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 (a <= (-9.6d+110)) then
tmp = x
else if (a <= 6.2d+102) 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 (a <= -9.6e+110) {
tmp = x;
} else if (a <= 6.2e+102) {
tmp = y * ((z - t) / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -9.6e+110: tmp = x elif a <= 6.2e+102: tmp = y * ((z - t) / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -9.6e+110) tmp = x; elseif (a <= 6.2e+102) 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 (a <= -9.6e+110) tmp = x; elseif (a <= 6.2e+102) tmp = y * ((z - t) / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -9.6e+110], x, If[LessEqual[a, 6.2e+102], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.6 \cdot 10^{+110}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 6.2 \cdot 10^{+102}:\\
\;\;\;\;y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -9.60000000000000049e110 or 6.19999999999999973e102 < a Initial program 86.1%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around inf 76.6%
if -9.60000000000000049e110 < a < 6.19999999999999973e102Initial program 94.1%
associate-/l*88.4%
Simplified88.4%
Taylor expanded in y around inf 79.8%
associate--l+79.8%
div-sub82.6%
Simplified82.6%
Taylor expanded in x around 0 63.0%
div-sub66.4%
Simplified66.4%
(FPCore (x y z t a) :precision binary64 (if (<= a -4.2e-23) x (if (<= a 3.7e-9) (* (/ y a) (- t)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.2e-23) {
tmp = x;
} else if (a <= 3.7e-9) {
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 <= (-4.2d-23)) then
tmp = x
else if (a <= 3.7d-9) 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 <= -4.2e-23) {
tmp = x;
} else if (a <= 3.7e-9) {
tmp = (y / a) * -t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -4.2e-23: tmp = x elif a <= 3.7e-9: tmp = (y / a) * -t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4.2e-23) tmp = x; elseif (a <= 3.7e-9) tmp = Float64(Float64(y / a) * Float64(-t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -4.2e-23) tmp = x; elseif (a <= 3.7e-9) tmp = (y / a) * -t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.2e-23], x, If[LessEqual[a, 3.7e-9], N[(N[(y / a), $MachinePrecision] * (-t)), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.2 \cdot 10^{-23}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 3.7 \cdot 10^{-9}:\\
\;\;\;\;\frac{y}{a} \cdot \left(-t\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -4.2000000000000002e-23 or 3.7e-9 < a Initial program 84.5%
associate-/l*99.1%
Simplified99.1%
Taylor expanded in x around inf 62.9%
if -4.2000000000000002e-23 < a < 3.7e-9Initial program 99.1%
associate-/l*84.6%
Simplified84.6%
Taylor expanded in y around inf 73.8%
associate--l+73.8%
div-sub77.8%
Simplified77.8%
Taylor expanded in x around 0 65.0%
div-sub69.7%
Simplified69.7%
Taylor expanded in y around 0 82.1%
associate-*l/96.1%
associate-/r/87.0%
Simplified70.7%
Taylor expanded in z around 0 48.9%
mul-1-neg48.9%
associate-/l*51.9%
distribute-rgt-neg-out51.9%
distribute-frac-neg251.9%
Simplified51.9%
Final simplification57.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -3.8e+207) (not (<= y 1.55e-17))) (* y (/ z a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -3.8e+207) || !(y <= 1.55e-17)) {
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 <= (-3.8d+207)) .or. (.not. (y <= 1.55d-17))) 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 <= -3.8e+207) || !(y <= 1.55e-17)) {
tmp = y * (z / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -3.8e+207) or not (y <= 1.55e-17): tmp = y * (z / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -3.8e+207) || !(y <= 1.55e-17)) 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 <= -3.8e+207) || ~((y <= 1.55e-17))) tmp = y * (z / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -3.8e+207], N[Not[LessEqual[y, 1.55e-17]], $MachinePrecision]], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.8 \cdot 10^{+207} \lor \neg \left(y \leq 1.55 \cdot 10^{-17}\right):\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -3.79999999999999986e207 or 1.5499999999999999e-17 < y Initial program 84.3%
associate-/l*98.7%
Simplified98.7%
Taylor expanded in y around inf 95.2%
associate--l+95.2%
div-sub98.7%
Simplified98.7%
Taylor expanded in z around inf 48.5%
if -3.79999999999999986e207 < y < 1.5499999999999999e-17Initial program 95.4%
associate-/l*88.5%
Simplified88.5%
Taylor expanded in x around inf 52.4%
Final simplification51.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.5e-170) x (if (<= a 1.15e-136) (* z (/ y a)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.5e-170) {
tmp = x;
} else if (a <= 1.15e-136) {
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 <= (-2.5d-170)) then
tmp = x
else if (a <= 1.15d-136) 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 <= -2.5e-170) {
tmp = x;
} else if (a <= 1.15e-136) {
tmp = z * (y / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.5e-170: tmp = x elif a <= 1.15e-136: tmp = z * (y / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.5e-170) tmp = x; elseif (a <= 1.15e-136) 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 <= -2.5e-170) tmp = x; elseif (a <= 1.15e-136) tmp = z * (y / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.5e-170], x, If[LessEqual[a, 1.15e-136], N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.5 \cdot 10^{-170}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.15 \cdot 10^{-136}:\\
\;\;\;\;z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.50000000000000005e-170 or 1.14999999999999999e-136 < a Initial program 89.3%
associate-/l*96.9%
Simplified96.9%
Taylor expanded in x around inf 53.6%
if -2.50000000000000005e-170 < a < 1.14999999999999999e-136Initial program 98.4%
associate-/l*78.4%
Simplified78.4%
Taylor expanded in y around inf 68.1%
associate--l+68.1%
div-sub75.4%
Simplified75.4%
Taylor expanded in x around 0 65.3%
div-sub74.1%
Simplified74.1%
Taylor expanded in z around inf 53.5%
associate-*l/56.2%
Applied egg-rr56.2%
Final simplification54.3%
(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 91.7%
+-commutative91.7%
associate-/l*91.9%
fma-define91.9%
Simplified91.9%
fma-undefine91.9%
associate-*r/91.7%
*-commutative91.7%
associate-/l*96.8%
Applied egg-rr96.8%
Final simplification96.8%
(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 91.7%
associate-/l*91.9%
Simplified91.9%
Taylor expanded in x around inf 40.8%
(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 2024144
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E"
:precision binary64
:alt
(! :herbie-platform default (if (< y -430450648655599/4000000000000000000000000) (+ x (/ 1 (/ (/ a (- z t)) y))) (if (< y 2894426862792089/10000000000000000000000000000000000000000000000000000000000000000) (+ x (/ (* y (- z t)) a)) (+ x (/ y (/ a (- z t)))))))
(+ x (/ (* y (- z t)) a)))