
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - 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 - z) * t) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\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 z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - 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 - z) * t) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\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(Float64(Float64(y - z) / Float64(a - 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[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y - z}{a - z} \cdot t
\end{array}
Initial program 86.4%
associate-*l/98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* z (/ t (- a z))))) (t_2 (+ x (/ (* y t) (- a z)))))
(if (<= z -6.8e+137)
(+ x t)
(if (<= z -1.35e+14)
t_2
(if (<= z -6.3e-25)
t_1
(if (<= z 2e-273)
(+ x (/ t (/ a (- y z))))
(if (<= z 1.1e-88) t_2 t_1)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (z * (t / (a - z)));
double t_2 = x + ((y * t) / (a - z));
double tmp;
if (z <= -6.8e+137) {
tmp = x + t;
} else if (z <= -1.35e+14) {
tmp = t_2;
} else if (z <= -6.3e-25) {
tmp = t_1;
} else if (z <= 2e-273) {
tmp = x + (t / (a / (y - z)));
} else if (z <= 1.1e-88) {
tmp = t_2;
} else {
tmp = 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) :: t_2
real(8) :: tmp
t_1 = x - (z * (t / (a - z)))
t_2 = x + ((y * t) / (a - z))
if (z <= (-6.8d+137)) then
tmp = x + t
else if (z <= (-1.35d+14)) then
tmp = t_2
else if (z <= (-6.3d-25)) then
tmp = t_1
else if (z <= 2d-273) then
tmp = x + (t / (a / (y - z)))
else if (z <= 1.1d-88) then
tmp = t_2
else
tmp = 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 = x - (z * (t / (a - z)));
double t_2 = x + ((y * t) / (a - z));
double tmp;
if (z <= -6.8e+137) {
tmp = x + t;
} else if (z <= -1.35e+14) {
tmp = t_2;
} else if (z <= -6.3e-25) {
tmp = t_1;
} else if (z <= 2e-273) {
tmp = x + (t / (a / (y - z)));
} else if (z <= 1.1e-88) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (z * (t / (a - z))) t_2 = x + ((y * t) / (a - z)) tmp = 0 if z <= -6.8e+137: tmp = x + t elif z <= -1.35e+14: tmp = t_2 elif z <= -6.3e-25: tmp = t_1 elif z <= 2e-273: tmp = x + (t / (a / (y - z))) elif z <= 1.1e-88: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(z * Float64(t / Float64(a - z)))) t_2 = Float64(x + Float64(Float64(y * t) / Float64(a - z))) tmp = 0.0 if (z <= -6.8e+137) tmp = Float64(x + t); elseif (z <= -1.35e+14) tmp = t_2; elseif (z <= -6.3e-25) tmp = t_1; elseif (z <= 2e-273) tmp = Float64(x + Float64(t / Float64(a / Float64(y - z)))); elseif (z <= 1.1e-88) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (z * (t / (a - z))); t_2 = x + ((y * t) / (a - z)); tmp = 0.0; if (z <= -6.8e+137) tmp = x + t; elseif (z <= -1.35e+14) tmp = t_2; elseif (z <= -6.3e-25) tmp = t_1; elseif (z <= 2e-273) tmp = x + (t / (a / (y - z))); elseif (z <= 1.1e-88) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(z * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.8e+137], N[(x + t), $MachinePrecision], If[LessEqual[z, -1.35e+14], t$95$2, If[LessEqual[z, -6.3e-25], t$95$1, If[LessEqual[z, 2e-273], N[(x + N[(t / N[(a / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e-88], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - z \cdot \frac{t}{a - z}\\
t_2 := x + \frac{y \cdot t}{a - z}\\
\mathbf{if}\;z \leq -6.8 \cdot 10^{+137}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq -1.35 \cdot 10^{+14}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -6.3 \cdot 10^{-25}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2 \cdot 10^{-273}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y - z}}\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-88}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -6.79999999999999973e137Initial program 71.3%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 96.9%
if -6.79999999999999973e137 < z < -1.35e14 or 2e-273 < z < 1.10000000000000002e-88Initial program 90.1%
associate-*l/97.1%
Simplified97.1%
Taylor expanded in y around inf 88.6%
if -1.35e14 < z < -6.29999999999999961e-25 or 1.10000000000000002e-88 < z Initial program 87.9%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around 0 80.8%
+-commutative80.8%
mul-1-neg80.8%
unsub-neg80.8%
associate-/l*92.8%
associate-/r/89.6%
Simplified89.6%
if -6.29999999999999961e-25 < z < 2e-273Initial program 87.4%
associate-*l/97.6%
Simplified97.6%
Taylor expanded in a around inf 82.4%
associate-/l*92.6%
Simplified92.6%
Final simplification91.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.15e+65)
(+ x t)
(if (<= z 1.9e-273)
(+ x (/ y (/ a t)))
(if (<= z 4.6e-17) (+ x (/ (* y t) (- a z))) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.15e+65) {
tmp = x + t;
} else if (z <= 1.9e-273) {
tmp = x + (y / (a / t));
} else if (z <= 4.6e-17) {
tmp = x + ((y * t) / (a - z));
} else {
tmp = x + 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 <= (-3.15d+65)) then
tmp = x + t
else if (z <= 1.9d-273) then
tmp = x + (y / (a / t))
else if (z <= 4.6d-17) then
tmp = x + ((y * t) / (a - z))
else
tmp = x + 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 <= -3.15e+65) {
tmp = x + t;
} else if (z <= 1.9e-273) {
tmp = x + (y / (a / t));
} else if (z <= 4.6e-17) {
tmp = x + ((y * t) / (a - z));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.15e+65: tmp = x + t elif z <= 1.9e-273: tmp = x + (y / (a / t)) elif z <= 4.6e-17: tmp = x + ((y * t) / (a - z)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.15e+65) tmp = Float64(x + t); elseif (z <= 1.9e-273) tmp = Float64(x + Float64(y / Float64(a / t))); elseif (z <= 4.6e-17) tmp = Float64(x + Float64(Float64(y * t) / Float64(a - z))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.15e+65) tmp = x + t; elseif (z <= 1.9e-273) tmp = x + (y / (a / t)); elseif (z <= 4.6e-17) tmp = x + ((y * t) / (a - z)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.15e+65], N[(x + t), $MachinePrecision], If[LessEqual[z, 1.9e-273], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.6e-17], N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.15 \cdot 10^{+65}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-273}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{-17}:\\
\;\;\;\;x + \frac{y \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -3.14999999999999999e65 or 4.60000000000000018e-17 < z Initial program 79.2%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 88.1%
if -3.14999999999999999e65 < z < 1.9000000000000002e-273Initial program 86.6%
associate-*l/98.0%
Simplified98.0%
Taylor expanded in z around 0 74.8%
associate-/l*85.5%
Simplified85.5%
if 1.9000000000000002e-273 < z < 4.60000000000000018e-17Initial program 98.3%
associate-*l/96.6%
Simplified96.6%
Taylor expanded in y around inf 88.4%
Final simplification87.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -4.5e+64)
(+ x t)
(if (<= z 1.58e-273)
(+ x (* (- y z) (/ t a)))
(if (<= z 2.15e-16) (+ x (/ (* y t) (- a z))) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.5e+64) {
tmp = x + t;
} else if (z <= 1.58e-273) {
tmp = x + ((y - z) * (t / a));
} else if (z <= 2.15e-16) {
tmp = x + ((y * t) / (a - z));
} else {
tmp = x + 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 <= (-4.5d+64)) then
tmp = x + t
else if (z <= 1.58d-273) then
tmp = x + ((y - z) * (t / a))
else if (z <= 2.15d-16) then
tmp = x + ((y * t) / (a - z))
else
tmp = x + 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 <= -4.5e+64) {
tmp = x + t;
} else if (z <= 1.58e-273) {
tmp = x + ((y - z) * (t / a));
} else if (z <= 2.15e-16) {
tmp = x + ((y * t) / (a - z));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.5e+64: tmp = x + t elif z <= 1.58e-273: tmp = x + ((y - z) * (t / a)) elif z <= 2.15e-16: tmp = x + ((y * t) / (a - z)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.5e+64) tmp = Float64(x + t); elseif (z <= 1.58e-273) tmp = Float64(x + Float64(Float64(y - z) * Float64(t / a))); elseif (z <= 2.15e-16) tmp = Float64(x + Float64(Float64(y * t) / Float64(a - z))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4.5e+64) tmp = x + t; elseif (z <= 1.58e-273) tmp = x + ((y - z) * (t / a)); elseif (z <= 2.15e-16) tmp = x + ((y * t) / (a - z)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.5e+64], N[(x + t), $MachinePrecision], If[LessEqual[z, 1.58e-273], N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.15e-16], N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+64}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 1.58 \cdot 10^{-273}:\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{-16}:\\
\;\;\;\;x + \frac{y \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -4.49999999999999973e64 or 2.1499999999999999e-16 < z Initial program 79.6%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 88.3%
if -4.49999999999999973e64 < z < 1.57999999999999994e-273Initial program 86.3%
associate-*l/97.9%
Simplified97.9%
Taylor expanded in a around inf 74.9%
associate-/l*86.5%
associate-/r/86.5%
Simplified86.5%
if 1.57999999999999994e-273 < z < 2.1499999999999999e-16Initial program 98.3%
associate-*l/96.6%
Simplified96.6%
Taylor expanded in y around inf 88.4%
Final simplification87.7%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6e+63)
(+ x t)
(if (<= z 1.7e-273)
(+ x (/ t (/ a (- y z))))
(if (<= z 3.8e-16) (+ x (/ (* y t) (- a z))) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6e+63) {
tmp = x + t;
} else if (z <= 1.7e-273) {
tmp = x + (t / (a / (y - z)));
} else if (z <= 3.8e-16) {
tmp = x + ((y * t) / (a - z));
} else {
tmp = x + 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 <= (-6d+63)) then
tmp = x + t
else if (z <= 1.7d-273) then
tmp = x + (t / (a / (y - z)))
else if (z <= 3.8d-16) then
tmp = x + ((y * t) / (a - z))
else
tmp = x + 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 <= -6e+63) {
tmp = x + t;
} else if (z <= 1.7e-273) {
tmp = x + (t / (a / (y - z)));
} else if (z <= 3.8e-16) {
tmp = x + ((y * t) / (a - z));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6e+63: tmp = x + t elif z <= 1.7e-273: tmp = x + (t / (a / (y - z))) elif z <= 3.8e-16: tmp = x + ((y * t) / (a - z)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6e+63) tmp = Float64(x + t); elseif (z <= 1.7e-273) tmp = Float64(x + Float64(t / Float64(a / Float64(y - z)))); elseif (z <= 3.8e-16) tmp = Float64(x + Float64(Float64(y * t) / Float64(a - z))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6e+63) tmp = x + t; elseif (z <= 1.7e-273) tmp = x + (t / (a / (y - z))); elseif (z <= 3.8e-16) tmp = x + ((y * t) / (a - z)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6e+63], N[(x + t), $MachinePrecision], If[LessEqual[z, 1.7e-273], N[(x + N[(t / N[(a / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e-16], N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+63}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-273}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y - z}}\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-16}:\\
\;\;\;\;x + \frac{y \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -5.99999999999999998e63 or 3.80000000000000012e-16 < z Initial program 79.6%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 88.3%
if -5.99999999999999998e63 < z < 1.69999999999999996e-273Initial program 86.3%
associate-*l/97.9%
Simplified97.9%
Taylor expanded in a around inf 74.9%
associate-/l*86.5%
Simplified86.5%
if 1.69999999999999996e-273 < z < 3.80000000000000012e-16Initial program 98.3%
associate-*l/96.6%
Simplified96.6%
Taylor expanded in y around inf 88.4%
Final simplification87.7%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.6e-18)
(- x (/ t (/ z (- y z))))
(if (<= z 1.82e-273)
(+ x (/ t (/ a (- y z))))
(if (<= z 1.85e-89)
(+ x (/ (* y t) (- a z)))
(- x (* z (/ t (- a z))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.6e-18) {
tmp = x - (t / (z / (y - z)));
} else if (z <= 1.82e-273) {
tmp = x + (t / (a / (y - z)));
} else if (z <= 1.85e-89) {
tmp = x + ((y * t) / (a - z));
} else {
tmp = x - (z * (t / (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 (z <= (-2.6d-18)) then
tmp = x - (t / (z / (y - z)))
else if (z <= 1.82d-273) then
tmp = x + (t / (a / (y - z)))
else if (z <= 1.85d-89) then
tmp = x + ((y * t) / (a - z))
else
tmp = x - (z * (t / (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 (z <= -2.6e-18) {
tmp = x - (t / (z / (y - z)));
} else if (z <= 1.82e-273) {
tmp = x + (t / (a / (y - z)));
} else if (z <= 1.85e-89) {
tmp = x + ((y * t) / (a - z));
} else {
tmp = x - (z * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.6e-18: tmp = x - (t / (z / (y - z))) elif z <= 1.82e-273: tmp = x + (t / (a / (y - z))) elif z <= 1.85e-89: tmp = x + ((y * t) / (a - z)) else: tmp = x - (z * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.6e-18) tmp = Float64(x - Float64(t / Float64(z / Float64(y - z)))); elseif (z <= 1.82e-273) tmp = Float64(x + Float64(t / Float64(a / Float64(y - z)))); elseif (z <= 1.85e-89) tmp = Float64(x + Float64(Float64(y * t) / Float64(a - z))); else tmp = Float64(x - Float64(z * Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.6e-18) tmp = x - (t / (z / (y - z))); elseif (z <= 1.82e-273) tmp = x + (t / (a / (y - z))); elseif (z <= 1.85e-89) tmp = x + ((y * t) / (a - z)); else tmp = x - (z * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.6e-18], N[(x - N[(t / N[(z / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.82e-273], N[(x + N[(t / N[(a / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.85e-89], N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(z * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{-18}:\\
\;\;\;\;x - \frac{t}{\frac{z}{y - z}}\\
\mathbf{elif}\;z \leq 1.82 \cdot 10^{-273}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y - z}}\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{-89}:\\
\;\;\;\;x + \frac{y \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -2.6e-18Initial program 77.0%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in a around 0 70.8%
+-commutative70.8%
mul-1-neg70.8%
unsub-neg70.8%
associate-/l*87.8%
Simplified87.8%
if -2.6e-18 < z < 1.81999999999999997e-273Initial program 87.4%
associate-*l/97.6%
Simplified97.6%
Taylor expanded in a around inf 82.4%
associate-/l*92.6%
Simplified92.6%
if 1.81999999999999997e-273 < z < 1.8499999999999999e-89Initial program 97.7%
associate-*l/95.4%
Simplified95.4%
Taylor expanded in y around inf 93.1%
if 1.8499999999999999e-89 < z Initial program 86.7%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around 0 79.9%
+-commutative79.9%
mul-1-neg79.9%
unsub-neg79.9%
associate-/l*93.0%
associate-/r/89.6%
Simplified89.6%
Final simplification90.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.15e+65) (+ x t) (if (<= z 6.4e-62) (+ x (* y (/ t a))) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.15e+65) {
tmp = x + t;
} else if (z <= 6.4e-62) {
tmp = x + (y * (t / a));
} else {
tmp = x + 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 <= (-3.15d+65)) then
tmp = x + t
else if (z <= 6.4d-62) then
tmp = x + (y * (t / a))
else
tmp = x + 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 <= -3.15e+65) {
tmp = x + t;
} else if (z <= 6.4e-62) {
tmp = x + (y * (t / a));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.15e+65: tmp = x + t elif z <= 6.4e-62: tmp = x + (y * (t / a)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.15e+65) tmp = Float64(x + t); elseif (z <= 6.4e-62) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.15e+65) tmp = x + t; elseif (z <= 6.4e-62) tmp = x + (y * (t / a)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.15e+65], N[(x + t), $MachinePrecision], If[LessEqual[z, 6.4e-62], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.15 \cdot 10^{+65}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{-62}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -3.14999999999999999e65 or 6.40000000000000043e-62 < z Initial program 81.6%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 85.5%
if -3.14999999999999999e65 < z < 6.40000000000000043e-62Initial program 90.1%
associate-*l/97.3%
Simplified97.3%
Taylor expanded in z around 0 76.1%
associate-/l*82.7%
div-inv82.7%
clear-num82.7%
Applied egg-rr82.7%
Final simplification84.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.15e+65) (+ x t) (if (<= z 6.2e-58) (+ x (/ y (/ a t))) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.15e+65) {
tmp = x + t;
} else if (z <= 6.2e-58) {
tmp = x + (y / (a / t));
} else {
tmp = x + 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 <= (-3.15d+65)) then
tmp = x + t
else if (z <= 6.2d-58) then
tmp = x + (y / (a / t))
else
tmp = x + 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 <= -3.15e+65) {
tmp = x + t;
} else if (z <= 6.2e-58) {
tmp = x + (y / (a / t));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.15e+65: tmp = x + t elif z <= 6.2e-58: tmp = x + (y / (a / t)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.15e+65) tmp = Float64(x + t); elseif (z <= 6.2e-58) tmp = Float64(x + Float64(y / Float64(a / t))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.15e+65) tmp = x + t; elseif (z <= 6.2e-58) tmp = x + (y / (a / t)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.15e+65], N[(x + t), $MachinePrecision], If[LessEqual[z, 6.2e-58], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.15 \cdot 10^{+65}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{-58}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -3.14999999999999999e65 or 6.1999999999999998e-58 < z Initial program 81.6%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 85.5%
if -3.14999999999999999e65 < z < 6.1999999999999998e-58Initial program 90.1%
associate-*l/97.3%
Simplified97.3%
Taylor expanded in z around 0 76.1%
associate-/l*82.7%
Simplified82.7%
Final simplification84.0%
(FPCore (x y z t a) :precision binary64 (if (<= a -5e+184) x (if (<= a 1.05e+162) (+ x t) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5e+184) {
tmp = x;
} else if (a <= 1.05e+162) {
tmp = x + t;
} 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+184)) then
tmp = x
else if (a <= 1.05d+162) then
tmp = x + t
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+184) {
tmp = x;
} else if (a <= 1.05e+162) {
tmp = x + t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -5e+184: tmp = x elif a <= 1.05e+162: tmp = x + t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -5e+184) tmp = x; elseif (a <= 1.05e+162) tmp = Float64(x + t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -5e+184) tmp = x; elseif (a <= 1.05e+162) tmp = x + t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5e+184], x, If[LessEqual[a, 1.05e+162], N[(x + t), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5 \cdot 10^{+184}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.05 \cdot 10^{+162}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -4.9999999999999999e184 or 1.05e162 < a Initial program 79.0%
associate-*l/98.3%
Simplified98.3%
Taylor expanded in x around inf 74.6%
if -4.9999999999999999e184 < a < 1.05e162Initial program 88.6%
associate-*l/98.5%
Simplified98.5%
Taylor expanded in z around inf 63.7%
Final simplification66.2%
(FPCore (x y z t a) :precision binary64 (if (<= x -7.2e-91) x (if (<= x 2.1e-69) t x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -7.2e-91) {
tmp = x;
} else if (x <= 2.1e-69) {
tmp = t;
} 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 <= (-7.2d-91)) then
tmp = x
else if (x <= 2.1d-69) then
tmp = t
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 <= -7.2e-91) {
tmp = x;
} else if (x <= 2.1e-69) {
tmp = t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -7.2e-91: tmp = x elif x <= 2.1e-69: tmp = t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -7.2e-91) tmp = x; elseif (x <= 2.1e-69) tmp = t; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -7.2e-91) tmp = x; elseif (x <= 2.1e-69) tmp = t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -7.2e-91], x, If[LessEqual[x, 2.1e-69], t, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.2 \cdot 10^{-91}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{-69}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -7.2000000000000001e-91 or 2.1e-69 < x Initial program 88.0%
associate-*l/98.7%
Simplified98.7%
Taylor expanded in x around inf 71.1%
if -7.2000000000000001e-91 < x < 2.1e-69Initial program 83.9%
associate-*l/98.0%
Simplified98.0%
add-cube-cbrt96.6%
pow396.7%
Applied egg-rr96.7%
Taylor expanded in x around 0 61.7%
pow-base-161.7%
associate-*r/61.7%
*-lft-identity61.7%
associate-*r/75.3%
Simplified75.3%
Taylor expanded in z around inf 37.6%
Final simplification57.6%
(FPCore (x y z t a) :precision binary64 t)
double code(double x, double y, double z, double t, double a) {
return 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 = t
end function
public static double code(double x, double y, double z, double t, double a) {
return t;
}
def code(x, y, z, t, a): return t
function code(x, y, z, t, a) return t end
function tmp = code(x, y, z, t, a) tmp = t; end
code[x_, y_, z_, t_, a_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 86.4%
associate-*l/98.4%
Simplified98.4%
add-cube-cbrt97.7%
pow397.7%
Applied egg-rr97.7%
Taylor expanded in x around 0 40.2%
pow-base-140.2%
associate-*r/40.2%
*-lft-identity40.2%
associate-*r/47.9%
Simplified47.9%
Taylor expanded in z around inf 19.6%
Final simplification19.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ (- y z) (- a z)) t))))
(if (< t -1.0682974490174067e-39)
t_1
(if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - z) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (a - z));
} else {
tmp = 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 = x + (((y - z) / (a - z)) * t)
if (t < (-1.0682974490174067d-39)) then
tmp = t_1
else if (t < 3.9110949887586375d-141) then
tmp = x + (((y - z) * t) / (a - z))
else
tmp = 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 = x + (((y - z) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (((y - z) / (a - z)) * t) tmp = 0 if t < -1.0682974490174067e-39: tmp = t_1 elif t < 3.9110949887586375e-141: tmp = x + (((y - z) * t) / (a - z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - z) / Float64(a - z)) * t)) tmp = 0.0 if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (((y - z) / (a - z)) * t); tmp = 0.0; if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = x + (((y - z) * t) / (a - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.0682974490174067e-39], t$95$1, If[Less[t, 3.9110949887586375e-141], N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y - z}{a - z} \cdot t\\
\mathbf{if}\;t < -1.0682974490174067 \cdot 10^{-39}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t < 3.9110949887586375 \cdot 10^{-141}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
herbie shell --seed 2023279
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(if (< t -1.0682974490174067e-39) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t))))
(+ x (/ (* (- y z) t) (- a z))))