
(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 (/ (- z t) (/ a y))))
double code(double x, double y, double z, double t, double a) {
return x + ((z - t) / (a / y));
}
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) / (a / y))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z - t) / (a / y));
}
def code(x, y, z, t, a): return x + ((z - t) / (a / y))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z - t) / Float64(a / y))) end
function tmp = code(x, y, z, t, a) tmp = x + ((z - t) / (a / y)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{z - t}{\frac{a}{y}}
\end{array}
Initial program 92.1%
*-commutative92.1%
associate-/l*97.2%
Simplified97.2%
Final simplification97.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (- z t) y)))
(if (or (<= t_1 -5e+276) (not (<= t_1 INFINITY)))
(* y (/ (- z t) a))
(+ 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 <= -5e+276) || !(t_1 <= ((double) INFINITY))) {
tmp = y * ((z - t) / a);
} 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 <= -5e+276) || !(t_1 <= Double.POSITIVE_INFINITY)) {
tmp = y * ((z - t) / a);
} 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 <= -5e+276) or not (t_1 <= math.inf): tmp = y * ((z - t) / a) 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 <= -5e+276) || !(t_1 <= Inf)) tmp = Float64(y * Float64(Float64(z - t) / a)); 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 <= -5e+276) || ~((t_1 <= Inf))) tmp = y * ((z - t) / a); 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, -5e+276], N[Not[LessEqual[t$95$1, Infinity]], $MachinePrecision]], N[(y * N[(N[(z - t), $MachinePrecision] / a), $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 -5 \cdot 10^{+276} \lor \neg \left(t_1 \leq \infty\right):\\
\;\;\;\;y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t_1}{a}\\
\end{array}
\end{array}
if (*.f64 y (-.f64 z t)) < -5.00000000000000001e276 or +inf.0 < (*.f64 y (-.f64 z t)) Initial program 58.3%
Taylor expanded in x around 0 58.3%
*-commutative58.3%
associate-*l/89.4%
Applied egg-rr89.4%
if -5.00000000000000001e276 < (*.f64 y (-.f64 z t)) < +inf.0Initial program 96.1%
Final simplification95.4%
(FPCore (x y z t a)
:precision binary64
(if (or (<= y -9.4e-194)
(not (or (<= y 6e-87) (and (not (<= y 2.4e-29)) (<= y 7.6e-19)))))
(* y (/ (- z t) a))
x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -9.4e-194) || !((y <= 6e-87) || (!(y <= 2.4e-29) && (y <= 7.6e-19)))) {
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 <= (-9.4d-194)) .or. (.not. (y <= 6d-87) .or. (.not. (y <= 2.4d-29)) .and. (y <= 7.6d-19))) 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 <= -9.4e-194) || !((y <= 6e-87) || (!(y <= 2.4e-29) && (y <= 7.6e-19)))) {
tmp = y * ((z - t) / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -9.4e-194) or not ((y <= 6e-87) or (not (y <= 2.4e-29) and (y <= 7.6e-19))): tmp = y * ((z - t) / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -9.4e-194) || !((y <= 6e-87) || (!(y <= 2.4e-29) && (y <= 7.6e-19)))) 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 <= -9.4e-194) || ~(((y <= 6e-87) || (~((y <= 2.4e-29)) && (y <= 7.6e-19))))) tmp = y * ((z - t) / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -9.4e-194], N[Not[Or[LessEqual[y, 6e-87], And[N[Not[LessEqual[y, 2.4e-29]], $MachinePrecision], LessEqual[y, 7.6e-19]]]], $MachinePrecision]], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.4 \cdot 10^{-194} \lor \neg \left(y \leq 6 \cdot 10^{-87} \lor \neg \left(y \leq 2.4 \cdot 10^{-29}\right) \land y \leq 7.6 \cdot 10^{-19}\right):\\
\;\;\;\;y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -9.4000000000000005e-194 or 6.00000000000000033e-87 < y < 2.39999999999999992e-29 or 7.6e-19 < y Initial program 89.9%
Taylor expanded in x around 0 66.7%
*-commutative66.7%
associate-*l/70.8%
Applied egg-rr70.8%
if -9.4000000000000005e-194 < y < 6.00000000000000033e-87 or 2.39999999999999992e-29 < y < 7.6e-19Initial program 98.4%
Taylor expanded in x around inf 70.8%
Final simplification70.8%
(FPCore (x y z t a)
:precision binary64
(if (<= a -7e+73)
x
(if (or (<= a -9.4e-95) (and (not (<= a -6.5e-131)) (<= a 0.00055)))
(* y (/ z a))
x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -7e+73) {
tmp = x;
} else if ((a <= -9.4e-95) || (!(a <= -6.5e-131) && (a <= 0.00055))) {
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 (a <= (-7d+73)) then
tmp = x
else if ((a <= (-9.4d-95)) .or. (.not. (a <= (-6.5d-131))) .and. (a <= 0.00055d0)) 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 (a <= -7e+73) {
tmp = x;
} else if ((a <= -9.4e-95) || (!(a <= -6.5e-131) && (a <= 0.00055))) {
tmp = y * (z / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -7e+73: tmp = x elif (a <= -9.4e-95) or (not (a <= -6.5e-131) and (a <= 0.00055)): tmp = y * (z / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -7e+73) tmp = x; elseif ((a <= -9.4e-95) || (!(a <= -6.5e-131) && (a <= 0.00055))) 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 (a <= -7e+73) tmp = x; elseif ((a <= -9.4e-95) || (~((a <= -6.5e-131)) && (a <= 0.00055))) tmp = y * (z / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -7e+73], x, If[Or[LessEqual[a, -9.4e-95], And[N[Not[LessEqual[a, -6.5e-131]], $MachinePrecision], LessEqual[a, 0.00055]]], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7 \cdot 10^{+73}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -9.4 \cdot 10^{-95} \lor \neg \left(a \leq -6.5 \cdot 10^{-131}\right) \land a \leq 0.00055:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -7.00000000000000004e73 or -9.3999999999999995e-95 < a < -6.5000000000000002e-131 or 5.50000000000000033e-4 < a Initial program 86.8%
Taylor expanded in x around inf 57.4%
if -7.00000000000000004e73 < a < -9.3999999999999995e-95 or -6.5000000000000002e-131 < a < 5.50000000000000033e-4Initial program 98.2%
Taylor expanded in z around inf 70.1%
associate-*l/71.8%
*-commutative71.8%
Simplified71.8%
clear-num71.7%
un-div-inv70.9%
Applied egg-rr70.9%
+-commutative70.9%
associate-/r/67.0%
fma-def67.0%
Applied egg-rr67.0%
Taylor expanded in z around inf 58.3%
associate-*r/54.6%
Simplified54.6%
Final simplification56.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* z (/ y a))))
(if (<= a -4.2e+73)
x
(if (<= a 1.65e-247)
t_1
(if (<= a 2.7e-159) (* y (/ (- t) a)) (if (<= a 3.9e-10) t_1 x))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = z * (y / a);
double tmp;
if (a <= -4.2e+73) {
tmp = x;
} else if (a <= 1.65e-247) {
tmp = t_1;
} else if (a <= 2.7e-159) {
tmp = y * (-t / a);
} else if (a <= 3.9e-10) {
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 = z * (y / a)
if (a <= (-4.2d+73)) then
tmp = x
else if (a <= 1.65d-247) then
tmp = t_1
else if (a <= 2.7d-159) then
tmp = y * (-t / a)
else if (a <= 3.9d-10) 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 = z * (y / a);
double tmp;
if (a <= -4.2e+73) {
tmp = x;
} else if (a <= 1.65e-247) {
tmp = t_1;
} else if (a <= 2.7e-159) {
tmp = y * (-t / a);
} else if (a <= 3.9e-10) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = z * (y / a) tmp = 0 if a <= -4.2e+73: tmp = x elif a <= 1.65e-247: tmp = t_1 elif a <= 2.7e-159: tmp = y * (-t / a) elif a <= 3.9e-10: tmp = t_1 else: tmp = x return tmp
function code(x, y, z, t, a) t_1 = Float64(z * Float64(y / a)) tmp = 0.0 if (a <= -4.2e+73) tmp = x; elseif (a <= 1.65e-247) tmp = t_1; elseif (a <= 2.7e-159) tmp = Float64(y * Float64(Float64(-t) / a)); elseif (a <= 3.9e-10) tmp = t_1; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = z * (y / a); tmp = 0.0; if (a <= -4.2e+73) tmp = x; elseif (a <= 1.65e-247) tmp = t_1; elseif (a <= 2.7e-159) tmp = y * (-t / a); elseif (a <= 3.9e-10) tmp = t_1; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -4.2e+73], x, If[LessEqual[a, 1.65e-247], t$95$1, If[LessEqual[a, 2.7e-159], N[(y * N[((-t) / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.9e-10], t$95$1, x]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{y}{a}\\
\mathbf{if}\;a \leq -4.2 \cdot 10^{+73}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.65 \cdot 10^{-247}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 2.7 \cdot 10^{-159}:\\
\;\;\;\;y \cdot \frac{-t}{a}\\
\mathbf{elif}\;a \leq 3.9 \cdot 10^{-10}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -4.2000000000000003e73 or 3.9e-10 < a Initial program 85.8%
Taylor expanded in x around inf 57.9%
if -4.2000000000000003e73 < a < 1.64999999999999986e-247 or 2.7e-159 < a < 3.9e-10Initial program 98.1%
Taylor expanded in x around 0 83.7%
Taylor expanded in z around inf 59.9%
associate-*l/76.6%
*-commutative76.6%
Simplified61.9%
if 1.64999999999999986e-247 < a < 2.7e-159Initial program 99.8%
Taylor expanded in x around 0 80.2%
Taylor expanded in z around 0 71.2%
mul-1-neg71.2%
associate-*l/58.9%
distribute-rgt-neg-in58.9%
Simplified58.9%
Final simplification59.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.95e-84) (+ x (* z (/ y a))) (if (<= z 1.18e-35) (- x (* t (/ y a))) (+ x (/ z (/ a y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.95e-84) {
tmp = x + (z * (y / a));
} else if (z <= 1.18e-35) {
tmp = x - (t * (y / 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 (z <= (-1.95d-84)) then
tmp = x + (z * (y / a))
else if (z <= 1.18d-35) then
tmp = x - (t * (y / 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 (z <= -1.95e-84) {
tmp = x + (z * (y / a));
} else if (z <= 1.18e-35) {
tmp = x - (t * (y / a));
} else {
tmp = x + (z / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.95e-84: tmp = x + (z * (y / a)) elif z <= 1.18e-35: tmp = x - (t * (y / a)) else: tmp = x + (z / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.95e-84) tmp = Float64(x + Float64(z * Float64(y / a))); elseif (z <= 1.18e-35) tmp = Float64(x - Float64(t * Float64(y / 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 (z <= -1.95e-84) tmp = x + (z * (y / a)); elseif (z <= 1.18e-35) tmp = x - (t * (y / a)); else tmp = x + (z / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.95e-84], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.18e-35], N[(x - N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{-84}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 1.18 \cdot 10^{-35}:\\
\;\;\;\;x - t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -1.95000000000000011e-84Initial program 92.9%
Taylor expanded in z around inf 80.3%
associate-*l/84.7%
*-commutative84.7%
Simplified84.7%
if -1.95000000000000011e-84 < z < 1.17999999999999999e-35Initial program 93.7%
Taylor expanded in z around 0 90.3%
mul-1-neg90.3%
associate-*l/92.0%
unsub-neg92.0%
associate-*l/90.3%
associate-*r/91.3%
Simplified91.3%
if 1.17999999999999999e-35 < z Initial program 89.1%
Taylor expanded in z around inf 81.6%
associate-*l/85.0%
*-commutative85.0%
Simplified85.0%
clear-num85.0%
un-div-inv85.0%
Applied egg-rr85.0%
Final simplification87.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -2e-84) (+ x (* z (/ y a))) (if (<= z 1e-34) (- x (* y (/ t a))) (+ x (/ z (/ a y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e-84) {
tmp = x + (z * (y / a));
} else if (z <= 1e-34) {
tmp = x - (y * (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 (z <= (-2d-84)) then
tmp = x + (z * (y / a))
else if (z <= 1d-34) then
tmp = x - (y * (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 (z <= -2e-84) {
tmp = x + (z * (y / a));
} else if (z <= 1e-34) {
tmp = x - (y * (t / a));
} else {
tmp = x + (z / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2e-84: tmp = x + (z * (y / a)) elif z <= 1e-34: tmp = x - (y * (t / a)) else: tmp = x + (z / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2e-84) tmp = Float64(x + Float64(z * Float64(y / a))); elseif (z <= 1e-34) tmp = Float64(x - Float64(y * Float64(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 (z <= -2e-84) tmp = x + (z * (y / a)); elseif (z <= 1e-34) tmp = x - (y * (t / a)); else tmp = x + (z / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2e-84], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e-34], N[(x - N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-84}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 10^{-34}:\\
\;\;\;\;x - y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -2.0000000000000001e-84Initial program 92.9%
Taylor expanded in z around inf 80.3%
associate-*l/84.7%
*-commutative84.7%
Simplified84.7%
if -2.0000000000000001e-84 < z < 9.99999999999999928e-35Initial program 93.7%
Taylor expanded in z around 0 90.3%
mul-1-neg90.3%
associate-*l/92.0%
unsub-neg92.0%
*-commutative92.0%
Simplified92.0%
if 9.99999999999999928e-35 < z Initial program 89.1%
Taylor expanded in z around inf 81.6%
associate-*l/85.0%
*-commutative85.0%
Simplified85.0%
clear-num85.0%
un-div-inv85.0%
Applied egg-rr85.0%
Final simplification87.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -2e-84) (+ x (* z (/ y a))) (if (<= z 3.6e-36) (- x (/ t (/ a y))) (+ x (/ z (/ a y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e-84) {
tmp = x + (z * (y / a));
} else if (z <= 3.6e-36) {
tmp = x - (t / (a / y));
} 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 (z <= (-2d-84)) then
tmp = x + (z * (y / a))
else if (z <= 3.6d-36) then
tmp = x - (t / (a / y))
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 (z <= -2e-84) {
tmp = x + (z * (y / a));
} else if (z <= 3.6e-36) {
tmp = x - (t / (a / y));
} else {
tmp = x + (z / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2e-84: tmp = x + (z * (y / a)) elif z <= 3.6e-36: tmp = x - (t / (a / y)) else: tmp = x + (z / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2e-84) tmp = Float64(x + Float64(z * Float64(y / a))); elseif (z <= 3.6e-36) tmp = Float64(x - Float64(t / Float64(a / y))); 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 (z <= -2e-84) tmp = x + (z * (y / a)); elseif (z <= 3.6e-36) tmp = x - (t / (a / y)); else tmp = x + (z / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2e-84], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6e-36], N[(x - N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-84}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-36}:\\
\;\;\;\;x - \frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -2.0000000000000001e-84Initial program 92.9%
Taylor expanded in z around inf 80.3%
associate-*l/84.7%
*-commutative84.7%
Simplified84.7%
if -2.0000000000000001e-84 < z < 3.60000000000000032e-36Initial program 93.7%
Taylor expanded in z around 0 90.3%
mul-1-neg90.3%
associate-*l/92.0%
unsub-neg92.0%
*-commutative92.0%
Simplified92.0%
Taylor expanded in y around 0 90.3%
associate-/l*92.1%
Simplified92.1%
if 3.60000000000000032e-36 < z Initial program 89.1%
Taylor expanded in z around inf 81.6%
associate-*l/85.0%
*-commutative85.0%
Simplified85.0%
clear-num85.0%
un-div-inv85.0%
Applied egg-rr85.0%
Final simplification88.0%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.1e+74) x (if (<= a 5.4e-12) (* z (/ y a)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.1e+74) {
tmp = x;
} else if (a <= 5.4e-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 <= (-2.1d+74)) then
tmp = x
else if (a <= 5.4d-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 <= -2.1e+74) {
tmp = x;
} else if (a <= 5.4e-12) {
tmp = z * (y / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.1e+74: tmp = x elif a <= 5.4e-12: tmp = z * (y / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.1e+74) tmp = x; elseif (a <= 5.4e-12) 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.1e+74) tmp = x; elseif (a <= 5.4e-12) tmp = z * (y / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.1e+74], x, If[LessEqual[a, 5.4e-12], N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.1 \cdot 10^{+74}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 5.4 \cdot 10^{-12}:\\
\;\;\;\;z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.0999999999999999e74 or 5.39999999999999961e-12 < a Initial program 85.8%
Taylor expanded in x around inf 57.9%
if -2.0999999999999999e74 < a < 5.39999999999999961e-12Initial program 98.3%
Taylor expanded in x around 0 83.3%
Taylor expanded in z around inf 55.5%
associate-*l/72.4%
*-commutative72.4%
Simplified58.0%
Final simplification57.9%
(FPCore (x y z t a) :precision binary64 (if (<= t 6.4e+184) (+ x (* z (/ y a))) (* t (/ (- y) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 6.4e+184) {
tmp = x + (z * (y / a));
} else {
tmp = t * (-y / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 6.4d+184) then
tmp = x + (z * (y / a))
else
tmp = t * (-y / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 6.4e+184) {
tmp = x + (z * (y / a));
} else {
tmp = t * (-y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 6.4e+184: tmp = x + (z * (y / a)) else: tmp = t * (-y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 6.4e+184) tmp = Float64(x + Float64(z * Float64(y / a))); else tmp = Float64(t * Float64(Float64(-y) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 6.4e+184) tmp = x + (z * (y / a)); else tmp = t * (-y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 6.4e+184], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[((-y) / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 6.4 \cdot 10^{+184}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{-y}{a}\\
\end{array}
\end{array}
if t < 6.39999999999999966e184Initial program 92.9%
Taylor expanded in z around inf 74.6%
associate-*l/79.1%
*-commutative79.1%
Simplified79.1%
if 6.39999999999999966e184 < t Initial program 83.6%
Taylor expanded in z around 0 79.4%
mul-1-neg79.4%
associate-*l/83.3%
unsub-neg83.3%
*-commutative83.3%
Simplified83.3%
Taylor expanded in y around 0 79.4%
associate-/l*91.3%
Simplified91.3%
Taylor expanded in x around 0 62.6%
mul-1-neg62.6%
associate-*r/74.8%
distribute-rgt-neg-out74.8%
distribute-neg-frac74.8%
Simplified74.8%
Final simplification78.7%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 92.1%
Taylor expanded in x around inf 37.4%
Final simplification37.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ a (- z t))))
(if (< y -1.0761266216389975e-10)
(+ x (/ 1.0 (/ t_1 y)))
(if (< y 2.894426862792089e-49)
(+ x (/ (* y (- z t)) a))
(+ x (/ y t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a / (z - t);
double tmp;
if (y < -1.0761266216389975e-10) {
tmp = x + (1.0 / (t_1 / y));
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) / a);
} else {
tmp = x + (y / t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = a / (z - t)
if (y < (-1.0761266216389975d-10)) then
tmp = x + (1.0d0 / (t_1 / y))
else if (y < 2.894426862792089d-49) then
tmp = x + ((y * (z - t)) / a)
else
tmp = x + (y / t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a / (z - t);
double tmp;
if (y < -1.0761266216389975e-10) {
tmp = x + (1.0 / (t_1 / y));
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) / a);
} else {
tmp = x + (y / t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a / (z - t) tmp = 0 if y < -1.0761266216389975e-10: tmp = x + (1.0 / (t_1 / y)) elif y < 2.894426862792089e-49: tmp = x + ((y * (z - t)) / a) else: tmp = x + (y / t_1) return tmp
function code(x, y, z, t, a) t_1 = Float64(a / Float64(z - t)) tmp = 0.0 if (y < -1.0761266216389975e-10) tmp = Float64(x + Float64(1.0 / Float64(t_1 / y))); elseif (y < 2.894426862792089e-49) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) / a)); else tmp = Float64(x + Float64(y / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a / (z - t); tmp = 0.0; if (y < -1.0761266216389975e-10) tmp = x + (1.0 / (t_1 / y)); elseif (y < 2.894426862792089e-49) tmp = x + ((y * (z - t)) / a); else tmp = x + (y / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -1.0761266216389975e-10], N[(x + N[(1.0 / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Less[y, 2.894426862792089e-49], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a}{z - t}\\
\mathbf{if}\;y < -1.0761266216389975 \cdot 10^{-10}:\\
\;\;\;\;x + \frac{1}{\frac{t_1}{y}}\\
\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{t_1}\\
\end{array}
\end{array}
herbie shell --seed 2023336
(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)))