
(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.0%
Simplified98.0%
Final simplification98.0%
(FPCore (x y z t a)
:precision binary64
(if (<= z -8.2e+17)
(+ x t)
(if (<= z -1.4e-111)
(+ x (/ (* y t) a))
(if (<= z -1.12e-148)
(- x (* t (/ y z)))
(if (<= z 350.0) (+ x (/ t (/ a y))) (+ x t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.2e+17) {
tmp = x + t;
} else if (z <= -1.4e-111) {
tmp = x + ((y * t) / a);
} else if (z <= -1.12e-148) {
tmp = x - (t * (y / z));
} else if (z <= 350.0) {
tmp = x + (t / (a / y));
} 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 <= (-8.2d+17)) then
tmp = x + t
else if (z <= (-1.4d-111)) then
tmp = x + ((y * t) / a)
else if (z <= (-1.12d-148)) then
tmp = x - (t * (y / z))
else if (z <= 350.0d0) then
tmp = x + (t / (a / y))
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 <= -8.2e+17) {
tmp = x + t;
} else if (z <= -1.4e-111) {
tmp = x + ((y * t) / a);
} else if (z <= -1.12e-148) {
tmp = x - (t * (y / z));
} else if (z <= 350.0) {
tmp = x + (t / (a / y));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8.2e+17: tmp = x + t elif z <= -1.4e-111: tmp = x + ((y * t) / a) elif z <= -1.12e-148: tmp = x - (t * (y / z)) elif z <= 350.0: tmp = x + (t / (a / y)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.2e+17) tmp = Float64(x + t); elseif (z <= -1.4e-111) tmp = Float64(x + Float64(Float64(y * t) / a)); elseif (z <= -1.12e-148) tmp = Float64(x - Float64(t * Float64(y / z))); elseif (z <= 350.0) tmp = Float64(x + Float64(t / Float64(a / y))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -8.2e+17) tmp = x + t; elseif (z <= -1.4e-111) tmp = x + ((y * t) / a); elseif (z <= -1.12e-148) tmp = x - (t * (y / z)); elseif (z <= 350.0) tmp = x + (t / (a / y)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.2e+17], N[(x + t), $MachinePrecision], If[LessEqual[z, -1.4e-111], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.12e-148], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 350.0], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{+17}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq -1.4 \cdot 10^{-111}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\mathbf{elif}\;z \leq -1.12 \cdot 10^{-148}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 350:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -8.2e17 or 350 < z Initial program 74.6%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 82.3%
if -8.2e17 < z < -1.39999999999999998e-111Initial program 99.9%
associate-*l/96.4%
Simplified96.4%
Taylor expanded in z around 0 71.5%
if -1.39999999999999998e-111 < z < -1.1199999999999999e-148Initial program 89.7%
associate-*l/99.5%
Simplified99.5%
Taylor expanded in y around inf 99.5%
Taylor expanded in a around 0 81.9%
associate-*r/81.9%
neg-mul-181.9%
Simplified81.9%
if -1.1199999999999999e-148 < z < 350Initial program 97.1%
associate-*l/95.9%
Simplified95.9%
Taylor expanded in z around 0 85.0%
associate-/l*85.8%
Simplified85.8%
Final simplification82.5%
(FPCore (x y z t a)
:precision binary64
(if (<= z -8.6e+16)
(+ x t)
(if (<= z -1.2e-88)
(+ x (/ (* y t) a))
(if (<= z -1.12e-148)
(- x (/ (* y t) z))
(if (<= z 205.0) (+ x (/ t (/ a y))) (+ x t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.6e+16) {
tmp = x + t;
} else if (z <= -1.2e-88) {
tmp = x + ((y * t) / a);
} else if (z <= -1.12e-148) {
tmp = x - ((y * t) / z);
} else if (z <= 205.0) {
tmp = x + (t / (a / y));
} 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 <= (-8.6d+16)) then
tmp = x + t
else if (z <= (-1.2d-88)) then
tmp = x + ((y * t) / a)
else if (z <= (-1.12d-148)) then
tmp = x - ((y * t) / z)
else if (z <= 205.0d0) then
tmp = x + (t / (a / y))
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 <= -8.6e+16) {
tmp = x + t;
} else if (z <= -1.2e-88) {
tmp = x + ((y * t) / a);
} else if (z <= -1.12e-148) {
tmp = x - ((y * t) / z);
} else if (z <= 205.0) {
tmp = x + (t / (a / y));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8.6e+16: tmp = x + t elif z <= -1.2e-88: tmp = x + ((y * t) / a) elif z <= -1.12e-148: tmp = x - ((y * t) / z) elif z <= 205.0: tmp = x + (t / (a / y)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.6e+16) tmp = Float64(x + t); elseif (z <= -1.2e-88) tmp = Float64(x + Float64(Float64(y * t) / a)); elseif (z <= -1.12e-148) tmp = Float64(x - Float64(Float64(y * t) / z)); elseif (z <= 205.0) tmp = Float64(x + Float64(t / Float64(a / y))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -8.6e+16) tmp = x + t; elseif (z <= -1.2e-88) tmp = x + ((y * t) / a); elseif (z <= -1.12e-148) tmp = x - ((y * t) / z); elseif (z <= 205.0) tmp = x + (t / (a / y)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.6e+16], N[(x + t), $MachinePrecision], If[LessEqual[z, -1.2e-88], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.12e-148], N[(x - N[(N[(y * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 205.0], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.6 \cdot 10^{+16}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq -1.2 \cdot 10^{-88}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\mathbf{elif}\;z \leq -1.12 \cdot 10^{-148}:\\
\;\;\;\;x - \frac{y \cdot t}{z}\\
\mathbf{elif}\;z \leq 205:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -8.6e16 or 205 < z Initial program 74.6%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 82.3%
if -8.6e16 < z < -1.2e-88Initial program 100.0%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around 0 78.2%
if -1.2e-88 < z < -1.1199999999999999e-148Initial program 93.0%
associate-*l/93.4%
Simplified93.4%
Taylor expanded in y around inf 87.2%
Taylor expanded in a around 0 74.7%
associate-*r/74.7%
mul-1-neg74.7%
distribute-rgt-neg-out74.7%
Simplified74.7%
if -1.1199999999999999e-148 < z < 205Initial program 97.1%
associate-*l/95.9%
Simplified95.9%
Taylor expanded in z around 0 85.0%
associate-/l*85.8%
Simplified85.8%
Final simplification82.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9.6e+169) (not (<= z 1.8e+139))) (+ x t) (+ x (* t (/ y (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9.6e+169) || !(z <= 1.8e+139)) {
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 <= (-9.6d+169)) .or. (.not. (z <= 1.8d+139))) 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 <= -9.6e+169) || !(z <= 1.8e+139)) {
tmp = x + t;
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9.6e+169) or not (z <= 1.8e+139): tmp = x + t else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9.6e+169) || !(z <= 1.8e+139)) 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 <= -9.6e+169) || ~((z <= 1.8e+139))) 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, -9.6e+169], N[Not[LessEqual[z, 1.8e+139]], $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 -9.6 \cdot 10^{+169} \lor \neg \left(z \leq 1.8 \cdot 10^{+139}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if z < -9.5999999999999994e169 or 1.79999999999999993e139 < z Initial program 65.2%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 93.4%
if -9.5999999999999994e169 < z < 1.79999999999999993e139Initial program 93.6%
associate-*l/97.4%
Simplified97.4%
Taylor expanded in y around inf 84.3%
Final simplification86.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.26e+41) (not (<= z 9.2e+28))) (+ x (- t (* t (/ y z)))) (+ x (* t (/ y (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.26e+41) || !(z <= 9.2e+28)) {
tmp = x + (t - (t * (y / z)));
} 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.26d+41)) .or. (.not. (z <= 9.2d+28))) then
tmp = x + (t - (t * (y / z)))
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.26e+41) || !(z <= 9.2e+28)) {
tmp = x + (t - (t * (y / z)));
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.26e+41) or not (z <= 9.2e+28): tmp = x + (t - (t * (y / z))) else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.26e+41) || !(z <= 9.2e+28)) tmp = Float64(x + Float64(t - Float64(t * Float64(y / z)))); 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.26e+41) || ~((z <= 9.2e+28))) tmp = x + (t - (t * (y / z))); else tmp = x + (t * (y / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.26e+41], N[Not[LessEqual[z, 9.2e+28]], $MachinePrecision]], N[(x + N[(t - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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.26 \cdot 10^{+41} \lor \neg \left(z \leq 9.2 \cdot 10^{+28}\right):\\
\;\;\;\;x + \left(t - t \cdot \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if z < -1.26000000000000001e41 or 9.19999999999999935e28 < z Initial program 73.6%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in a around 0 65.2%
mul-1-neg65.2%
associate-/l*88.3%
distribute-neg-frac88.3%
Simplified88.3%
Taylor expanded in z around 0 82.3%
mul-1-neg82.3%
associate-*r/88.3%
unsub-neg88.3%
Simplified88.3%
if -1.26000000000000001e41 < z < 9.19999999999999935e28Initial program 96.6%
associate-*l/96.5%
Simplified96.5%
Taylor expanded in y around inf 89.0%
Final simplification88.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.9e+30) (not (<= z 760.0))) (+ x (- t (* t (/ y z)))) (+ x (/ (* y t) (- a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.9e+30) || !(z <= 760.0)) {
tmp = x + (t - (t * (y / z)));
} 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.9d+30)) .or. (.not. (z <= 760.0d0))) then
tmp = x + (t - (t * (y / z)))
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.9e+30) || !(z <= 760.0)) {
tmp = x + (t - (t * (y / z)));
} else {
tmp = x + ((y * t) / (a - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.9e+30) or not (z <= 760.0): tmp = x + (t - (t * (y / z))) else: tmp = x + ((y * t) / (a - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.9e+30) || !(z <= 760.0)) tmp = Float64(x + Float64(t - Float64(t * Float64(y / z)))); 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.9e+30) || ~((z <= 760.0))) tmp = x + (t - (t * (y / z))); else tmp = x + ((y * t) / (a - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.9e+30], N[Not[LessEqual[z, 760.0]], $MachinePrecision]], N[(x + N[(t - N[(t * N[(y / z), $MachinePrecision]), $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.9 \cdot 10^{+30} \lor \neg \left(z \leq 760\right):\\
\;\;\;\;x + \left(t - t \cdot \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a - z}\\
\end{array}
\end{array}
if z < -3.90000000000000011e30 or 760 < z Initial program 73.9%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in a around 0 65.8%
mul-1-neg65.8%
associate-/l*87.9%
distribute-neg-frac87.9%
Simplified87.9%
Taylor expanded in z around 0 82.2%
mul-1-neg82.2%
associate-*r/88.0%
unsub-neg88.0%
Simplified88.0%
if -3.90000000000000011e30 < z < 760Initial program 97.2%
associate-*l/96.4%
Simplified96.4%
Taylor expanded in y around inf 90.1%
Final simplification89.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -51000000000000.0) (not (<= z 630.0))) (+ x t) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -51000000000000.0) || !(z <= 630.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 <= (-51000000000000.0d0)) .or. (.not. (z <= 630.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 <= -51000000000000.0) || !(z <= 630.0)) {
tmp = x + t;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -51000000000000.0) or not (z <= 630.0): tmp = x + t else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -51000000000000.0) || !(z <= 630.0)) tmp = Float64(x + t); 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 <= -51000000000000.0) || ~((z <= 630.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, -51000000000000.0], N[Not[LessEqual[z, 630.0]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -51000000000000 \lor \neg \left(z \leq 630\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -5.1e13 or 630 < z Initial program 74.8%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 82.4%
if -5.1e13 < z < 630Initial program 97.1%
associate-*l/96.3%
Simplified96.3%
Taylor expanded in z around 0 77.9%
associate-/l*78.5%
Simplified78.5%
associate-/r/76.6%
Applied egg-rr76.6%
Final simplification79.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9.2e+15) (not (<= z 165.0))) (+ x t) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9.2e+15) || !(z <= 165.0)) {
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 <= (-9.2d+15)) .or. (.not. (z <= 165.0d0))) 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 <= -9.2e+15) || !(z <= 165.0)) {
tmp = x + t;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9.2e+15) or not (z <= 165.0): tmp = x + t else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9.2e+15) || !(z <= 165.0)) 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 <= -9.2e+15) || ~((z <= 165.0))) tmp = x + t; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9.2e+15], N[Not[LessEqual[z, 165.0]], $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 -9.2 \cdot 10^{+15} \lor \neg \left(z \leq 165\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -9.2e15 or 165 < z Initial program 74.8%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 82.4%
if -9.2e15 < z < 165Initial program 97.1%
associate-*l/96.3%
Simplified96.3%
Taylor expanded in z around 0 77.8%
Final simplification80.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.3e+15) (not (<= z 280.0))) (+ x t) (+ x (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.3e+15) || !(z <= 280.0)) {
tmp = x + t;
} 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 <= (-5.3d+15)) .or. (.not. (z <= 280.0d0))) then
tmp = x + t
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 <= -5.3e+15) || !(z <= 280.0)) {
tmp = x + t;
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.3e+15) or not (z <= 280.0): tmp = x + t else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.3e+15) || !(z <= 280.0)) tmp = Float64(x + t); 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 <= -5.3e+15) || ~((z <= 280.0))) tmp = x + t; else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.3e+15], N[Not[LessEqual[z, 280.0]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.3 \cdot 10^{+15} \lor \neg \left(z \leq 280\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -5.3e15 or 280 < z Initial program 74.8%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 82.4%
if -5.3e15 < z < 280Initial program 97.1%
associate-*l/96.3%
Simplified96.3%
Taylor expanded in z around 0 77.9%
associate-/l*78.5%
Simplified78.5%
Final simplification80.4%
(FPCore (x y z t a) :precision binary64 (if (<= a 5.6e+141) (+ x t) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 5.6e+141) {
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 <= 5.6d+141) 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 <= 5.6e+141) {
tmp = x + t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 5.6e+141: tmp = x + t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 5.6e+141) 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 <= 5.6e+141) tmp = x + t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 5.6e+141], N[(x + t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 5.6 \cdot 10^{+141}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < 5.59999999999999982e141Initial program 86.1%
associate-*l/97.8%
Simplified97.8%
Taylor expanded in z around inf 65.7%
if 5.59999999999999982e141 < a Initial program 87.9%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around 0 75.8%
associate-/l*84.9%
Simplified84.9%
Taylor expanded in x around inf 75.7%
Final simplification67.0%
(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 86.4%
associate-*l/98.0%
Simplified98.0%
Taylor expanded in z around 0 60.0%
associate-/l*59.9%
Simplified59.9%
Taylor expanded in x around inf 52.9%
Final simplification52.9%
(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 2023334
(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))))