
(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 12 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 (/ (- t z) (/ a y))))
double code(double x, double y, double z, double t, double a) {
return x + ((t - z) / (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 + ((t - z) / (a / y))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((t - z) / (a / y));
}
def code(x, y, z, t, a): return x + ((t - z) / (a / y))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(t - z) / Float64(a / y))) end
function tmp = code(x, y, z, t, a) tmp = x + ((t - z) / (a / y)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(t - z), $MachinePrecision] / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{t - z}{\frac{a}{y}}
\end{array}
Initial program 95.1%
associate-/l*93.9%
Simplified93.9%
Taylor expanded in y around 0 95.1%
associate-*l/96.9%
*-commutative96.9%
Simplified96.9%
clear-num96.6%
un-div-inv96.9%
Applied egg-rr96.9%
Final simplification96.9%
(FPCore (x y z t a)
:precision binary64
(if (<= t -6.8e+106)
(/ (* t y) a)
(if (<= t -1.45e-244)
x
(if (<= t 5.2e-253)
(* (/ y a) (- z))
(if (<= t 4.2e-7) x (/ y (/ a t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6.8e+106) {
tmp = (t * y) / a;
} else if (t <= -1.45e-244) {
tmp = x;
} else if (t <= 5.2e-253) {
tmp = (y / a) * -z;
} else if (t <= 4.2e-7) {
tmp = x;
} else {
tmp = 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 (t <= (-6.8d+106)) then
tmp = (t * y) / a
else if (t <= (-1.45d-244)) then
tmp = x
else if (t <= 5.2d-253) then
tmp = (y / a) * -z
else if (t <= 4.2d-7) then
tmp = x
else
tmp = 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 (t <= -6.8e+106) {
tmp = (t * y) / a;
} else if (t <= -1.45e-244) {
tmp = x;
} else if (t <= 5.2e-253) {
tmp = (y / a) * -z;
} else if (t <= 4.2e-7) {
tmp = x;
} else {
tmp = y / (a / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -6.8e+106: tmp = (t * y) / a elif t <= -1.45e-244: tmp = x elif t <= 5.2e-253: tmp = (y / a) * -z elif t <= 4.2e-7: tmp = x else: tmp = y / (a / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -6.8e+106) tmp = Float64(Float64(t * y) / a); elseif (t <= -1.45e-244) tmp = x; elseif (t <= 5.2e-253) tmp = Float64(Float64(y / a) * Float64(-z)); elseif (t <= 4.2e-7) tmp = x; else tmp = Float64(y / Float64(a / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -6.8e+106) tmp = (t * y) / a; elseif (t <= -1.45e-244) tmp = x; elseif (t <= 5.2e-253) tmp = (y / a) * -z; elseif (t <= 4.2e-7) tmp = x; else tmp = y / (a / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -6.8e+106], N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t, -1.45e-244], x, If[LessEqual[t, 5.2e-253], N[(N[(y / a), $MachinePrecision] * (-z)), $MachinePrecision], If[LessEqual[t, 4.2e-7], x, N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.8 \cdot 10^{+106}:\\
\;\;\;\;\frac{t \cdot y}{a}\\
\mathbf{elif}\;t \leq -1.45 \cdot 10^{-244}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 5.2 \cdot 10^{-253}:\\
\;\;\;\;\frac{y}{a} \cdot \left(-z\right)\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{-7}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if t < -6.79999999999999989e106Initial program 97.4%
associate-/l*88.5%
Simplified88.5%
Taylor expanded in t around inf 67.0%
*-commutative67.0%
Simplified67.0%
if -6.79999999999999989e106 < t < -1.44999999999999998e-244 or 5.2e-253 < t < 4.2e-7Initial program 95.5%
associate-/l*96.7%
Simplified96.7%
Taylor expanded in x around inf 56.7%
if -1.44999999999999998e-244 < t < 5.2e-253Initial program 92.8%
associate-/l*92.8%
Simplified92.8%
Taylor expanded in y around 0 92.8%
associate-*l/96.2%
*-commutative96.2%
Simplified96.2%
Taylor expanded in z around inf 70.4%
mul-1-neg70.4%
associate-*l/73.8%
*-commutative73.8%
distribute-rgt-neg-in73.8%
distribute-neg-frac273.8%
Simplified73.8%
if 4.2e-7 < t Initial program 93.7%
associate-/l*92.0%
Simplified92.0%
Taylor expanded in t around inf 58.8%
*-commutative58.8%
Simplified58.8%
associate-/l*58.7%
*-commutative58.7%
Applied egg-rr58.7%
*-commutative58.7%
clear-num58.7%
un-div-inv60.3%
Applied egg-rr60.3%
Final simplification61.0%
(FPCore (x y z t a)
:precision binary64
(if (<= t -4.2e+106)
(/ (* t y) a)
(if (<= t -3.5e-244)
x
(if (<= t 4.8e-254)
(* y (/ (- z) a))
(if (<= t 2.25e-7) x (/ y (/ a t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.2e+106) {
tmp = (t * y) / a;
} else if (t <= -3.5e-244) {
tmp = x;
} else if (t <= 4.8e-254) {
tmp = y * (-z / a);
} else if (t <= 2.25e-7) {
tmp = x;
} else {
tmp = 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 (t <= (-4.2d+106)) then
tmp = (t * y) / a
else if (t <= (-3.5d-244)) then
tmp = x
else if (t <= 4.8d-254) then
tmp = y * (-z / a)
else if (t <= 2.25d-7) then
tmp = x
else
tmp = 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 (t <= -4.2e+106) {
tmp = (t * y) / a;
} else if (t <= -3.5e-244) {
tmp = x;
} else if (t <= 4.8e-254) {
tmp = y * (-z / a);
} else if (t <= 2.25e-7) {
tmp = x;
} else {
tmp = y / (a / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.2e+106: tmp = (t * y) / a elif t <= -3.5e-244: tmp = x elif t <= 4.8e-254: tmp = y * (-z / a) elif t <= 2.25e-7: tmp = x else: tmp = y / (a / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.2e+106) tmp = Float64(Float64(t * y) / a); elseif (t <= -3.5e-244) tmp = x; elseif (t <= 4.8e-254) tmp = Float64(y * Float64(Float64(-z) / a)); elseif (t <= 2.25e-7) tmp = x; else tmp = Float64(y / Float64(a / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.2e+106) tmp = (t * y) / a; elseif (t <= -3.5e-244) tmp = x; elseif (t <= 4.8e-254) tmp = y * (-z / a); elseif (t <= 2.25e-7) tmp = x; else tmp = y / (a / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.2e+106], N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t, -3.5e-244], x, If[LessEqual[t, 4.8e-254], N[(y * N[((-z) / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.25e-7], x, N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{+106}:\\
\;\;\;\;\frac{t \cdot y}{a}\\
\mathbf{elif}\;t \leq -3.5 \cdot 10^{-244}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{-254}:\\
\;\;\;\;y \cdot \frac{-z}{a}\\
\mathbf{elif}\;t \leq 2.25 \cdot 10^{-7}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if t < -4.2000000000000001e106Initial program 97.4%
associate-/l*88.5%
Simplified88.5%
Taylor expanded in t around inf 67.0%
*-commutative67.0%
Simplified67.0%
if -4.2000000000000001e106 < t < -3.49999999999999992e-244 or 4.80000000000000003e-254 < t < 2.2499999999999999e-7Initial program 95.5%
associate-/l*96.7%
Simplified96.7%
Taylor expanded in x around inf 56.7%
if -3.49999999999999992e-244 < t < 4.80000000000000003e-254Initial program 92.8%
associate-/l*92.8%
Simplified92.8%
Taylor expanded in z around inf 70.4%
mul-1-neg70.4%
associate-/l*70.5%
distribute-rgt-neg-in70.5%
distribute-frac-neg270.5%
Simplified70.5%
if 2.2499999999999999e-7 < t Initial program 93.7%
associate-/l*92.0%
Simplified92.0%
Taylor expanded in t around inf 58.8%
*-commutative58.8%
Simplified58.8%
associate-/l*58.7%
*-commutative58.7%
Applied egg-rr58.7%
*-commutative58.7%
clear-num58.7%
un-div-inv60.3%
Applied egg-rr60.3%
Final simplification60.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.25e-161) (not (<= t 1e-44))) (+ x (* t (/ y a))) (- x (/ z (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.25e-161) || !(t <= 1e-44)) {
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 ((t <= (-1.25d-161)) .or. (.not. (t <= 1d-44))) 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 ((t <= -1.25e-161) || !(t <= 1e-44)) {
tmp = x + (t * (y / a));
} else {
tmp = x - (z / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.25e-161) or not (t <= 1e-44): tmp = x + (t * (y / a)) else: tmp = x - (z / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.25e-161) || !(t <= 1e-44)) 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 ((t <= -1.25e-161) || ~((t <= 1e-44))) tmp = x + (t * (y / a)); else tmp = x - (z / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.25e-161], N[Not[LessEqual[t, 1e-44]], $MachinePrecision]], 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}\;t \leq -1.25 \cdot 10^{-161} \lor \neg \left(t \leq 10^{-44}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{z}{\frac{a}{y}}\\
\end{array}
\end{array}
if t < -1.25e-161 or 9.99999999999999953e-45 < t Initial program 94.6%
associate-/l*92.1%
Simplified92.1%
Taylor expanded in y around 0 94.6%
associate-*l/96.9%
*-commutative96.9%
Simplified96.9%
clear-num96.4%
un-div-inv96.4%
Applied egg-rr96.4%
Taylor expanded in z around 0 83.3%
cancel-sign-sub-inv83.3%
metadata-eval83.3%
associate-*l/81.8%
*-commutative81.8%
*-lft-identity81.8%
*-commutative81.8%
associate-*l/83.3%
associate-*r/84.8%
Simplified84.8%
if -1.25e-161 < t < 9.99999999999999953e-45Initial program 95.9%
associate-/l*96.9%
Simplified96.9%
Taylor expanded in y around 0 95.9%
associate-*l/96.9%
*-commutative96.9%
Simplified96.9%
clear-num96.9%
un-div-inv97.7%
Applied egg-rr97.7%
Taylor expanded in z around inf 92.6%
Final simplification87.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.25e-161) (not (<= t 1.7e-44))) (+ x (* t (/ y a))) (- x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.25e-161) || !(t <= 1.7e-44)) {
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 <= (-1.25d-161)) .or. (.not. (t <= 1.7d-44))) 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 <= -1.25e-161) || !(t <= 1.7e-44)) {
tmp = x + (t * (y / a));
} else {
tmp = x - (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.25e-161) or not (t <= 1.7e-44): 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 <= -1.25e-161) || !(t <= 1.7e-44)) 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 <= -1.25e-161) || ~((t <= 1.7e-44))) 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, -1.25e-161], N[Not[LessEqual[t, 1.7e-44]], $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 -1.25 \cdot 10^{-161} \lor \neg \left(t \leq 1.7 \cdot 10^{-44}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -1.25e-161 or 1.70000000000000008e-44 < t Initial program 94.6%
associate-/l*92.1%
Simplified92.1%
Taylor expanded in y around 0 94.6%
associate-*l/96.9%
*-commutative96.9%
Simplified96.9%
clear-num96.4%
un-div-inv96.4%
Applied egg-rr96.4%
Taylor expanded in z around 0 83.3%
cancel-sign-sub-inv83.3%
metadata-eval83.3%
associate-*l/81.8%
*-commutative81.8%
*-lft-identity81.8%
*-commutative81.8%
associate-*l/83.3%
associate-*r/84.8%
Simplified84.8%
if -1.25e-161 < t < 1.70000000000000008e-44Initial program 95.9%
associate-/l*96.9%
Simplified96.9%
clear-num96.8%
un-div-inv96.9%
Applied egg-rr96.9%
Taylor expanded in z around inf 90.9%
Final simplification87.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.3e+142) (not (<= z 9.2e+117))) (* (/ y a) (- t z)) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.3e+142) || !(z <= 9.2e+117)) {
tmp = (y / a) * (t - 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 ((z <= (-3.3d+142)) .or. (.not. (z <= 9.2d+117))) then
tmp = (y / a) * (t - 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 ((z <= -3.3e+142) || !(z <= 9.2e+117)) {
tmp = (y / a) * (t - z);
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.3e+142) or not (z <= 9.2e+117): tmp = (y / a) * (t - z) else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.3e+142) || !(z <= 9.2e+117)) tmp = Float64(Float64(y / a) * Float64(t - 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 ((z <= -3.3e+142) || ~((z <= 9.2e+117))) tmp = (y / a) * (t - z); else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.3e+142], N[Not[LessEqual[z, 9.2e+117]], $MachinePrecision]], N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+142} \lor \neg \left(z \leq 9.2 \cdot 10^{+117}\right):\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -3.3000000000000002e142 or 9.19999999999999951e117 < z Initial program 89.2%
associate-/l*87.8%
Simplified87.8%
Taylor expanded in x around 0 69.8%
associate-*r/69.8%
neg-mul-169.8%
*-commutative69.8%
distribute-lft-neg-in69.8%
associate-*r/75.4%
*-commutative75.4%
neg-sub075.4%
sub-neg75.4%
+-commutative75.4%
associate--r+75.4%
neg-sub075.4%
remove-double-neg75.4%
Simplified75.4%
if -3.3000000000000002e142 < z < 9.19999999999999951e117Initial program 97.0%
associate-/l*95.8%
Simplified95.8%
Taylor expanded in y around 0 97.0%
associate-*l/97.0%
*-commutative97.0%
Simplified97.0%
clear-num97.0%
un-div-inv97.4%
Applied egg-rr97.4%
Taylor expanded in z around 0 81.3%
cancel-sign-sub-inv81.3%
metadata-eval81.3%
associate-*l/79.7%
*-commutative79.7%
*-lft-identity79.7%
*-commutative79.7%
associate-*l/81.3%
associate-*r/83.1%
Simplified83.1%
Final simplification81.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -2.5e+14) (not (<= y 2.3e-93))) (* y (/ (- t z) a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -2.5e+14) || !(y <= 2.3e-93)) {
tmp = y * ((t - z) / a);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((y <= (-2.5d+14)) .or. (.not. (y <= 2.3d-93))) then
tmp = y * ((t - z) / a)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -2.5e+14) || !(y <= 2.3e-93)) {
tmp = y * ((t - z) / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -2.5e+14) or not (y <= 2.3e-93): tmp = y * ((t - z) / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -2.5e+14) || !(y <= 2.3e-93)) tmp = Float64(y * Float64(Float64(t - z) / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -2.5e+14) || ~((y <= 2.3e-93))) tmp = y * ((t - z) / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -2.5e+14], N[Not[LessEqual[y, 2.3e-93]], $MachinePrecision]], N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{+14} \lor \neg \left(y \leq 2.3 \cdot 10^{-93}\right):\\
\;\;\;\;y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -2.5e14 or 2.2999999999999998e-93 < y Initial program 92.0%
associate-/l*98.4%
Simplified98.4%
clear-num97.9%
un-div-inv98.4%
Applied egg-rr98.4%
Taylor expanded in x around 0 70.3%
mul-1-neg70.3%
associate-*r/76.0%
distribute-rgt-neg-in76.0%
distribute-neg-frac76.0%
sub-neg76.0%
distribute-neg-in76.0%
mul-1-neg76.0%
remove-double-neg76.0%
+-commutative76.0%
mul-1-neg76.0%
sub-neg76.0%
Simplified76.0%
if -2.5e14 < y < 2.2999999999999998e-93Initial program 99.0%
associate-/l*88.2%
Simplified88.2%
Taylor expanded in x around inf 60.2%
Final simplification69.0%
(FPCore (x y z t a) :precision binary64 (if (<= y -3.5e-151) (* (/ y a) (- t z)) (if (<= y 9.8e-93) x (* y (/ (- t z) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.5e-151) {
tmp = (y / a) * (t - z);
} else if (y <= 9.8e-93) {
tmp = x;
} else {
tmp = y * ((t - z) / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-3.5d-151)) then
tmp = (y / a) * (t - z)
else if (y <= 9.8d-93) then
tmp = x
else
tmp = y * ((t - z) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.5e-151) {
tmp = (y / a) * (t - z);
} else if (y <= 9.8e-93) {
tmp = x;
} else {
tmp = y * ((t - z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -3.5e-151: tmp = (y / a) * (t - z) elif y <= 9.8e-93: tmp = x else: tmp = y * ((t - z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -3.5e-151) tmp = Float64(Float64(y / a) * Float64(t - z)); elseif (y <= 9.8e-93) tmp = x; else tmp = Float64(y * Float64(Float64(t - z) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -3.5e-151) tmp = (y / a) * (t - z); elseif (y <= 9.8e-93) tmp = x; else tmp = y * ((t - z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -3.5e-151], N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.8e-93], x, N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{-151}:\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{elif}\;y \leq 9.8 \cdot 10^{-93}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{t - z}{a}\\
\end{array}
\end{array}
if y < -3.49999999999999995e-151Initial program 93.0%
associate-/l*94.6%
Simplified94.6%
Taylor expanded in x around 0 62.8%
associate-*r/62.8%
neg-mul-162.8%
*-commutative62.8%
distribute-lft-neg-in62.8%
associate-*r/68.7%
*-commutative68.7%
neg-sub068.7%
sub-neg68.7%
+-commutative68.7%
associate--r+68.7%
neg-sub068.7%
remove-double-neg68.7%
Simplified68.7%
if -3.49999999999999995e-151 < y < 9.7999999999999993e-93Initial program 98.6%
associate-/l*87.6%
Simplified87.6%
Taylor expanded in x around inf 65.3%
if 9.7999999999999993e-93 < y Initial program 94.2%
associate-/l*98.8%
Simplified98.8%
clear-num98.7%
un-div-inv99.6%
Applied egg-rr99.6%
Taylor expanded in x around 0 70.4%
mul-1-neg70.4%
associate-*r/73.7%
distribute-rgt-neg-in73.7%
distribute-neg-frac73.7%
sub-neg73.7%
distribute-neg-in73.7%
mul-1-neg73.7%
remove-double-neg73.7%
+-commutative73.7%
mul-1-neg73.7%
sub-neg73.7%
Simplified73.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -6.8e+71) (not (<= y 2.05e-92))) (* t (/ y a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -6.8e+71) || !(y <= 2.05e-92)) {
tmp = 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 ((y <= (-6.8d+71)) .or. (.not. (y <= 2.05d-92))) then
tmp = 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 ((y <= -6.8e+71) || !(y <= 2.05e-92)) {
tmp = t * (y / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -6.8e+71) or not (y <= 2.05e-92): tmp = t * (y / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -6.8e+71) || !(y <= 2.05e-92)) tmp = Float64(t * Float64(y / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -6.8e+71) || ~((y <= 2.05e-92))) tmp = t * (y / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -6.8e+71], N[Not[LessEqual[y, 2.05e-92]], $MachinePrecision]], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.8 \cdot 10^{+71} \lor \neg \left(y \leq 2.05 \cdot 10^{-92}\right):\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -6.7999999999999997e71 or 2.0500000000000001e-92 < y Initial program 91.2%
associate-/l*98.2%
Simplified98.2%
Taylor expanded in y around 0 91.2%
associate-*l/97.0%
*-commutative97.0%
Simplified97.0%
Taylor expanded in t around inf 47.7%
associate-/l*53.8%
Simplified53.8%
if -6.7999999999999997e71 < y < 2.0500000000000001e-92Initial program 99.1%
associate-/l*89.4%
Simplified89.4%
Taylor expanded in x around inf 58.9%
Final simplification56.3%
(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 95.1%
associate-/l*93.9%
Simplified93.9%
Taylor expanded in y around 0 95.1%
associate-*l/96.9%
*-commutative96.9%
Simplified96.9%
Final simplification96.9%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- t z) a))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((t - z) / 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 * ((t - z) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((t - z) / a));
}
def code(x, y, z, t, a): return x + (y * ((t - z) / a))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(t - z) / a))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((t - z) / a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{t - z}{a}
\end{array}
Initial program 95.1%
associate-/l*93.9%
Simplified93.9%
Final simplification93.9%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 95.1%
associate-/l*93.9%
Simplified93.9%
Taylor expanded in x around inf 40.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 2024170
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, F"
: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)))