
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - 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 * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - 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 * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
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 - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
Initial program 96.3%
clear-num96.2%
un-div-inv96.7%
Applied egg-rr96.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.2e+38) (not (<= t 9e-50))) (+ x (* t (/ y (- a z)))) (- x (* y (/ z (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.2e+38) || !(t <= 9e-50)) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x - (y * (z / (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 <= (-2.2d+38)) .or. (.not. (t <= 9d-50))) then
tmp = x + (t * (y / (a - z)))
else
tmp = x - (y * (z / (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 <= -2.2e+38) || !(t <= 9e-50)) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x - (y * (z / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.2e+38) or not (t <= 9e-50): tmp = x + (t * (y / (a - z))) else: tmp = x - (y * (z / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.2e+38) || !(t <= 9e-50)) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); else tmp = Float64(x - Float64(y * Float64(z / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.2e+38) || ~((t <= 9e-50))) tmp = x + (t * (y / (a - z))); else tmp = x - (y * (z / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.2e+38], N[Not[LessEqual[t, 9e-50]], $MachinePrecision]], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.2 \cdot 10^{+38} \lor \neg \left(t \leq 9 \cdot 10^{-50}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{z}{a - z}\\
\end{array}
\end{array}
if t < -2.20000000000000006e38 or 8.99999999999999924e-50 < t Initial program 94.6%
Taylor expanded in t around inf 86.6%
mul-1-neg86.6%
associate-/l*89.7%
Simplified89.7%
if -2.20000000000000006e38 < t < 8.99999999999999924e-50Initial program 97.9%
Taylor expanded in t around 0 85.6%
+-commutative85.6%
associate-/l*92.9%
Simplified92.9%
Final simplification91.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.8e-95) (not (<= z 4.6e-71))) (+ x (* y (- 1.0 (/ t z)))) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.8e-95) || !(z <= 4.6e-71)) {
tmp = x + (y * (1.0 - (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 <= (-5.8d-95)) .or. (.not. (z <= 4.6d-71))) then
tmp = x + (y * (1.0d0 - (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 <= -5.8e-95) || !(z <= 4.6e-71)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.8e-95) or not (z <= 4.6e-71): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.8e-95) || !(z <= 4.6e-71)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -5.8e-95) || ~((z <= 4.6e-71))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.8e-95], N[Not[LessEqual[z, 4.6e-71]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{-95} \lor \neg \left(z \leq 4.6 \cdot 10^{-71}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -5.80000000000000004e-95 or 4.5999999999999997e-71 < z Initial program 99.9%
Taylor expanded in a around 0 71.0%
associate-/l*83.2%
div-sub83.2%
*-inverses83.2%
Simplified83.2%
if -5.80000000000000004e-95 < z < 4.5999999999999997e-71Initial program 90.8%
Taylor expanded in z around 0 81.5%
Final simplification82.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.3e-26) (- x (* y (/ z (- a z)))) (if (<= z 2.5e+31) (+ x (* (/ y a) (- t z))) (+ x (* y (- 1.0 (/ t z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.3e-26) {
tmp = x - (y * (z / (a - z)));
} else if (z <= 2.5e+31) {
tmp = x + ((y / a) * (t - z));
} else {
tmp = x + (y * (1.0 - (t / 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 (z <= (-3.3d-26)) then
tmp = x - (y * (z / (a - z)))
else if (z <= 2.5d+31) then
tmp = x + ((y / a) * (t - z))
else
tmp = x + (y * (1.0d0 - (t / z)))
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-26) {
tmp = x - (y * (z / (a - z)));
} else if (z <= 2.5e+31) {
tmp = x + ((y / a) * (t - z));
} else {
tmp = x + (y * (1.0 - (t / z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.3e-26: tmp = x - (y * (z / (a - z))) elif z <= 2.5e+31: tmp = x + ((y / a) * (t - z)) else: tmp = x + (y * (1.0 - (t / z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.3e-26) tmp = Float64(x - Float64(y * Float64(z / Float64(a - z)))); elseif (z <= 2.5e+31) tmp = Float64(x + Float64(Float64(y / a) * Float64(t - z))); else tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.3e-26) tmp = x - (y * (z / (a - z))); elseif (z <= 2.5e+31) tmp = x + ((y / a) * (t - z)); else tmp = x + (y * (1.0 - (t / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.3e-26], N[(x - N[(y * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.5e+31], N[(x + N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{-26}:\\
\;\;\;\;x - y \cdot \frac{z}{a - z}\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{+31}:\\
\;\;\;\;x + \frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\end{array}
\end{array}
if z < -3.2999999999999998e-26Initial program 99.9%
Taylor expanded in t around 0 80.2%
+-commutative80.2%
associate-/l*95.0%
Simplified95.0%
if -3.2999999999999998e-26 < z < 2.50000000000000013e31Initial program 93.1%
Taylor expanded in a around inf 80.8%
mul-1-neg80.8%
unsub-neg80.8%
*-commutative80.8%
associate-/l*80.1%
Simplified80.1%
if 2.50000000000000013e31 < z Initial program 99.9%
Taylor expanded in a around 0 73.3%
associate-/l*90.1%
div-sub90.1%
*-inverses90.1%
Simplified90.1%
Final simplification86.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -2e-22) (- x (* y (/ z (- a z)))) (if (<= z 2.5e+31) (+ x (* y (/ (- t z) a))) (+ x (* y (- 1.0 (/ t z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e-22) {
tmp = x - (y * (z / (a - z)));
} else if (z <= 2.5e+31) {
tmp = x + (y * ((t - z) / a));
} else {
tmp = x + (y * (1.0 - (t / 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 (z <= (-2d-22)) then
tmp = x - (y * (z / (a - z)))
else if (z <= 2.5d+31) then
tmp = x + (y * ((t - z) / a))
else
tmp = x + (y * (1.0d0 - (t / z)))
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-22) {
tmp = x - (y * (z / (a - z)));
} else if (z <= 2.5e+31) {
tmp = x + (y * ((t - z) / a));
} else {
tmp = x + (y * (1.0 - (t / z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2e-22: tmp = x - (y * (z / (a - z))) elif z <= 2.5e+31: tmp = x + (y * ((t - z) / a)) else: tmp = x + (y * (1.0 - (t / z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2e-22) tmp = Float64(x - Float64(y * Float64(z / Float64(a - z)))); elseif (z <= 2.5e+31) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); else tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2e-22) tmp = x - (y * (z / (a - z))); elseif (z <= 2.5e+31) tmp = x + (y * ((t - z) / a)); else tmp = x + (y * (1.0 - (t / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2e-22], N[(x - N[(y * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.5e+31], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-22}:\\
\;\;\;\;x - y \cdot \frac{z}{a - z}\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{+31}:\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\end{array}
\end{array}
if z < -2.0000000000000001e-22Initial program 99.9%
Taylor expanded in t around 0 80.2%
+-commutative80.2%
associate-/l*95.0%
Simplified95.0%
if -2.0000000000000001e-22 < z < 2.50000000000000013e31Initial program 93.1%
clear-num92.8%
un-div-inv93.8%
Applied egg-rr93.8%
Taylor expanded in a around inf 80.8%
mul-1-neg80.8%
unsub-neg80.8%
associate-/l*79.1%
Simplified79.1%
if 2.50000000000000013e31 < z Initial program 99.9%
Taylor expanded in a around 0 73.3%
associate-/l*90.1%
div-sub90.1%
*-inverses90.1%
Simplified90.1%
Final simplification85.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.05e-21) (- x (* y (/ z (- a z)))) (if (<= z 5.4e-70) (+ x (/ (* y t) a)) (+ x (* y (- 1.0 (/ t z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.05e-21) {
tmp = x - (y * (z / (a - z)));
} else if (z <= 5.4e-70) {
tmp = x + ((y * t) / a);
} else {
tmp = x + (y * (1.0 - (t / 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 (z <= (-1.05d-21)) then
tmp = x - (y * (z / (a - z)))
else if (z <= 5.4d-70) then
tmp = x + ((y * t) / a)
else
tmp = x + (y * (1.0d0 - (t / z)))
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.05e-21) {
tmp = x - (y * (z / (a - z)));
} else if (z <= 5.4e-70) {
tmp = x + ((y * t) / a);
} else {
tmp = x + (y * (1.0 - (t / z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.05e-21: tmp = x - (y * (z / (a - z))) elif z <= 5.4e-70: tmp = x + ((y * t) / a) else: tmp = x + (y * (1.0 - (t / z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.05e-21) tmp = Float64(x - Float64(y * Float64(z / Float64(a - z)))); elseif (z <= 5.4e-70) tmp = Float64(x + Float64(Float64(y * t) / a)); else tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.05e-21) tmp = x - (y * (z / (a - z))); elseif (z <= 5.4e-70) tmp = x + ((y * t) / a); else tmp = x + (y * (1.0 - (t / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.05e-21], N[(x - N[(y * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.4e-70], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{-21}:\\
\;\;\;\;x - y \cdot \frac{z}{a - z}\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{-70}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\end{array}
\end{array}
if z < -1.05000000000000006e-21Initial program 99.9%
Taylor expanded in t around 0 80.2%
+-commutative80.2%
associate-/l*95.0%
Simplified95.0%
if -1.05000000000000006e-21 < z < 5.4000000000000003e-70Initial program 92.3%
Taylor expanded in z around 0 79.1%
if 5.4000000000000003e-70 < z Initial program 99.9%
Taylor expanded in a around 0 71.9%
associate-/l*85.4%
div-sub85.4%
*-inverses85.4%
Simplified85.4%
Final simplification84.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.6e-26) (+ x (/ y (- 1.0 (/ a z)))) (if (<= z 9.6e-74) (+ x (/ (* y t) a)) (+ x (* y (- 1.0 (/ t z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.6e-26) {
tmp = x + (y / (1.0 - (a / z)));
} else if (z <= 9.6e-74) {
tmp = x + ((y * t) / a);
} else {
tmp = x + (y * (1.0 - (t / 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 (z <= (-1.6d-26)) then
tmp = x + (y / (1.0d0 - (a / z)))
else if (z <= 9.6d-74) then
tmp = x + ((y * t) / a)
else
tmp = x + (y * (1.0d0 - (t / z)))
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.6e-26) {
tmp = x + (y / (1.0 - (a / z)));
} else if (z <= 9.6e-74) {
tmp = x + ((y * t) / a);
} else {
tmp = x + (y * (1.0 - (t / z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.6e-26: tmp = x + (y / (1.0 - (a / z))) elif z <= 9.6e-74: tmp = x + ((y * t) / a) else: tmp = x + (y * (1.0 - (t / z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.6e-26) tmp = Float64(x + Float64(y / Float64(1.0 - Float64(a / z)))); elseif (z <= 9.6e-74) tmp = Float64(x + Float64(Float64(y * t) / a)); else tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.6e-26) tmp = x + (y / (1.0 - (a / z))); elseif (z <= 9.6e-74) tmp = x + ((y * t) / a); else tmp = x + (y * (1.0 - (t / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.6e-26], N[(x + N[(y / N[(1.0 - N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.6e-74], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{-26}:\\
\;\;\;\;x + \frac{y}{1 - \frac{a}{z}}\\
\mathbf{elif}\;z \leq 9.6 \cdot 10^{-74}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\end{array}
\end{array}
if z < -1.6000000000000001e-26Initial program 99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 94.9%
div-sub95.0%
*-inverses95.0%
Simplified95.0%
if -1.6000000000000001e-26 < z < 9.5999999999999996e-74Initial program 92.3%
Taylor expanded in z around 0 79.1%
if 9.5999999999999996e-74 < z Initial program 99.9%
Taylor expanded in a around 0 71.9%
associate-/l*85.4%
div-sub85.4%
*-inverses85.4%
Simplified85.4%
Final simplification84.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.7e-26) (- x (* z (/ y (- a z)))) (if (<= z 5.8e-71) (+ x (/ (* y t) a)) (+ x (* y (- 1.0 (/ t z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.7e-26) {
tmp = x - (z * (y / (a - z)));
} else if (z <= 5.8e-71) {
tmp = x + ((y * t) / a);
} else {
tmp = x + (y * (1.0 - (t / 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 (z <= (-2.7d-26)) then
tmp = x - (z * (y / (a - z)))
else if (z <= 5.8d-71) then
tmp = x + ((y * t) / a)
else
tmp = x + (y * (1.0d0 - (t / z)))
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-26) {
tmp = x - (z * (y / (a - z)));
} else if (z <= 5.8e-71) {
tmp = x + ((y * t) / a);
} else {
tmp = x + (y * (1.0 - (t / z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.7e-26: tmp = x - (z * (y / (a - z))) elif z <= 5.8e-71: tmp = x + ((y * t) / a) else: tmp = x + (y * (1.0 - (t / z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.7e-26) tmp = Float64(x - Float64(z * Float64(y / Float64(a - z)))); elseif (z <= 5.8e-71) tmp = Float64(x + Float64(Float64(y * t) / a)); else tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.7e-26) tmp = x - (z * (y / (a - z))); elseif (z <= 5.8e-71) tmp = x + ((y * t) / a); else tmp = x + (y * (1.0 - (t / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.7e-26], N[(x - N[(z * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e-71], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{-26}:\\
\;\;\;\;x - z \cdot \frac{y}{a - z}\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-71}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\end{array}
\end{array}
if z < -2.69999999999999982e-26Initial program 99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 80.2%
associate-*l/92.4%
*-commutative92.4%
Simplified92.4%
if -2.69999999999999982e-26 < z < 5.7999999999999997e-71Initial program 92.3%
Taylor expanded in z around 0 79.1%
if 5.7999999999999997e-71 < z Initial program 99.9%
Taylor expanded in a around 0 71.9%
associate-/l*85.4%
div-sub85.4%
*-inverses85.4%
Simplified85.4%
Final simplification84.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.25e-14) (not (<= z 1.6e-72))) (+ x y) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.25e-14) || !(z <= 1.6e-72)) {
tmp = x + y;
} 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 <= (-2.25d-14)) .or. (.not. (z <= 1.6d-72))) then
tmp = x + y
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 <= -2.25e-14) || !(z <= 1.6e-72)) {
tmp = x + y;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.25e-14) or not (z <= 1.6e-72): tmp = x + y else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.25e-14) || !(z <= 1.6e-72)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.25e-14) || ~((z <= 1.6e-72))) tmp = x + y; else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.25e-14], N[Not[LessEqual[z, 1.6e-72]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.25 \cdot 10^{-14} \lor \neg \left(z \leq 1.6 \cdot 10^{-72}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -2.2499999999999999e-14 or 1.6e-72 < z Initial program 99.9%
Taylor expanded in z around inf 78.8%
+-commutative78.8%
Simplified78.8%
if -2.2499999999999999e-14 < z < 1.6e-72Initial program 92.3%
Taylor expanded in z around 0 79.1%
Final simplification78.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.26e-15) (not (<= z 9.2e-70))) (+ x y) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.26e-15) || !(z <= 9.2e-70)) {
tmp = x + y;
} else {
tmp = x + (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 ((z <= (-1.26d-15)) .or. (.not. (z <= 9.2d-70))) then
tmp = x + y
else
tmp = x + (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 ((z <= -1.26e-15) || !(z <= 9.2e-70)) {
tmp = x + y;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.26e-15) or not (z <= 9.2e-70): tmp = x + y else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.26e-15) || !(z <= 9.2e-70)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.26e-15) || ~((z <= 9.2e-70))) tmp = x + y; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.26e-15], N[Not[LessEqual[z, 9.2e-70]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.26 \cdot 10^{-15} \lor \neg \left(z \leq 9.2 \cdot 10^{-70}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -1.26e-15 or 9.20000000000000002e-70 < z Initial program 99.9%
Taylor expanded in z around inf 78.8%
+-commutative78.8%
Simplified78.8%
if -1.26e-15 < z < 9.20000000000000002e-70Initial program 92.3%
clear-num92.0%
un-div-inv93.1%
Applied egg-rr93.1%
Taylor expanded in z around 0 78.7%
Final simplification78.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4e-14) (not (<= z 2.2e-69))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4e-14) || !(z <= 2.2e-69)) {
tmp = x + y;
} 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 <= (-4d-14)) .or. (.not. (z <= 2.2d-69))) then
tmp = x + y
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 <= -4e-14) || !(z <= 2.2e-69)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4e-14) or not (z <= 2.2e-69): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4e-14) || !(z <= 2.2e-69)) tmp = Float64(x + y); 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 <= -4e-14) || ~((z <= 2.2e-69))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4e-14], N[Not[LessEqual[z, 2.2e-69]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{-14} \lor \neg \left(z \leq 2.2 \cdot 10^{-69}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -4e-14 or 2.2e-69 < z Initial program 99.9%
Taylor expanded in z around inf 78.8%
+-commutative78.8%
Simplified78.8%
if -4e-14 < z < 2.2e-69Initial program 92.3%
Taylor expanded in z around 0 79.1%
*-commutative79.1%
associate-/l*77.8%
Simplified77.8%
Final simplification78.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.45e-54) (not (<= z 8.6e-52))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.45e-54) || !(z <= 8.6e-52)) {
tmp = x + y;
} 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 ((z <= (-2.45d-54)) .or. (.not. (z <= 8.6d-52))) then
tmp = x + y
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 ((z <= -2.45e-54) || !(z <= 8.6e-52)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.45e-54) or not (z <= 8.6e-52): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.45e-54) || !(z <= 8.6e-52)) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.45e-54) || ~((z <= 8.6e-52))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.45e-54], N[Not[LessEqual[z, 8.6e-52]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.45 \cdot 10^{-54} \lor \neg \left(z \leq 8.6 \cdot 10^{-52}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.4500000000000001e-54 or 8.6000000000000007e-52 < z Initial program 99.9%
Taylor expanded in z around inf 77.5%
+-commutative77.5%
Simplified77.5%
if -2.4500000000000001e-54 < z < 8.6000000000000007e-52Initial program 91.7%
Taylor expanded in x around inf 52.6%
Final simplification66.6%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - 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 * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Initial program 96.3%
(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 96.3%
Taylor expanded in x around inf 51.7%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
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 - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2024087
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:alt
(+ x (/ y (/ (- z a) (- z t))))
(+ x (* y (/ (- z t) (- z a)))))