
(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 12 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
(let* ((t_1 (/ (* (- y z) t) (- a z))))
(if (or (<= t_1 -2e+95) (not (<= t_1 2e+305)))
(+ x (/ (- y z) (/ (- a z) t)))
(+ x t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((y - z) * t) / (a - z);
double tmp;
if ((t_1 <= -2e+95) || !(t_1 <= 2e+305)) {
tmp = x + ((y - z) / ((a - z) / t));
} else {
tmp = x + 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 = ((y - z) * t) / (a - z)
if ((t_1 <= (-2d+95)) .or. (.not. (t_1 <= 2d+305))) then
tmp = x + ((y - z) / ((a - z) / t))
else
tmp = x + 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 = ((y - z) * t) / (a - z);
double tmp;
if ((t_1 <= -2e+95) || !(t_1 <= 2e+305)) {
tmp = x + ((y - z) / ((a - z) / t));
} else {
tmp = x + t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((y - z) * t) / (a - z) tmp = 0 if (t_1 <= -2e+95) or not (t_1 <= 2e+305): tmp = x + ((y - z) / ((a - z) / t)) else: tmp = x + t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(y - z) * t) / Float64(a - z)) tmp = 0.0 if ((t_1 <= -2e+95) || !(t_1 <= 2e+305)) tmp = Float64(x + Float64(Float64(y - z) / Float64(Float64(a - z) / t))); else tmp = Float64(x + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((y - z) * t) / (a - z); tmp = 0.0; if ((t_1 <= -2e+95) || ~((t_1 <= 2e+305))) tmp = x + ((y - z) / ((a - z) / t)); else tmp = x + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+95], N[Not[LessEqual[t$95$1, 2e+305]], $MachinePrecision]], N[(x + N[(N[(y - z), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+95} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+305}\right):\\
\;\;\;\;x + \frac{y - z}{\frac{a - z}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -2.00000000000000004e95 or 1.9999999999999999e305 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 48.6%
associate-/l*99.8%
Simplified99.8%
if -2.00000000000000004e95 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 1.9999999999999999e305Initial program 99.3%
Final simplification99.5%
(FPCore (x y z t a) :precision binary64 (fma (/ (- y z) (- a z)) t x))
double code(double x, double y, double z, double t, double a) {
return fma(((y - z) / (a - z)), t, x);
}
function code(x, y, z, t, a) return fma(Float64(Float64(y - z) / Float64(a - z)), t, x) end
code[x_, y_, z_, t_, a_] := N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{y - z}{a - z}, t, x\right)
\end{array}
Initial program 84.5%
+-commutative84.5%
associate-*l/98.1%
fma-define98.1%
Simplified98.1%
Final simplification98.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.95e+135)
(- x (/ t (/ z (- y z))))
(if (<= z 8.2e+48)
(+ x (/ (* (- y z) t) (- a z)))
(- x (/ t (+ (/ a z) -1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.95e+135) {
tmp = x - (t / (z / (y - z)));
} else if (z <= 8.2e+48) {
tmp = x + (((y - z) * t) / (a - z));
} else {
tmp = x - (t / ((a / z) + -1.0));
}
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.95d+135)) then
tmp = x - (t / (z / (y - z)))
else if (z <= 8.2d+48) then
tmp = x + (((y - z) * t) / (a - z))
else
tmp = x - (t / ((a / z) + (-1.0d0)))
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.95e+135) {
tmp = x - (t / (z / (y - z)));
} else if (z <= 8.2e+48) {
tmp = x + (((y - z) * t) / (a - z));
} else {
tmp = x - (t / ((a / z) + -1.0));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.95e+135: tmp = x - (t / (z / (y - z))) elif z <= 8.2e+48: tmp = x + (((y - z) * t) / (a - z)) else: tmp = x - (t / ((a / z) + -1.0)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.95e+135) tmp = Float64(x - Float64(t / Float64(z / Float64(y - z)))); elseif (z <= 8.2e+48) tmp = Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))); else tmp = Float64(x - Float64(t / Float64(Float64(a / z) + -1.0))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.95e+135) tmp = x - (t / (z / (y - z))); elseif (z <= 8.2e+48) tmp = x + (((y - z) * t) / (a - z)); else tmp = x - (t / ((a / z) + -1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.95e+135], N[(x - N[(t / N[(z / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.2e+48], N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t / N[(N[(a / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{+135}:\\
\;\;\;\;x - \frac{t}{\frac{z}{y - z}}\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{+48}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{t}{\frac{a}{z} + -1}\\
\end{array}
\end{array}
if z < -1.95000000000000016e135Initial program 49.3%
Taylor expanded in a around 0 43.9%
mul-1-neg43.9%
unsub-neg43.9%
associate-/l*94.5%
Simplified94.5%
if -1.95000000000000016e135 < z < 8.2000000000000005e48Initial program 95.2%
if 8.2000000000000005e48 < z Initial program 73.5%
Taylor expanded in y around 0 72.1%
mul-1-neg72.1%
*-commutative72.1%
associate-*r/88.7%
unsub-neg88.7%
associate-*r/72.1%
*-commutative72.1%
associate-/l*94.4%
div-sub94.4%
*-inverses94.4%
Simplified94.4%
Final simplification94.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.6e+136) (not (<= z 6.2e+152))) (+ t x) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.6e+136) || !(z <= 6.2e+152)) {
tmp = t + x;
} else {
tmp = x + (y * (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 <= (-7.6d+136)) .or. (.not. (z <= 6.2d+152))) then
tmp = t + x
else
tmp = x + (y * (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 <= -7.6e+136) || !(z <= 6.2e+152)) {
tmp = t + x;
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.6e+136) or not (z <= 6.2e+152): tmp = t + x else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.6e+136) || !(z <= 6.2e+152)) tmp = Float64(t + x); else tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -7.6e+136) || ~((z <= 6.2e+152))) tmp = t + x; else tmp = x + (y * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.6e+136], N[Not[LessEqual[z, 6.2e+152]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.6 \cdot 10^{+136} \lor \neg \left(z \leq 6.2 \cdot 10^{+152}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -7.60000000000000029e136 or 6.2e152 < z Initial program 57.4%
Taylor expanded in z around inf 87.1%
if -7.60000000000000029e136 < z < 6.2e152Initial program 93.5%
Taylor expanded in y around inf 85.6%
*-commutative85.6%
associate-*r/86.9%
Simplified86.9%
Final simplification87.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.3e+35) (not (<= z 1.4e+46))) (- x (/ t (+ (/ a z) -1.0))) (+ x (/ (* y t) (- a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.3e+35) || !(z <= 1.4e+46)) {
tmp = x - (t / ((a / z) + -1.0));
} else {
tmp = x + ((y * 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 <= (-3.3d+35)) .or. (.not. (z <= 1.4d+46))) then
tmp = x - (t / ((a / z) + (-1.0d0)))
else
tmp = x + ((y * 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 <= -3.3e+35) || !(z <= 1.4e+46)) {
tmp = x - (t / ((a / z) + -1.0));
} else {
tmp = x + ((y * t) / (a - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.3e+35) or not (z <= 1.4e+46): tmp = x - (t / ((a / z) + -1.0)) else: tmp = x + ((y * t) / (a - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.3e+35) || !(z <= 1.4e+46)) tmp = Float64(x - Float64(t / Float64(Float64(a / z) + -1.0))); else tmp = Float64(x + Float64(Float64(y * t) / Float64(a - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.3e+35) || ~((z <= 1.4e+46))) tmp = x - (t / ((a / z) + -1.0)); else tmp = x + ((y * t) / (a - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.3e+35], N[Not[LessEqual[z, 1.4e+46]], $MachinePrecision]], N[(x - N[(t / N[(N[(a / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+35} \lor \neg \left(z \leq 1.4 \cdot 10^{+46}\right):\\
\;\;\;\;x - \frac{t}{\frac{a}{z} + -1}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a - z}\\
\end{array}
\end{array}
if z < -3.3000000000000002e35 or 1.40000000000000009e46 < z Initial program 68.8%
Taylor expanded in y around 0 66.1%
mul-1-neg66.1%
*-commutative66.1%
associate-*r/84.9%
unsub-neg84.9%
associate-*r/66.1%
*-commutative66.1%
associate-/l*90.7%
div-sub90.7%
*-inverses90.7%
Simplified90.7%
if -3.3000000000000002e35 < z < 1.40000000000000009e46Initial program 96.5%
Taylor expanded in y around inf 90.5%
Final simplification90.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.3e+37) (- x (/ t (/ z (- y z)))) (if (<= z 3.5e+47) (+ x (/ (* y t) (- a z))) (- x (/ t (+ (/ a z) -1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.3e+37) {
tmp = x - (t / (z / (y - z)));
} else if (z <= 3.5e+47) {
tmp = x + ((y * t) / (a - z));
} else {
tmp = x - (t / ((a / z) + -1.0));
}
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.3d+37)) then
tmp = x - (t / (z / (y - z)))
else if (z <= 3.5d+47) then
tmp = x + ((y * t) / (a - z))
else
tmp = x - (t / ((a / z) + (-1.0d0)))
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.3e+37) {
tmp = x - (t / (z / (y - z)));
} else if (z <= 3.5e+47) {
tmp = x + ((y * t) / (a - z));
} else {
tmp = x - (t / ((a / z) + -1.0));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.3e+37: tmp = x - (t / (z / (y - z))) elif z <= 3.5e+47: tmp = x + ((y * t) / (a - z)) else: tmp = x - (t / ((a / z) + -1.0)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.3e+37) tmp = Float64(x - Float64(t / Float64(z / Float64(y - z)))); elseif (z <= 3.5e+47) tmp = Float64(x + Float64(Float64(y * t) / Float64(a - z))); else tmp = Float64(x - Float64(t / Float64(Float64(a / z) + -1.0))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.3e+37) tmp = x - (t / (z / (y - z))); elseif (z <= 3.5e+47) tmp = x + ((y * t) / (a - z)); else tmp = x - (t / ((a / z) + -1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.3e+37], N[(x - N[(t / N[(z / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.5e+47], N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t / N[(N[(a / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{+37}:\\
\;\;\;\;x - \frac{t}{\frac{z}{y - z}}\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+47}:\\
\;\;\;\;x + \frac{y \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{t}{\frac{a}{z} + -1}\\
\end{array}
\end{array}
if z < -2.30000000000000002e37Initial program 62.6%
Taylor expanded in a around 0 52.9%
mul-1-neg52.9%
unsub-neg52.9%
associate-/l*88.3%
Simplified88.3%
if -2.30000000000000002e37 < z < 3.50000000000000015e47Initial program 96.5%
Taylor expanded in y around inf 90.5%
if 3.50000000000000015e47 < z Initial program 73.5%
Taylor expanded in y around 0 72.1%
mul-1-neg72.1%
*-commutative72.1%
associate-*r/88.7%
unsub-neg88.7%
associate-*r/72.1%
*-commutative72.1%
associate-/l*94.4%
div-sub94.4%
*-inverses94.4%
Simplified94.4%
Final simplification91.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.2e+85) (not (<= t 6.5e+77))) (* t (- 1.0 (/ y z))) (+ t x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.2e+85) || !(t <= 6.5e+77)) {
tmp = t * (1.0 - (y / z));
} else {
tmp = t + x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-1.2d+85)) .or. (.not. (t <= 6.5d+77))) then
tmp = t * (1.0d0 - (y / z))
else
tmp = t + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.2e+85) || !(t <= 6.5e+77)) {
tmp = t * (1.0 - (y / z));
} else {
tmp = t + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.2e+85) or not (t <= 6.5e+77): tmp = t * (1.0 - (y / z)) else: tmp = t + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.2e+85) || !(t <= 6.5e+77)) tmp = Float64(t * Float64(1.0 - Float64(y / z))); else tmp = Float64(t + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.2e+85) || ~((t <= 6.5e+77))) tmp = t * (1.0 - (y / z)); else tmp = t + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.2e+85], N[Not[LessEqual[t, 6.5e+77]], $MachinePrecision]], N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{+85} \lor \neg \left(t \leq 6.5 \cdot 10^{+77}\right):\\
\;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;t + x\\
\end{array}
\end{array}
if t < -1.19999999999999998e85 or 6.5e77 < t Initial program 63.1%
Taylor expanded in a around 0 32.0%
mul-1-neg32.0%
unsub-neg32.0%
associate-/l*61.5%
Simplified61.5%
Taylor expanded in t around inf 52.0%
if -1.19999999999999998e85 < t < 6.5e77Initial program 97.5%
Taylor expanded in z around inf 74.1%
Final simplification65.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3e+16) (not (<= z 6.8e+53))) (+ t x) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3e+16) || !(z <= 6.8e+53)) {
tmp = t + x;
} 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 <= (-3d+16)) .or. (.not. (z <= 6.8d+53))) then
tmp = t + x
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 <= -3e+16) || !(z <= 6.8e+53)) {
tmp = t + x;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3e+16) or not (z <= 6.8e+53): tmp = t + x else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3e+16) || !(z <= 6.8e+53)) tmp = Float64(t + x); 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 <= -3e+16) || ~((z <= 6.8e+53))) tmp = t + x; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3e+16], N[Not[LessEqual[z, 6.8e+53]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{+16} \lor \neg \left(z \leq 6.8 \cdot 10^{+53}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -3e16 or 6.79999999999999995e53 < z Initial program 69.9%
Taylor expanded in z around inf 79.8%
if -3e16 < z < 6.79999999999999995e53Initial program 96.4%
Taylor expanded in z around 0 74.9%
associate-/l*76.3%
associate-/r/74.8%
Applied egg-rr74.8%
Final simplification77.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.42e+16) (not (<= z 1.35e+52))) (+ t x) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.42e+16) || !(z <= 1.35e+52)) {
tmp = t + x;
} 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 <= (-1.42d+16)) .or. (.not. (z <= 1.35d+52))) then
tmp = t + x
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 <= -1.42e+16) || !(z <= 1.35e+52)) {
tmp = t + x;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.42e+16) or not (z <= 1.35e+52): tmp = t + x else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.42e+16) || !(z <= 1.35e+52)) tmp = Float64(t + x); 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 <= -1.42e+16) || ~((z <= 1.35e+52))) tmp = t + x; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.42e+16], N[Not[LessEqual[z, 1.35e+52]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.42 \cdot 10^{+16} \lor \neg \left(z \leq 1.35 \cdot 10^{+52}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -1.42e16 or 1.35e52 < z Initial program 69.9%
Taylor expanded in z around inf 79.8%
if -1.42e16 < z < 1.35e52Initial program 96.4%
Taylor expanded in z around 0 74.9%
*-commutative74.9%
associate-/l*74.4%
associate-/r/75.7%
Applied egg-rr75.7%
Final simplification77.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -18000000000000.0) (not (<= z 8.4e+52))) (+ t x) (+ x (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -18000000000000.0) || !(z <= 8.4e+52)) {
tmp = t + x;
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-18000000000000.0d0)) .or. (.not. (z <= 8.4d+52))) then
tmp = t + x
else
tmp = x + (t / (a / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -18000000000000.0) || !(z <= 8.4e+52)) {
tmp = t + x;
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -18000000000000.0) or not (z <= 8.4e+52): tmp = t + x else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -18000000000000.0) || !(z <= 8.4e+52)) tmp = Float64(t + x); else tmp = Float64(x + Float64(t / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -18000000000000.0) || ~((z <= 8.4e+52))) tmp = t + x; else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -18000000000000.0], N[Not[LessEqual[z, 8.4e+52]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -18000000000000 \lor \neg \left(z \leq 8.4 \cdot 10^{+52}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -1.8e13 or 8.3999999999999999e52 < z Initial program 69.9%
Taylor expanded in z around inf 79.8%
if -1.8e13 < z < 8.3999999999999999e52Initial program 96.4%
Taylor expanded in z around 0 74.9%
+-commutative74.9%
associate-/l*76.3%
Simplified76.3%
Final simplification77.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9e-10) (not (<= z 5.2e+55))) (+ t x) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9e-10) || !(z <= 5.2e+55)) {
tmp = t + x;
} 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 <= (-9d-10)) .or. (.not. (z <= 5.2d+55))) then
tmp = t + x
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 <= -9e-10) || !(z <= 5.2e+55)) {
tmp = t + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9e-10) or not (z <= 5.2e+55): tmp = t + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9e-10) || !(z <= 5.2e+55)) tmp = Float64(t + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -9e-10) || ~((z <= 5.2e+55))) tmp = t + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9e-10], N[Not[LessEqual[z, 5.2e+55]], $MachinePrecision]], N[(t + x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{-10} \lor \neg \left(z \leq 5.2 \cdot 10^{+55}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -8.9999999999999999e-10 or 5.2e55 < z Initial program 70.4%
Taylor expanded in z around inf 79.3%
if -8.9999999999999999e-10 < z < 5.2e55Initial program 96.4%
Taylor expanded in x around inf 53.2%
Final simplification65.1%
(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 84.5%
Taylor expanded in x around inf 53.2%
Final simplification53.2%
(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 2024034
(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))))