
(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 13 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(y - z) / Float64(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[(y - z), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y - z}{\frac{a - z}{t}}
\end{array}
Initial program 83.7%
associate-/l*98.6%
Simplified98.6%
Final simplification98.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.35e+84)
(+ x t)
(if (<= z -2.9e-217)
(+ x (* t (/ y (- a z))))
(if (<= z 30000.0) (+ x (/ (* (- y z) t) a)) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.35e+84) {
tmp = x + t;
} else if (z <= -2.9e-217) {
tmp = x + (t * (y / (a - z)));
} else if (z <= 30000.0) {
tmp = x + (((y - z) * 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 <= (-1.35d+84)) then
tmp = x + t
else if (z <= (-2.9d-217)) then
tmp = x + (t * (y / (a - z)))
else if (z <= 30000.0d0) then
tmp = x + (((y - z) * 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 <= -1.35e+84) {
tmp = x + t;
} else if (z <= -2.9e-217) {
tmp = x + (t * (y / (a - z)));
} else if (z <= 30000.0) {
tmp = x + (((y - z) * t) / a);
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.35e+84: tmp = x + t elif z <= -2.9e-217: tmp = x + (t * (y / (a - z))) elif z <= 30000.0: tmp = x + (((y - z) * t) / a) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.35e+84) tmp = Float64(x + t); elseif (z <= -2.9e-217) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); elseif (z <= 30000.0) tmp = Float64(x + Float64(Float64(Float64(y - z) * 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 <= -1.35e+84) tmp = x + t; elseif (z <= -2.9e-217) tmp = x + (t * (y / (a - z))); elseif (z <= 30000.0) tmp = x + (((y - z) * t) / a); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.35e+84], N[(x + t), $MachinePrecision], If[LessEqual[z, -2.9e-217], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 30000.0], N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{+84}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{-217}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{elif}\;z \leq 30000:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -1.35e84 or 3e4 < z Initial program 69.9%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 85.2%
if -1.35e84 < z < -2.89999999999999982e-217Initial program 95.1%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around inf 87.1%
if -2.89999999999999982e-217 < z < 3e4Initial program 96.2%
associate-*l/93.9%
Simplified93.9%
Taylor expanded in a around inf 91.3%
Final simplification87.5%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.6e+84)
(+ x t)
(if (<= z -2.2e-213)
(+ x (* t (/ y (- a z))))
(if (<= z 11800.0) (+ x (/ (- y z) (/ a t))) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.6e+84) {
tmp = x + t;
} else if (z <= -2.2e-213) {
tmp = x + (t * (y / (a - z)));
} else if (z <= 11800.0) {
tmp = x + ((y - z) / (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 <= (-1.6d+84)) then
tmp = x + t
else if (z <= (-2.2d-213)) then
tmp = x + (t * (y / (a - z)))
else if (z <= 11800.0d0) then
tmp = x + ((y - z) / (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 <= -1.6e+84) {
tmp = x + t;
} else if (z <= -2.2e-213) {
tmp = x + (t * (y / (a - z)));
} else if (z <= 11800.0) {
tmp = x + ((y - z) / (a / t));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.6e+84: tmp = x + t elif z <= -2.2e-213: tmp = x + (t * (y / (a - z))) elif z <= 11800.0: tmp = x + ((y - z) / (a / t)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.6e+84) tmp = Float64(x + t); elseif (z <= -2.2e-213) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); elseif (z <= 11800.0) tmp = Float64(x + Float64(Float64(y - z) / 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 <= -1.6e+84) tmp = x + t; elseif (z <= -2.2e-213) tmp = x + (t * (y / (a - z))); elseif (z <= 11800.0) tmp = x + ((y - z) / (a / t)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.6e+84], N[(x + t), $MachinePrecision], If[LessEqual[z, -2.2e-213], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 11800.0], N[(x + N[(N[(y - z), $MachinePrecision] / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+84}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-213}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{elif}\;z \leq 11800:\\
\;\;\;\;x + \frac{y - z}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -1.60000000000000005e84 or 11800 < z Initial program 69.9%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 85.2%
if -1.60000000000000005e84 < z < -2.2000000000000001e-213Initial program 95.1%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around inf 87.1%
if -2.2000000000000001e-213 < z < 11800Initial program 96.2%
associate-/l*98.7%
Simplified98.7%
Taylor expanded in a around inf 93.8%
Final simplification88.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (/ t (+ (/ a z) -1.0)))))
(if (<= z -1.52e+16)
t_1
(if (<= z -3.85e-212)
(+ x (* t (/ y (- a z))))
(if (<= z 850.0) (+ x (/ (- y z) (/ a t))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (t / ((a / z) + -1.0));
double tmp;
if (z <= -1.52e+16) {
tmp = t_1;
} else if (z <= -3.85e-212) {
tmp = x + (t * (y / (a - z)));
} else if (z <= 850.0) {
tmp = x + ((y - z) / (a / t));
} 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 - (t / ((a / z) + (-1.0d0)))
if (z <= (-1.52d+16)) then
tmp = t_1
else if (z <= (-3.85d-212)) then
tmp = x + (t * (y / (a - z)))
else if (z <= 850.0d0) then
tmp = x + ((y - z) / (a / t))
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 - (t / ((a / z) + -1.0));
double tmp;
if (z <= -1.52e+16) {
tmp = t_1;
} else if (z <= -3.85e-212) {
tmp = x + (t * (y / (a - z)));
} else if (z <= 850.0) {
tmp = x + ((y - z) / (a / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (t / ((a / z) + -1.0)) tmp = 0 if z <= -1.52e+16: tmp = t_1 elif z <= -3.85e-212: tmp = x + (t * (y / (a - z))) elif z <= 850.0: tmp = x + ((y - z) / (a / t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(t / Float64(Float64(a / z) + -1.0))) tmp = 0.0 if (z <= -1.52e+16) tmp = t_1; elseif (z <= -3.85e-212) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); elseif (z <= 850.0) tmp = Float64(x + Float64(Float64(y - z) / Float64(a / t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (t / ((a / z) + -1.0)); tmp = 0.0; if (z <= -1.52e+16) tmp = t_1; elseif (z <= -3.85e-212) tmp = x + (t * (y / (a - z))); elseif (z <= 850.0) tmp = x + ((y - z) / (a / t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(t / N[(N[(a / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.52e+16], t$95$1, If[LessEqual[z, -3.85e-212], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 850.0], N[(x + N[(N[(y - z), $MachinePrecision] / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \frac{t}{\frac{a}{z} + -1}\\
\mathbf{if}\;z \leq -1.52 \cdot 10^{+16}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3.85 \cdot 10^{-212}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{elif}\;z \leq 850:\\
\;\;\;\;x + \frac{y - z}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.52e16 or 850 < z Initial program 71.3%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in y around 0 64.6%
mul-1-neg64.6%
unsub-neg64.6%
associate-/l*88.6%
div-sub88.6%
*-inverses88.6%
Simplified88.6%
if -1.52e16 < z < -3.8499999999999999e-212Initial program 97.8%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around inf 92.1%
if -3.8499999999999999e-212 < z < 850Initial program 96.2%
associate-/l*98.7%
Simplified98.7%
Taylor expanded in a around inf 93.8%
Final simplification90.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -4.6e+16)
(- x (/ t (+ (/ a z) -1.0)))
(if (<= z -4.9e-214)
(+ x (* t (/ y (- a z))))
(if (<= z 0.0136) (+ x (/ (- y z) (/ a t))) (- x (/ t (/ z (- y z))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.6e+16) {
tmp = x - (t / ((a / z) + -1.0));
} else if (z <= -4.9e-214) {
tmp = x + (t * (y / (a - z)));
} else if (z <= 0.0136) {
tmp = x + ((y - z) / (a / t));
} else {
tmp = x - (t / (z / (y - 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 <= (-4.6d+16)) then
tmp = x - (t / ((a / z) + (-1.0d0)))
else if (z <= (-4.9d-214)) then
tmp = x + (t * (y / (a - z)))
else if (z <= 0.0136d0) then
tmp = x + ((y - z) / (a / t))
else
tmp = x - (t / (z / (y - 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 <= -4.6e+16) {
tmp = x - (t / ((a / z) + -1.0));
} else if (z <= -4.9e-214) {
tmp = x + (t * (y / (a - z)));
} else if (z <= 0.0136) {
tmp = x + ((y - z) / (a / t));
} else {
tmp = x - (t / (z / (y - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.6e+16: tmp = x - (t / ((a / z) + -1.0)) elif z <= -4.9e-214: tmp = x + (t * (y / (a - z))) elif z <= 0.0136: tmp = x + ((y - z) / (a / t)) else: tmp = x - (t / (z / (y - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.6e+16) tmp = Float64(x - Float64(t / Float64(Float64(a / z) + -1.0))); elseif (z <= -4.9e-214) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); elseif (z <= 0.0136) tmp = Float64(x + Float64(Float64(y - z) / Float64(a / t))); else tmp = Float64(x - Float64(t / Float64(z / Float64(y - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4.6e+16) tmp = x - (t / ((a / z) + -1.0)); elseif (z <= -4.9e-214) tmp = x + (t * (y / (a - z))); elseif (z <= 0.0136) tmp = x + ((y - z) / (a / t)); else tmp = x - (t / (z / (y - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.6e+16], N[(x - N[(t / N[(N[(a / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.9e-214], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.0136], N[(x + N[(N[(y - z), $MachinePrecision] / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t / N[(z / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.6 \cdot 10^{+16}:\\
\;\;\;\;x - \frac{t}{\frac{a}{z} + -1}\\
\mathbf{elif}\;z \leq -4.9 \cdot 10^{-214}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{elif}\;z \leq 0.0136:\\
\;\;\;\;x + \frac{y - z}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{t}{\frac{z}{y - z}}\\
\end{array}
\end{array}
if z < -4.6e16Initial program 66.9%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in y around 0 62.6%
mul-1-neg62.6%
unsub-neg62.6%
associate-/l*92.2%
div-sub92.2%
*-inverses92.2%
Simplified92.2%
if -4.6e16 < z < -4.89999999999999968e-214Initial program 97.8%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around inf 92.1%
if -4.89999999999999968e-214 < z < 0.0135999999999999992Initial program 96.1%
associate-/l*98.7%
Simplified98.7%
Taylor expanded in a around inf 94.8%
if 0.0135999999999999992 < z Initial program 76.7%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in a around 0 70.7%
mul-1-neg70.7%
unsub-neg70.7%
associate-/l*90.8%
Simplified90.8%
Final simplification92.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.86e+84) (not (<= z 3.3e+38))) (+ x t) (+ x (* t (/ y (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.86e+84) || !(z <= 3.3e+38)) {
tmp = x + t;
} else {
tmp = x + (t * (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 ((z <= (-1.86d+84)) .or. (.not. (z <= 3.3d+38))) then
tmp = x + t
else
tmp = x + (t * (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 ((z <= -1.86e+84) || !(z <= 3.3e+38)) {
tmp = x + t;
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.86e+84) or not (z <= 3.3e+38): tmp = x + t else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.86e+84) || !(z <= 3.3e+38)) tmp = Float64(x + t); else tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.86e+84) || ~((z <= 3.3e+38))) tmp = x + t; else tmp = x + (t * (y / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.86e+84], N[Not[LessEqual[z, 3.3e+38]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.86 \cdot 10^{+84} \lor \neg \left(z \leq 3.3 \cdot 10^{+38}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if z < -1.86000000000000006e84 or 3.2999999999999999e38 < z Initial program 69.1%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 86.1%
if -1.86000000000000006e84 < z < 3.2999999999999999e38Initial program 95.3%
associate-*l/96.6%
Simplified96.6%
Taylor expanded in y around inf 84.5%
Final simplification85.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.45e+140) (not (<= t 4.1e+140))) (* t (- 1.0 (/ y z))) (+ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.45e+140) || !(t <= 4.1e+140)) {
tmp = t * (1.0 - (y / 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 ((t <= (-1.45d+140)) .or. (.not. (t <= 4.1d+140))) then
tmp = t * (1.0d0 - (y / 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 ((t <= -1.45e+140) || !(t <= 4.1e+140)) {
tmp = t * (1.0 - (y / z));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.45e+140) or not (t <= 4.1e+140): tmp = t * (1.0 - (y / z)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.45e+140) || !(t <= 4.1e+140)) tmp = Float64(t * Float64(1.0 - Float64(y / z))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.45e+140) || ~((t <= 4.1e+140))) tmp = t * (1.0 - (y / z)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.45e+140], N[Not[LessEqual[t, 4.1e+140]], $MachinePrecision]], N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.45 \cdot 10^{+140} \lor \neg \left(t \leq 4.1 \cdot 10^{+140}\right):\\
\;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if t < -1.4499999999999999e140 or 4.0999999999999999e140 < t Initial program 59.3%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in a around 0 29.3%
mul-1-neg29.3%
unsub-neg29.3%
associate-/l*60.6%
Simplified60.6%
Taylor expanded in t around inf 53.6%
if -1.4499999999999999e140 < t < 4.0999999999999999e140Initial program 94.5%
associate-*l/97.9%
Simplified97.9%
Taylor expanded in z around inf 72.9%
Final simplification67.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.8e+83) (not (<= z 2.3e-17))) (+ x t) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.8e+83) || !(z <= 2.3e-17)) {
tmp = x + t;
} 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 <= (-8.8d+83)) .or. (.not. (z <= 2.3d-17))) then
tmp = x + t
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 <= -8.8e+83) || !(z <= 2.3e-17)) {
tmp = x + t;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.8e+83) or not (z <= 2.3e-17): tmp = x + t else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.8e+83) || !(z <= 2.3e-17)) tmp = Float64(x + t); 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 <= -8.8e+83) || ~((z <= 2.3e-17))) tmp = x + t; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.8e+83], N[Not[LessEqual[z, 2.3e-17]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.8 \cdot 10^{+83} \lor \neg \left(z \leq 2.3 \cdot 10^{-17}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -8.79999999999999995e83 or 2.30000000000000009e-17 < z Initial program 71.1%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 83.5%
if -8.79999999999999995e83 < z < 2.30000000000000009e-17Initial program 95.6%
associate-*l/96.3%
Simplified96.3%
Taylor expanded in z around 0 77.4%
Final simplification80.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.8e+83) (not (<= z 460.0))) (+ x t) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.8e+83) || !(z <= 460.0)) {
tmp = x + t;
} 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 <= (-8.8d+83)) .or. (.not. (z <= 460.0d0))) then
tmp = x + t
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 <= -8.8e+83) || !(z <= 460.0)) {
tmp = x + t;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.8e+83) or not (z <= 460.0): tmp = x + t else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.8e+83) || !(z <= 460.0)) tmp = Float64(x + t); 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 <= -8.8e+83) || ~((z <= 460.0))) tmp = x + t; else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.8e+83], N[Not[LessEqual[z, 460.0]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.8 \cdot 10^{+83} \lor \neg \left(z \leq 460\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -8.79999999999999995e83 or 460 < z Initial program 69.9%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 85.2%
if -8.79999999999999995e83 < z < 460Initial program 95.8%
associate-*l/96.5%
Simplified96.5%
Taylor expanded in z around 0 77.6%
Final simplification81.1%
(FPCore (x y z t a) :precision binary64 (+ x (* t (/ (- y z) (- a z)))))
double code(double x, double y, double z, double t, double a) {
return x + (t * ((y - z) / (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 + (t * ((y - z) / (a - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (t * ((y - z) / (a - z)));
}
def code(x, y, z, t, a): return x + (t * ((y - z) / (a - z)))
function code(x, y, z, t, a) return Float64(x + Float64(t * Float64(Float64(y - z) / Float64(a - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + (t * ((y - z) / (a - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + t \cdot \frac{y - z}{a - z}
\end{array}
Initial program 83.7%
associate-*l/98.1%
Simplified98.1%
Final simplification98.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.7e-19) (not (<= z 1.65e-27))) (+ x t) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.7e-19) || !(z <= 1.65e-27)) {
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 ((z <= (-2.7d-19)) .or. (.not. (z <= 1.65d-27))) 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 ((z <= -2.7e-19) || !(z <= 1.65e-27)) {
tmp = x + t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.7e-19) or not (z <= 1.65e-27): tmp = x + t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.7e-19) || !(z <= 1.65e-27)) tmp = Float64(x + t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.7e-19) || ~((z <= 1.65e-27))) tmp = x + t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.7e-19], N[Not[LessEqual[z, 1.65e-27]], $MachinePrecision]], N[(x + t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{-19} \lor \neg \left(z \leq 1.65 \cdot 10^{-27}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.7000000000000001e-19 or 1.64999999999999999e-27 < z Initial program 74.1%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 77.1%
if -2.7000000000000001e-19 < z < 1.64999999999999999e-27Initial program 97.2%
associate-*l/95.5%
Simplified95.5%
Taylor expanded in x around inf 51.3%
Final simplification66.3%
(FPCore (x y z t a) :precision binary64 (if (<= x -1.1e-63) x (if (<= x 1.4e-124) t x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.1e-63) {
tmp = x;
} else if (x <= 1.4e-124) {
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 <= (-1.1d-63)) then
tmp = x
else if (x <= 1.4d-124) 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 <= -1.1e-63) {
tmp = x;
} else if (x <= 1.4e-124) {
tmp = t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -1.1e-63: tmp = x elif x <= 1.4e-124: tmp = t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -1.1e-63) tmp = x; elseif (x <= 1.4e-124) tmp = t; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -1.1e-63) tmp = x; elseif (x <= 1.4e-124) tmp = t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.1e-63], x, If[LessEqual[x, 1.4e-124], t, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.1 \cdot 10^{-63}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-124}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.1e-63 or 1.39999999999999999e-124 < x Initial program 82.6%
associate-*l/98.4%
Simplified98.4%
Taylor expanded in x around inf 67.0%
if -1.1e-63 < x < 1.39999999999999999e-124Initial program 86.1%
associate-*l/97.5%
Simplified97.5%
Taylor expanded in a around 0 47.3%
mul-1-neg47.3%
unsub-neg47.3%
associate-/l*58.7%
Simplified58.7%
Taylor expanded in t around inf 52.5%
Taylor expanded in y around 0 31.5%
Final simplification55.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 83.7%
associate-*l/98.1%
Simplified98.1%
Taylor expanded in a around 0 58.8%
mul-1-neg58.8%
unsub-neg58.8%
associate-/l*70.6%
Simplified70.6%
Taylor expanded in t around inf 31.5%
Taylor expanded in y around 0 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 2024010
(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))))