
(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.9%
associate-*l/96.5%
Simplified96.5%
*-commutative96.5%
clear-num96.5%
un-div-inv96.9%
Applied egg-rr96.9%
Final simplification96.9%
(FPCore (x y z t a)
:precision binary64
(if (<= a -5e+180)
x
(if (or (<= a -4.9e+131) (and (not (<= a -2.1e+63)) (<= a 2.2e+106)))
(* y (/ (- t z) a))
x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5e+180) {
tmp = x;
} else if ((a <= -4.9e+131) || (!(a <= -2.1e+63) && (a <= 2.2e+106))) {
tmp = y * ((t - z) / a);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-5d+180)) then
tmp = x
else if ((a <= (-4.9d+131)) .or. (.not. (a <= (-2.1d+63))) .and. (a <= 2.2d+106)) then
tmp = y * ((t - z) / a)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5e+180) {
tmp = x;
} else if ((a <= -4.9e+131) || (!(a <= -2.1e+63) && (a <= 2.2e+106))) {
tmp = y * ((t - z) / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -5e+180: tmp = x elif (a <= -4.9e+131) or (not (a <= -2.1e+63) and (a <= 2.2e+106)): tmp = y * ((t - z) / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -5e+180) tmp = x; elseif ((a <= -4.9e+131) || (!(a <= -2.1e+63) && (a <= 2.2e+106))) tmp = Float64(y * Float64(Float64(t - z) / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -5e+180) tmp = x; elseif ((a <= -4.9e+131) || (~((a <= -2.1e+63)) && (a <= 2.2e+106))) tmp = y * ((t - z) / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5e+180], x, If[Or[LessEqual[a, -4.9e+131], And[N[Not[LessEqual[a, -2.1e+63]], $MachinePrecision], LessEqual[a, 2.2e+106]]], N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5 \cdot 10^{+180}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -4.9 \cdot 10^{+131} \lor \neg \left(a \leq -2.1 \cdot 10^{+63}\right) \land a \leq 2.2 \cdot 10^{+106}:\\
\;\;\;\;y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -4.9999999999999996e180 or -4.90000000000000032e131 < a < -2.1000000000000002e63 or 2.19999999999999992e106 < a Initial program 87.2%
associate-*l/95.2%
Simplified95.2%
Taylor expanded in x around inf 70.0%
if -4.9999999999999996e180 < a < -4.90000000000000032e131 or -2.1000000000000002e63 < a < 2.19999999999999992e106Initial program 95.6%
associate-*l/97.1%
Simplified97.1%
Taylor expanded in y around inf 74.1%
div-sub76.5%
Simplified76.5%
Final simplification74.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* z (/ (- y) a))))
(if (<= y -1.3e+51)
t_1
(if (<= y 1.25e-60) x (if (<= y 1.65e+58) t_1 (/ t (/ a y)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = z * (-y / a);
double tmp;
if (y <= -1.3e+51) {
tmp = t_1;
} else if (y <= 1.25e-60) {
tmp = x;
} else if (y <= 1.65e+58) {
tmp = t_1;
} else {
tmp = 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) :: t_1
real(8) :: tmp
t_1 = z * (-y / a)
if (y <= (-1.3d+51)) then
tmp = t_1
else if (y <= 1.25d-60) then
tmp = x
else if (y <= 1.65d+58) then
tmp = t_1
else
tmp = t / (a / y)
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 (y <= -1.3e+51) {
tmp = t_1;
} else if (y <= 1.25e-60) {
tmp = x;
} else if (y <= 1.65e+58) {
tmp = t_1;
} else {
tmp = t / (a / y);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = z * (-y / a) tmp = 0 if y <= -1.3e+51: tmp = t_1 elif y <= 1.25e-60: tmp = x elif y <= 1.65e+58: tmp = t_1 else: tmp = t / (a / y) return tmp
function code(x, y, z, t, a) t_1 = Float64(z * Float64(Float64(-y) / a)) tmp = 0.0 if (y <= -1.3e+51) tmp = t_1; elseif (y <= 1.25e-60) tmp = x; elseif (y <= 1.65e+58) tmp = t_1; else tmp = Float64(t / Float64(a / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = z * (-y / a); tmp = 0.0; if (y <= -1.3e+51) tmp = t_1; elseif (y <= 1.25e-60) tmp = x; elseif (y <= 1.65e+58) tmp = t_1; else tmp = t / (a / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[((-y) / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.3e+51], t$95$1, If[LessEqual[y, 1.25e-60], x, If[LessEqual[y, 1.65e+58], t$95$1, N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{-y}{a}\\
\mathbf{if}\;y \leq -1.3 \cdot 10^{+51}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{-60}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{+58}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if y < -1.3000000000000001e51 or 1.25e-60 < y < 1.64999999999999991e58Initial program 93.8%
associate-*l/97.5%
Simplified97.5%
Taylor expanded in z around inf 49.2%
mul-1-neg49.2%
associate-*l/51.8%
*-commutative51.8%
Simplified51.8%
if -1.3000000000000001e51 < y < 1.25e-60Initial program 98.4%
associate-*l/95.8%
Simplified95.8%
Taylor expanded in x around inf 56.5%
if 1.64999999999999991e58 < y Initial program 80.2%
associate-*l/96.5%
Simplified96.5%
Taylor expanded in t around inf 55.1%
associate-/l*63.1%
Simplified63.1%
Final simplification56.5%
(FPCore (x y z t a) :precision binary64 (if (<= y -1.1e+51) (* z (/ (- y) a)) (if (<= y 1.4e-59) x (if (<= y 1.12e+55) (- (/ z (/ a y))) (/ t (/ a y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.1e+51) {
tmp = z * (-y / a);
} else if (y <= 1.4e-59) {
tmp = x;
} else if (y <= 1.12e+55) {
tmp = -(z / (a / y));
} else {
tmp = 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 (y <= (-1.1d+51)) then
tmp = z * (-y / a)
else if (y <= 1.4d-59) then
tmp = x
else if (y <= 1.12d+55) then
tmp = -(z / (a / y))
else
tmp = 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 (y <= -1.1e+51) {
tmp = z * (-y / a);
} else if (y <= 1.4e-59) {
tmp = x;
} else if (y <= 1.12e+55) {
tmp = -(z / (a / y));
} else {
tmp = t / (a / y);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.1e+51: tmp = z * (-y / a) elif y <= 1.4e-59: tmp = x elif y <= 1.12e+55: tmp = -(z / (a / y)) else: tmp = t / (a / y) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.1e+51) tmp = Float64(z * Float64(Float64(-y) / a)); elseif (y <= 1.4e-59) tmp = x; elseif (y <= 1.12e+55) tmp = Float64(-Float64(z / Float64(a / y))); else tmp = Float64(t / Float64(a / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.1e+51) tmp = z * (-y / a); elseif (y <= 1.4e-59) tmp = x; elseif (y <= 1.12e+55) tmp = -(z / (a / y)); else tmp = t / (a / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.1e+51], N[(z * N[((-y) / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.4e-59], x, If[LessEqual[y, 1.12e+55], (-N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{+51}:\\
\;\;\;\;z \cdot \frac{-y}{a}\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{-59}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.12 \cdot 10^{+55}:\\
\;\;\;\;-\frac{z}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if y < -1.09999999999999996e51Initial program 91.6%
associate-*l/98.0%
Simplified98.0%
Taylor expanded in z around inf 47.9%
mul-1-neg47.9%
associate-*l/52.1%
*-commutative52.1%
Simplified52.1%
if -1.09999999999999996e51 < y < 1.3999999999999999e-59Initial program 98.4%
associate-*l/95.8%
Simplified95.8%
Taylor expanded in x around inf 56.5%
if 1.3999999999999999e-59 < y < 1.12000000000000006e55Initial program 96.8%
associate-*l/96.8%
Simplified96.8%
*-commutative96.8%
clear-num97.1%
un-div-inv97.0%
Applied egg-rr97.0%
Taylor expanded in z around inf 51.2%
associate-/l*49.3%
associate-*r/49.3%
neg-mul-149.3%
associate-/r/51.3%
Simplified51.3%
neg-mul-151.3%
associate-/l*51.4%
associate-*l/51.4%
neg-mul-151.4%
Applied egg-rr51.4%
if 1.12000000000000006e55 < y Initial program 80.2%
associate-*l/96.5%
Simplified96.5%
Taylor expanded in t around inf 55.1%
associate-/l*63.1%
Simplified63.1%
Final simplification56.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.7e+186) (not (<= z 3.5e+120))) (* y (/ (- t z) a)) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.7e+186) || !(z <= 3.5e+120)) {
tmp = y * ((t - z) / a);
} 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 <= (-2.7d+186)) .or. (.not. (z <= 3.5d+120))) then
tmp = y * ((t - z) / a)
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 <= -2.7e+186) || !(z <= 3.5e+120)) {
tmp = y * ((t - z) / a);
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.7e+186) or not (z <= 3.5e+120): tmp = y * ((t - z) / a) else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.7e+186) || !(z <= 3.5e+120)) tmp = Float64(y * Float64(Float64(t - z) / a)); 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 <= -2.7e+186) || ~((z <= 3.5e+120))) tmp = y * ((t - z) / a); else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.7e+186], N[Not[LessEqual[z, 3.5e+120]], $MachinePrecision]], N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+186} \lor \neg \left(z \leq 3.5 \cdot 10^{+120}\right):\\
\;\;\;\;y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -2.6999999999999999e186 or 3.50000000000000007e120 < z Initial program 84.8%
associate-*l/95.7%
Simplified95.7%
Taylor expanded in y around inf 72.2%
div-sub78.0%
Simplified78.0%
if -2.6999999999999999e186 < z < 3.50000000000000007e120Initial program 95.9%
associate-*l/96.8%
Simplified96.8%
*-commutative96.8%
clear-num96.8%
un-div-inv97.3%
Applied egg-rr97.3%
Taylor expanded in z around 0 79.8%
cancel-sign-sub-inv79.8%
metadata-eval79.8%
*-lft-identity79.8%
+-commutative79.8%
associate-*r/80.7%
Simplified80.7%
Final simplification80.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.1e+21) (not (<= t 8.5e+14))) (+ x (* t (/ y a))) (- x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.1e+21) || !(t <= 8.5e+14)) {
tmp = x + (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) :: tmp
if ((t <= (-4.1d+21)) .or. (.not. (t <= 8.5d+14))) then
tmp = x + (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 tmp;
if ((t <= -4.1e+21) || !(t <= 8.5e+14)) {
tmp = x + (t * (y / a));
} else {
tmp = x - (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.1e+21) or not (t <= 8.5e+14): tmp = x + (t * (y / a)) else: tmp = x - (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.1e+21) || !(t <= 8.5e+14)) tmp = Float64(x + Float64(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) tmp = 0.0; if ((t <= -4.1e+21) || ~((t <= 8.5e+14))) tmp = x + (t * (y / a)); else tmp = x - (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.1e+21], N[Not[LessEqual[t, 8.5e+14]], $MachinePrecision]], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.1 \cdot 10^{+21} \lor \neg \left(t \leq 8.5 \cdot 10^{+14}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -4.1e21 or 8.5e14 < t Initial program 90.7%
associate-*l/97.6%
Simplified97.6%
*-commutative97.6%
clear-num97.5%
un-div-inv97.6%
Applied egg-rr97.6%
Taylor expanded in z around 0 82.1%
cancel-sign-sub-inv82.1%
metadata-eval82.1%
*-lft-identity82.1%
+-commutative82.1%
associate-*r/86.7%
Simplified86.7%
if -4.1e21 < t < 8.5e14Initial program 94.9%
associate-*l/95.5%
Simplified95.5%
Taylor expanded in z around inf 82.7%
associate-/l*84.2%
Simplified84.2%
Final simplification85.4%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.25e+23) (- x (/ y (/ (- a) t))) (if (<= t 1e+15) (- x (/ y (/ a z))) (+ x (* t (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.25e+23) {
tmp = x - (y / (-a / t));
} else if (t <= 1e+15) {
tmp = x - (y / (a / z));
} 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 (t <= (-1.25d+23)) then
tmp = x - (y / (-a / t))
else if (t <= 1d+15) then
tmp = x - (y / (a / z))
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 (t <= -1.25e+23) {
tmp = x - (y / (-a / t));
} else if (t <= 1e+15) {
tmp = x - (y / (a / z));
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.25e+23: tmp = x - (y / (-a / t)) elif t <= 1e+15: tmp = x - (y / (a / z)) else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.25e+23) tmp = Float64(x - Float64(y / Float64(Float64(-a) / t))); elseif (t <= 1e+15) tmp = Float64(x - Float64(y / Float64(a / z))); 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 (t <= -1.25e+23) tmp = x - (y / (-a / t)); elseif (t <= 1e+15) tmp = x - (y / (a / z)); else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.25e+23], N[(x - N[(y / N[((-a) / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1e+15], N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.25 \cdot 10^{+23}:\\
\;\;\;\;x - \frac{y}{\frac{-a}{t}}\\
\mathbf{elif}\;t \leq 10^{+15}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -1.25e23Initial program 88.5%
associate-/l*98.4%
Simplified98.4%
Taylor expanded in z around 0 86.9%
associate-*r/86.9%
neg-mul-186.9%
Simplified86.9%
if -1.25e23 < t < 1e15Initial program 94.9%
associate-*l/95.5%
Simplified95.5%
Taylor expanded in z around inf 82.7%
associate-/l*84.2%
Simplified84.2%
if 1e15 < t Initial program 92.6%
associate-*l/96.9%
Simplified96.9%
*-commutative96.9%
clear-num96.9%
un-div-inv97.0%
Applied egg-rr97.0%
Taylor expanded in z around 0 83.8%
cancel-sign-sub-inv83.8%
metadata-eval83.8%
*-lft-identity83.8%
+-commutative83.8%
associate-*r/86.6%
Simplified86.6%
Final simplification85.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.35e+114) (not (<= y 26.0))) (* y (/ t a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.35e+114) || !(y <= 26.0)) {
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 ((y <= (-1.35d+114)) .or. (.not. (y <= 26.0d0))) 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 ((y <= -1.35e+114) || !(y <= 26.0)) {
tmp = y * (t / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.35e+114) or not (y <= 26.0): tmp = y * (t / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.35e+114) || !(y <= 26.0)) tmp = 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 ((y <= -1.35e+114) || ~((y <= 26.0))) tmp = y * (t / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.35e+114], N[Not[LessEqual[y, 26.0]], $MachinePrecision]], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{+114} \lor \neg \left(y \leq 26\right):\\
\;\;\;\;y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.35e114 or 26 < y Initial program 87.4%
associate-*l/96.5%
Simplified96.5%
Taylor expanded in t around inf 49.8%
associate-*l/54.1%
Simplified54.1%
if -1.35e114 < y < 26Initial program 97.3%
associate-*l/96.5%
Simplified96.5%
Taylor expanded in x around inf 53.0%
Final simplification53.5%
(FPCore (x y z t a) :precision binary64 (if (<= y -1.5e+51) (* t (/ y a)) (if (<= y 1400.0) x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.5e+51) {
tmp = t * (y / a);
} else if (y <= 1400.0) {
tmp = x;
} else {
tmp = y * (t / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-1.5d+51)) then
tmp = t * (y / a)
else if (y <= 1400.0d0) then
tmp = x
else
tmp = y * (t / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.5e+51) {
tmp = t * (y / a);
} else if (y <= 1400.0) {
tmp = x;
} else {
tmp = y * (t / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.5e+51: tmp = t * (y / a) elif y <= 1400.0: tmp = x else: tmp = y * (t / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.5e+51) tmp = Float64(t * Float64(y / a)); elseif (y <= 1400.0) tmp = x; else tmp = Float64(y * Float64(t / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.5e+51) tmp = t * (y / a); elseif (y <= 1400.0) tmp = x; else tmp = y * (t / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.5e+51], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1400.0], x, N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.5 \cdot 10^{+51}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{elif}\;y \leq 1400:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if y < -1.5e51Initial program 91.5%
associate-*l/97.9%
Simplified97.9%
Taylor expanded in t around inf 45.9%
div-inv45.9%
associate-*l*48.0%
div-inv48.0%
*-commutative48.0%
Applied egg-rr48.0%
if -1.5e51 < y < 1400Initial program 98.5%
associate-*l/96.2%
Simplified96.2%
Taylor expanded in x around inf 54.6%
if 1400 < y Initial program 84.2%
associate-*l/96.2%
Simplified96.2%
Taylor expanded in t around inf 48.7%
associate-*l/55.0%
Simplified55.0%
Final simplification53.5%
(FPCore (x y z t a) :precision binary64 (+ x (* (/ y a) (- t z))))
double code(double x, double y, double z, double t, double a) {
return x + ((y / a) * (t - z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y / a) * (t - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y / a) * (t - z));
}
def code(x, y, z, t, a): return x + ((y / a) * (t - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y / a) * Float64(t - z))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y / a) * (t - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{a} \cdot \left(t - z\right)
\end{array}
Initial program 92.9%
associate-*l/96.5%
Simplified96.5%
Final simplification96.5%
(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.9%
associate-*l/96.5%
Simplified96.5%
Taylor expanded in x around inf 36.4%
Final simplification36.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 2023297
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, F"
:precision binary64
:herbie-target
(if (< y -1.0761266216389975e-10) (- x (/ 1.0 (/ (/ a (- z t)) y))) (if (< y 2.894426862792089e-49) (- x (/ (* y (- z t)) a)) (- x (/ y (/ a (- z t))))))
(- x (/ (* y (- z t)) a)))