
(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 10 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 (* (/ 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 93.0%
associate-/l*94.2%
Simplified94.2%
Taylor expanded in y around 0 93.0%
associate-*l/98.0%
*-commutative98.0%
Simplified98.0%
Final simplification98.0%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.4e+46)
(* t (/ y a))
(if (<= t 1.28e-222)
x
(if (<= t 1.3e+106) (* (/ y a) (- z)) (/ t (/ a y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.4e+46) {
tmp = t * (y / a);
} else if (t <= 1.28e-222) {
tmp = x;
} else if (t <= 1.3e+106) {
tmp = (y / a) * -z;
} 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 (t <= (-1.4d+46)) then
tmp = t * (y / a)
else if (t <= 1.28d-222) then
tmp = x
else if (t <= 1.3d+106) then
tmp = (y / a) * -z
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 (t <= -1.4e+46) {
tmp = t * (y / a);
} else if (t <= 1.28e-222) {
tmp = x;
} else if (t <= 1.3e+106) {
tmp = (y / a) * -z;
} else {
tmp = t / (a / y);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.4e+46: tmp = t * (y / a) elif t <= 1.28e-222: tmp = x elif t <= 1.3e+106: tmp = (y / a) * -z else: tmp = t / (a / y) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.4e+46) tmp = Float64(t * Float64(y / a)); elseif (t <= 1.28e-222) tmp = x; elseif (t <= 1.3e+106) tmp = Float64(Float64(y / a) * Float64(-z)); else tmp = Float64(t / Float64(a / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.4e+46) tmp = t * (y / a); elseif (t <= 1.28e-222) tmp = x; elseif (t <= 1.3e+106) tmp = (y / a) * -z; else tmp = t / (a / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.4e+46], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.28e-222], x, If[LessEqual[t, 1.3e+106], N[(N[(y / a), $MachinePrecision] * (-z)), $MachinePrecision], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.4 \cdot 10^{+46}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{elif}\;t \leq 1.28 \cdot 10^{-222}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{+106}:\\
\;\;\;\;\frac{y}{a} \cdot \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if t < -1.40000000000000009e46Initial program 88.7%
associate-/l*90.6%
Simplified90.6%
Taylor expanded in x around 0 68.3%
associate-*r/68.3%
neg-mul-168.3%
*-commutative68.3%
distribute-lft-neg-in68.3%
associate-*r/74.0%
*-commutative74.0%
neg-sub074.0%
sub-neg74.0%
+-commutative74.0%
associate--r+74.0%
neg-sub074.0%
remove-double-neg74.0%
Simplified74.0%
Taylor expanded in t around inf 65.9%
if -1.40000000000000009e46 < t < 1.28e-222Initial program 95.2%
associate-/l*98.3%
Simplified98.3%
Taylor expanded in x around inf 59.5%
if 1.28e-222 < t < 1.3000000000000001e106Initial program 94.0%
associate-/l*94.9%
Simplified94.9%
Taylor expanded in y around 0 94.0%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around inf 46.7%
mul-1-neg46.7%
associate-*l/52.6%
distribute-rgt-neg-out52.6%
Simplified52.6%
if 1.3000000000000001e106 < t Initial program 92.1%
associate-/l*90.2%
Simplified90.2%
Taylor expanded in x around 0 70.0%
associate-*r/70.0%
neg-mul-170.0%
*-commutative70.0%
distribute-lft-neg-in70.0%
associate-*r/73.8%
*-commutative73.8%
neg-sub073.8%
sub-neg73.8%
+-commutative73.8%
associate--r+73.8%
neg-sub073.8%
remove-double-neg73.8%
Simplified73.8%
Taylor expanded in t around inf 65.6%
*-commutative65.6%
clear-num65.6%
un-div-inv65.6%
Applied egg-rr65.6%
Final simplification59.8%
(FPCore (x y z t a) :precision binary64 (if (<= t -5.5e+44) (* t (/ y a)) (if (<= t 6.6e+42) x (if (<= t 1.1e+106) (* y (/ (- z) a)) (/ t (/ a y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.5e+44) {
tmp = t * (y / a);
} else if (t <= 6.6e+42) {
tmp = x;
} else if (t <= 1.1e+106) {
tmp = y * (-z / a);
} 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 (t <= (-5.5d+44)) then
tmp = t * (y / a)
else if (t <= 6.6d+42) then
tmp = x
else if (t <= 1.1d+106) then
tmp = y * (-z / a)
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 (t <= -5.5e+44) {
tmp = t * (y / a);
} else if (t <= 6.6e+42) {
tmp = x;
} else if (t <= 1.1e+106) {
tmp = y * (-z / a);
} else {
tmp = t / (a / y);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -5.5e+44: tmp = t * (y / a) elif t <= 6.6e+42: tmp = x elif t <= 1.1e+106: tmp = y * (-z / a) else: tmp = t / (a / y) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -5.5e+44) tmp = Float64(t * Float64(y / a)); elseif (t <= 6.6e+42) tmp = x; elseif (t <= 1.1e+106) tmp = Float64(y * Float64(Float64(-z) / a)); else tmp = Float64(t / Float64(a / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -5.5e+44) tmp = t * (y / a); elseif (t <= 6.6e+42) tmp = x; elseif (t <= 1.1e+106) tmp = y * (-z / a); else tmp = t / (a / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -5.5e+44], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.6e+42], x, If[LessEqual[t, 1.1e+106], N[(y * N[((-z) / a), $MachinePrecision]), $MachinePrecision], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.5 \cdot 10^{+44}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{elif}\;t \leq 6.6 \cdot 10^{+42}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{+106}:\\
\;\;\;\;y \cdot \frac{-z}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if t < -5.5000000000000001e44Initial program 88.7%
associate-/l*90.6%
Simplified90.6%
Taylor expanded in x around 0 68.3%
associate-*r/68.3%
neg-mul-168.3%
*-commutative68.3%
distribute-lft-neg-in68.3%
associate-*r/74.0%
*-commutative74.0%
neg-sub074.0%
sub-neg74.0%
+-commutative74.0%
associate--r+74.0%
neg-sub074.0%
remove-double-neg74.0%
Simplified74.0%
Taylor expanded in t around inf 65.9%
if -5.5000000000000001e44 < t < 6.5999999999999998e42Initial program 94.5%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in x around inf 54.0%
if 6.5999999999999998e42 < t < 1.09999999999999996e106Initial program 95.3%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in z around inf 54.8%
mul-1-neg54.8%
associate-/l*59.2%
distribute-rgt-neg-in59.2%
distribute-frac-neg259.2%
Simplified59.2%
if 1.09999999999999996e106 < t Initial program 92.1%
associate-/l*90.2%
Simplified90.2%
Taylor expanded in x around 0 70.0%
associate-*r/70.0%
neg-mul-170.0%
*-commutative70.0%
distribute-lft-neg-in70.0%
associate-*r/73.8%
*-commutative73.8%
neg-sub073.8%
sub-neg73.8%
+-commutative73.8%
associate--r+73.8%
neg-sub073.8%
remove-double-neg73.8%
Simplified73.8%
Taylor expanded in t around inf 65.6%
*-commutative65.6%
clear-num65.6%
un-div-inv65.6%
Applied egg-rr65.6%
Final simplification59.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5.6e-58) (not (<= t 2e+100))) (+ x (* t (/ y a))) (- x (/ (* z y) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.6e-58) || !(t <= 2e+100)) {
tmp = x + (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 <= (-5.6d-58)) .or. (.not. (t <= 2d+100))) then
tmp = x + (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 <= -5.6e-58) || !(t <= 2e+100)) {
tmp = x + (t * (y / a));
} else {
tmp = x - ((z * y) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5.6e-58) or not (t <= 2e+100): tmp = x + (t * (y / a)) else: tmp = x - ((z * y) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5.6e-58) || !(t <= 2e+100)) tmp = Float64(x + Float64(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 <= -5.6e-58) || ~((t <= 2e+100))) tmp = x + (t * (y / a)); else tmp = x - ((z * y) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5.6e-58], N[Not[LessEqual[t, 2e+100]], $MachinePrecision]], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.6 \cdot 10^{-58} \lor \neg \left(t \leq 2 \cdot 10^{+100}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{z \cdot y}{a}\\
\end{array}
\end{array}
if t < -5.6000000000000001e-58 or 2.00000000000000003e100 < t Initial program 91.3%
associate-/l*92.1%
Simplified92.1%
Taylor expanded in y around 0 91.3%
associate-*l/98.3%
*-commutative98.3%
Simplified98.3%
Taylor expanded in z around 0 90.1%
neg-mul-190.1%
Simplified90.1%
cancel-sign-sub90.1%
+-commutative90.1%
associate-*r/84.6%
Applied egg-rr84.6%
associate-/l*90.1%
*-commutative90.1%
Applied egg-rr90.1%
if -5.6000000000000001e-58 < t < 2.00000000000000003e100Initial program 94.4%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in z around inf 86.2%
Final simplification88.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.65e+77) (not (<= z 0.3))) (* (/ y a) (- t z)) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.65e+77) || !(z <= 0.3)) {
tmp = (y / a) * (t - z);
} else {
tmp = x + (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 ((z <= (-1.65d+77)) .or. (.not. (z <= 0.3d0))) then
tmp = (y / a) * (t - z)
else
tmp = x + (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 ((z <= -1.65e+77) || !(z <= 0.3)) {
tmp = (y / a) * (t - z);
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.65e+77) or not (z <= 0.3): tmp = (y / a) * (t - z) else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.65e+77) || !(z <= 0.3)) tmp = Float64(Float64(y / a) * Float64(t - z)); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.65e+77) || ~((z <= 0.3))) tmp = (y / a) * (t - z); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.65e+77], N[Not[LessEqual[z, 0.3]], $MachinePrecision]], N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{+77} \lor \neg \left(z \leq 0.3\right):\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1.6499999999999999e77 or 0.299999999999999989 < z Initial program 88.9%
associate-/l*89.8%
Simplified89.8%
Taylor expanded in x around 0 69.2%
associate-*r/69.2%
neg-mul-169.2%
*-commutative69.2%
distribute-lft-neg-in69.2%
associate-*r/75.5%
*-commutative75.5%
neg-sub075.5%
sub-neg75.5%
+-commutative75.5%
associate--r+75.5%
neg-sub075.5%
remove-double-neg75.5%
Simplified75.5%
if -1.6499999999999999e77 < z < 0.299999999999999989Initial program 95.6%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in z around 0 87.2%
associate-*r/87.2%
mul-1-neg87.2%
distribute-lft-neg-out87.2%
*-commutative87.2%
Simplified87.2%
div-inv87.2%
distribute-rgt-neg-out87.2%
cancel-sign-sub87.2%
div-inv87.2%
+-commutative87.2%
associate-/l*89.4%
Applied egg-rr89.4%
Final simplification83.9%
(FPCore (x y z t a) :precision binary64 (if (<= x -3.4e+144) x (if (<= x 3.5e+76) (* (/ y a) (- t z)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -3.4e+144) {
tmp = x;
} else if (x <= 3.5e+76) {
tmp = (y / a) * (t - z);
} 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 (x <= (-3.4d+144)) then
tmp = x
else if (x <= 3.5d+76) then
tmp = (y / a) * (t - z)
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 (x <= -3.4e+144) {
tmp = x;
} else if (x <= 3.5e+76) {
tmp = (y / a) * (t - z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -3.4e+144: tmp = x elif x <= 3.5e+76: tmp = (y / a) * (t - z) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -3.4e+144) tmp = x; elseif (x <= 3.5e+76) tmp = Float64(Float64(y / a) * Float64(t - z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -3.4e+144) tmp = x; elseif (x <= 3.5e+76) tmp = (y / a) * (t - z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -3.4e+144], x, If[LessEqual[x, 3.5e+76], N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{+144}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{+76}:\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.3999999999999999e144 or 3.5e76 < x Initial program 93.5%
associate-/l*96.7%
Simplified96.7%
Taylor expanded in x around inf 72.1%
if -3.3999999999999999e144 < x < 3.5e76Initial program 92.7%
associate-/l*93.0%
Simplified93.0%
Taylor expanded in x around 0 70.2%
associate-*r/70.2%
neg-mul-170.2%
*-commutative70.2%
distribute-lft-neg-in70.2%
associate-*r/75.6%
*-commutative75.6%
neg-sub075.6%
sub-neg75.6%
+-commutative75.6%
associate--r+75.6%
neg-sub075.6%
remove-double-neg75.6%
Simplified75.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5.1e+42) (not (<= t 3.4e+64))) (* t (/ y a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.1e+42) || !(t <= 3.4e+64)) {
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 ((t <= (-5.1d+42)) .or. (.not. (t <= 3.4d+64))) 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 ((t <= -5.1e+42) || !(t <= 3.4e+64)) {
tmp = t * (y / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5.1e+42) or not (t <= 3.4e+64): tmp = t * (y / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5.1e+42) || !(t <= 3.4e+64)) 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 ((t <= -5.1e+42) || ~((t <= 3.4e+64))) tmp = t * (y / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5.1e+42], N[Not[LessEqual[t, 3.4e+64]], $MachinePrecision]], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.1 \cdot 10^{+42} \lor \neg \left(t \leq 3.4 \cdot 10^{+64}\right):\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -5.0999999999999999e42 or 3.4000000000000002e64 < t Initial program 91.7%
associate-/l*91.7%
Simplified91.7%
Taylor expanded in x around 0 70.0%
associate-*r/70.0%
neg-mul-170.0%
*-commutative70.0%
distribute-lft-neg-in70.0%
associate-*r/74.1%
*-commutative74.1%
neg-sub074.1%
sub-neg74.1%
+-commutative74.1%
associate--r+74.1%
neg-sub074.1%
remove-double-neg74.1%
Simplified74.1%
Taylor expanded in t around inf 61.1%
if -5.0999999999999999e42 < t < 3.4000000000000002e64Initial program 94.0%
associate-/l*96.3%
Simplified96.3%
Taylor expanded in x around inf 53.6%
Final simplification57.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.9e+41) (not (<= t 3.6e+63))) (* y (/ t a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.9e+41) || !(t <= 3.6e+63)) {
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 ((t <= (-2.9d+41)) .or. (.not. (t <= 3.6d+63))) 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 ((t <= -2.9e+41) || !(t <= 3.6e+63)) {
tmp = y * (t / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.9e+41) or not (t <= 3.6e+63): tmp = y * (t / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.9e+41) || !(t <= 3.6e+63)) 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 ((t <= -2.9e+41) || ~((t <= 3.6e+63))) tmp = y * (t / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.9e+41], N[Not[LessEqual[t, 3.6e+63]], $MachinePrecision]], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9 \cdot 10^{+41} \lor \neg \left(t \leq 3.6 \cdot 10^{+63}\right):\\
\;\;\;\;y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -2.89999999999999988e41 or 3.59999999999999999e63 < t Initial program 91.7%
associate-/l*91.7%
Simplified91.7%
Taylor expanded in t around inf 57.8%
*-commutative57.8%
associate-/l*59.4%
Simplified59.4%
if -2.89999999999999988e41 < t < 3.59999999999999999e63Initial program 94.0%
associate-/l*96.3%
Simplified96.3%
Taylor expanded in x around inf 53.6%
Final simplification56.2%
(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 93.0%
associate-/l*94.2%
Simplified94.2%
Final simplification94.2%
(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 93.0%
associate-/l*94.2%
Simplified94.2%
Taylor expanded in x around inf 41.0%
(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 2024163
(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)))