
(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 (- INFINITY)) (not (<= t_1 2e+305)))
(+ x (* t (/ (- y z) (- a z))))
(+ 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 <= -((double) INFINITY)) || !(t_1 <= 2e+305)) {
tmp = x + (t * ((y - z) / (a - z)));
} else {
tmp = x + t_1;
}
return tmp;
}
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 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 2e+305)) {
tmp = x + (t * ((y - z) / (a - z)));
} 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 <= -math.inf) or not (t_1 <= 2e+305): tmp = x + (t * ((y - z) / (a - z))) 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 <= Float64(-Inf)) || !(t_1 <= 2e+305)) tmp = Float64(x + Float64(t * Float64(Float64(y - z) / Float64(a - z)))); 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 <= -Inf) || ~((t_1 <= 2e+305))) tmp = x + (t * ((y - z) / (a - z))); 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, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+305]], $MachinePrecision]], N[(x + N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $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 -\infty \lor \neg \left(t_1 \leq 2 \cdot 10^{+305}\right):\\
\;\;\;\;x + t \cdot \frac{y - z}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + t_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -inf.0 or 1.9999999999999999e305 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 31.1%
associate-*l/99.8%
Simplified99.8%
if -inf.0 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 1.9999999999999999e305Initial program 99.9%
Final simplification99.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -9.6e-129) (not (<= a 3e-33))) (+ x (* t (/ (- y z) a))) (+ x (- t (* y (/ t z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -9.6e-129) || !(a <= 3e-33)) {
tmp = x + (t * ((y - z) / a));
} else {
tmp = x + (t - (y * (t / z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-9.6d-129)) .or. (.not. (a <= 3d-33))) then
tmp = x + (t * ((y - z) / a))
else
tmp = x + (t - (y * (t / z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -9.6e-129) || !(a <= 3e-33)) {
tmp = x + (t * ((y - z) / a));
} else {
tmp = x + (t - (y * (t / z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -9.6e-129) or not (a <= 3e-33): tmp = x + (t * ((y - z) / a)) else: tmp = x + (t - (y * (t / z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -9.6e-129) || !(a <= 3e-33)) tmp = Float64(x + Float64(t * Float64(Float64(y - z) / a))); else tmp = Float64(x + Float64(t - Float64(y * Float64(t / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -9.6e-129) || ~((a <= 3e-33))) tmp = x + (t * ((y - z) / a)); else tmp = x + (t - (y * (t / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -9.6e-129], N[Not[LessEqual[a, 3e-33]], $MachinePrecision]], N[(x + N[(t * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.6 \cdot 10^{-129} \lor \neg \left(a \leq 3 \cdot 10^{-33}\right):\\
\;\;\;\;x + t \cdot \frac{y - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \left(t - y \cdot \frac{t}{z}\right)\\
\end{array}
\end{array}
if a < -9.59999999999999954e-129 or 3.0000000000000002e-33 < a Initial program 85.1%
associate-*l/98.1%
Simplified98.1%
Taylor expanded in a around inf 87.5%
if -9.59999999999999954e-129 < a < 3.0000000000000002e-33Initial program 87.3%
associate-*l/93.8%
Simplified93.8%
Taylor expanded in a around 0 85.2%
associate-*r/85.2%
neg-mul-185.2%
neg-sub085.2%
associate--r-85.2%
neg-sub085.2%
Simplified85.2%
Taylor expanded in y around 0 83.8%
mul-1-neg83.8%
unsub-neg83.8%
associate-/l*86.0%
associate-/r/83.8%
Simplified83.8%
Final simplification86.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.6e+89) (not (<= z 2.8e+125))) (+ x (/ t (- 1.0 (/ a z)))) (+ x (* t (/ y (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.6e+89) || !(z <= 2.8e+125)) {
tmp = x + (t / (1.0 - (a / 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 <= (-8.6d+89)) .or. (.not. (z <= 2.8d+125))) then
tmp = x + (t / (1.0d0 - (a / 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 <= -8.6e+89) || !(z <= 2.8e+125)) {
tmp = x + (t / (1.0 - (a / z)));
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.6e+89) or not (z <= 2.8e+125): tmp = x + (t / (1.0 - (a / z))) else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.6e+89) || !(z <= 2.8e+125)) tmp = Float64(x + Float64(t / Float64(1.0 - Float64(a / 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 <= -8.6e+89) || ~((z <= 2.8e+125))) tmp = x + (t / (1.0 - (a / z))); else tmp = x + (t * (y / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.6e+89], N[Not[LessEqual[z, 2.8e+125]], $MachinePrecision]], N[(x + N[(t / N[(1.0 - N[(a / 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 -8.6 \cdot 10^{+89} \lor \neg \left(z \leq 2.8 \cdot 10^{+125}\right):\\
\;\;\;\;x + \frac{t}{1 - \frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if z < -8.6000000000000003e89 or 2.8000000000000001e125 < z Initial program 67.1%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in y around 0 63.1%
mul-1-neg63.1%
associate-/l*93.8%
distribute-neg-frac93.8%
Simplified93.8%
frac-2neg93.8%
div-inv93.8%
remove-double-neg93.8%
div-sub93.8%
*-inverses93.8%
sub-neg93.8%
metadata-eval93.8%
Applied egg-rr93.8%
associate-*r/93.8%
*-rgt-identity93.8%
neg-sub093.8%
+-commutative93.8%
associate--r+93.8%
metadata-eval93.8%
Simplified93.8%
if -8.6000000000000003e89 < z < 2.8000000000000001e125Initial program 93.3%
associate-*l/95.3%
Simplified95.3%
Taylor expanded in y around inf 85.6%
Final simplification87.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.9e+90) (not (<= z 9.5e+124))) (+ x (/ t (- 1.0 (/ a z)))) (+ x (/ t (/ (- a z) y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.9e+90) || !(z <= 9.5e+124)) {
tmp = x + (t / (1.0 - (a / z)));
} else {
tmp = x + (t / ((a - z) / 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 <= (-3.9d+90)) .or. (.not. (z <= 9.5d+124))) then
tmp = x + (t / (1.0d0 - (a / z)))
else
tmp = x + (t / ((a - z) / 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 <= -3.9e+90) || !(z <= 9.5e+124)) {
tmp = x + (t / (1.0 - (a / z)));
} else {
tmp = x + (t / ((a - z) / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.9e+90) or not (z <= 9.5e+124): tmp = x + (t / (1.0 - (a / z))) else: tmp = x + (t / ((a - z) / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.9e+90) || !(z <= 9.5e+124)) tmp = Float64(x + Float64(t / Float64(1.0 - Float64(a / z)))); else tmp = Float64(x + Float64(t / Float64(Float64(a - z) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.9e+90) || ~((z <= 9.5e+124))) tmp = x + (t / (1.0 - (a / z))); else tmp = x + (t / ((a - z) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.9e+90], N[Not[LessEqual[z, 9.5e+124]], $MachinePrecision]], N[(x + N[(t / N[(1.0 - N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t / N[(N[(a - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.9 \cdot 10^{+90} \lor \neg \left(z \leq 9.5 \cdot 10^{+124}\right):\\
\;\;\;\;x + \frac{t}{1 - \frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a - z}{y}}\\
\end{array}
\end{array}
if z < -3.9000000000000002e90 or 9.50000000000000004e124 < z Initial program 67.1%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in y around 0 63.1%
mul-1-neg63.1%
associate-/l*93.8%
distribute-neg-frac93.8%
Simplified93.8%
frac-2neg93.8%
div-inv93.8%
remove-double-neg93.8%
div-sub93.8%
*-inverses93.8%
sub-neg93.8%
metadata-eval93.8%
Applied egg-rr93.8%
associate-*r/93.8%
*-rgt-identity93.8%
neg-sub093.8%
+-commutative93.8%
associate--r+93.8%
metadata-eval93.8%
Simplified93.8%
if -3.9000000000000002e90 < z < 9.50000000000000004e124Initial program 93.3%
associate-*l/95.3%
Simplified95.3%
Taylor expanded in y around inf 84.0%
associate-/l*86.5%
Simplified86.5%
Final simplification88.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.6e+97) (+ x t) (if (<= z 1.26e+163) (+ x (* t (/ y (- a z)))) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.6e+97) {
tmp = x + t;
} else if (z <= 1.26e+163) {
tmp = x + (t * (y / (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 <= (-1.6d+97)) then
tmp = x + t
else if (z <= 1.26d+163) then
tmp = x + (t * (y / (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 <= -1.6e+97) {
tmp = x + t;
} else if (z <= 1.26e+163) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.6e+97: tmp = x + t elif z <= 1.26e+163: tmp = x + (t * (y / (a - z))) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.6e+97) tmp = Float64(x + t); elseif (z <= 1.26e+163) tmp = Float64(x + Float64(t * Float64(y / 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 <= -1.6e+97) tmp = x + t; elseif (z <= 1.26e+163) tmp = x + (t * (y / (a - z))); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.6e+97], N[(x + t), $MachinePrecision], If[LessEqual[z, 1.26e+163], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+97}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 1.26 \cdot 10^{+163}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -1.60000000000000008e97 or 1.26e163 < z Initial program 67.5%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in z around inf 84.8%
if -1.60000000000000008e97 < z < 1.26e163Initial program 92.0%
associate-*l/95.5%
Simplified95.5%
Taylor expanded in y around inf 85.0%
Final simplification85.0%
(FPCore (x y z t a) :precision binary64 (if (<= y -1e+119) (+ x (/ (- y z) (/ (- a z) t))) (+ x (* t (/ (- y z) (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1e+119) {
tmp = x + ((y - z) / ((a - z) / t));
} else {
tmp = x + (t * ((y - z) / (a - z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-1d+119)) then
tmp = x + ((y - z) / ((a - z) / t))
else
tmp = x + (t * ((y - z) / (a - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1e+119) {
tmp = x + ((y - z) / ((a - z) / t));
} else {
tmp = x + (t * ((y - z) / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1e+119: tmp = x + ((y - z) / ((a - z) / t)) else: tmp = x + (t * ((y - z) / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1e+119) tmp = Float64(x + Float64(Float64(y - z) / Float64(Float64(a - z) / t))); else tmp = Float64(x + Float64(t * Float64(Float64(y - z) / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1e+119) tmp = x + ((y - z) / ((a - z) / t)); else tmp = x + (t * ((y - z) / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1e+119], N[(x + N[(N[(y - z), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{+119}:\\
\;\;\;\;x + \frac{y - z}{\frac{a - z}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y - z}{a - z}\\
\end{array}
\end{array}
if y < -9.99999999999999944e118Initial program 73.4%
associate-*l/89.2%
Simplified89.2%
associate-/r/99.9%
Applied egg-rr99.9%
if -9.99999999999999944e118 < y Initial program 88.4%
associate-*l/98.1%
Simplified98.1%
Final simplification98.4%
(FPCore (x y z t a)
:precision binary64
(if (<= a -4.1e+47)
x
(if (<= a 5.2e-233)
(+ x t)
(if (<= a 2.4e-220) (* t (/ (- y) z)) (if (<= a 5e+101) (+ x t) x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.1e+47) {
tmp = x;
} else if (a <= 5.2e-233) {
tmp = x + t;
} else if (a <= 2.4e-220) {
tmp = t * (-y / z);
} else if (a <= 5e+101) {
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 <= (-4.1d+47)) then
tmp = x
else if (a <= 5.2d-233) then
tmp = x + t
else if (a <= 2.4d-220) then
tmp = t * (-y / z)
else if (a <= 5d+101) 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 <= -4.1e+47) {
tmp = x;
} else if (a <= 5.2e-233) {
tmp = x + t;
} else if (a <= 2.4e-220) {
tmp = t * (-y / z);
} else if (a <= 5e+101) {
tmp = x + t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -4.1e+47: tmp = x elif a <= 5.2e-233: tmp = x + t elif a <= 2.4e-220: tmp = t * (-y / z) elif a <= 5e+101: tmp = x + t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4.1e+47) tmp = x; elseif (a <= 5.2e-233) tmp = Float64(x + t); elseif (a <= 2.4e-220) tmp = Float64(t * Float64(Float64(-y) / z)); elseif (a <= 5e+101) 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 <= -4.1e+47) tmp = x; elseif (a <= 5.2e-233) tmp = x + t; elseif (a <= 2.4e-220) tmp = t * (-y / z); elseif (a <= 5e+101) tmp = x + t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.1e+47], x, If[LessEqual[a, 5.2e-233], N[(x + t), $MachinePrecision], If[LessEqual[a, 2.4e-220], N[(t * N[((-y) / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5e+101], N[(x + t), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.1 \cdot 10^{+47}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 5.2 \cdot 10^{-233}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;a \leq 2.4 \cdot 10^{-220}:\\
\;\;\;\;t \cdot \frac{-y}{z}\\
\mathbf{elif}\;a \leq 5 \cdot 10^{+101}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -4.1000000000000001e47 or 4.99999999999999989e101 < a Initial program 84.2%
associate-*l/99.0%
Simplified99.0%
Taylor expanded in a around 0 42.2%
associate-*r/42.2%
neg-mul-142.2%
neg-sub042.2%
associate--r-42.2%
neg-sub042.2%
Simplified42.2%
Taylor expanded in y around inf 44.7%
associate-*r/44.7%
associate-*r*44.7%
neg-mul-144.7%
Simplified44.7%
Taylor expanded in x around inf 69.4%
if -4.1000000000000001e47 < a < 5.1999999999999996e-233 or 2.4000000000000001e-220 < a < 4.99999999999999989e101Initial program 86.6%
associate-*l/94.6%
Simplified94.6%
Taylor expanded in z around inf 63.7%
if 5.1999999999999996e-233 < a < 2.4000000000000001e-220Initial program 99.7%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in a around 0 100.0%
associate-*r/100.0%
neg-mul-1100.0%
neg-sub0100.0%
associate--r-100.0%
neg-sub0100.0%
Simplified100.0%
Taylor expanded in y around inf 99.7%
associate-*r/99.7%
associate-*r*99.7%
neg-mul-199.7%
Simplified99.7%
Taylor expanded in x around 0 99.7%
mul-1-neg99.7%
associate-*r/100.0%
distribute-lft-neg-in100.0%
cancel-sign-sub-inv100.0%
Simplified100.0%
Taylor expanded in x around 0 99.7%
mul-1-neg99.7%
associate-*r/100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Final simplification67.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.75e+90) (not (<= z 1.35e+124))) (+ x t) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.75e+90) || !(z <= 1.35e+124)) {
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 <= (-1.75d+90)) .or. (.not. (z <= 1.35d+124))) 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 <= -1.75e+90) || !(z <= 1.35e+124)) {
tmp = x + t;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.75e+90) or not (z <= 1.35e+124): tmp = x + t else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.75e+90) || !(z <= 1.35e+124)) 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 <= -1.75e+90) || ~((z <= 1.35e+124))) tmp = x + t; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.75e+90], N[Not[LessEqual[z, 1.35e+124]], $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 -1.75 \cdot 10^{+90} \lor \neg \left(z \leq 1.35 \cdot 10^{+124}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1.7499999999999999e90 or 1.34999999999999989e124 < z Initial program 67.1%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in z around inf 82.5%
if -1.7499999999999999e90 < z < 1.34999999999999989e124Initial program 93.3%
associate-*l/95.3%
Simplified95.3%
Taylor expanded in z around 0 73.3%
associate-/l*76.4%
associate-/r/77.4%
Applied egg-rr77.4%
Final simplification78.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.15e+90) (not (<= z 1.4e+124))) (+ x t) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.15e+90) || !(z <= 1.4e+124)) {
tmp = x + t;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.15d+90)) .or. (.not. (z <= 1.4d+124))) then
tmp = x + t
else
tmp = x + (y / (a / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.15e+90) || !(z <= 1.4e+124)) {
tmp = x + t;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.15e+90) or not (z <= 1.4e+124): tmp = x + t else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.15e+90) || !(z <= 1.4e+124)) tmp = Float64(x + t); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.15e+90) || ~((z <= 1.4e+124))) tmp = x + t; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.15e+90], N[Not[LessEqual[z, 1.4e+124]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{+90} \lor \neg \left(z \leq 1.4 \cdot 10^{+124}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -1.15e90 or 1.4e124 < z Initial program 67.1%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in z around inf 82.5%
if -1.15e90 < z < 1.4e124Initial program 93.3%
associate-*l/95.3%
Simplified95.3%
Taylor expanded in z around 0 73.3%
associate-/l*76.4%
associate-/r/77.4%
Applied egg-rr77.4%
*-commutative77.4%
clear-num77.3%
un-div-inv77.8%
Applied egg-rr77.8%
Final simplification79.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 85.9%
associate-*l/96.6%
Simplified96.6%
Final simplification96.6%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.6e+47) x (if (<= a 3.8e+102) (+ x t) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.6e+47) {
tmp = x;
} else if (a <= 3.8e+102) {
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 <= (-1.6d+47)) then
tmp = x
else if (a <= 3.8d+102) 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 <= -1.6e+47) {
tmp = x;
} else if (a <= 3.8e+102) {
tmp = x + t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.6e+47: tmp = x elif a <= 3.8e+102: tmp = x + t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.6e+47) tmp = x; elseif (a <= 3.8e+102) 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 <= -1.6e+47) tmp = x; elseif (a <= 3.8e+102) tmp = x + t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.6e+47], x, If[LessEqual[a, 3.8e+102], N[(x + t), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.6 \cdot 10^{+47}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 3.8 \cdot 10^{+102}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.6e47 or 3.79999999999999979e102 < a Initial program 84.2%
associate-*l/99.0%
Simplified99.0%
Taylor expanded in a around 0 42.2%
associate-*r/42.2%
neg-mul-142.2%
neg-sub042.2%
associate--r-42.2%
neg-sub042.2%
Simplified42.2%
Taylor expanded in y around inf 44.7%
associate-*r/44.7%
associate-*r*44.7%
neg-mul-144.7%
Simplified44.7%
Taylor expanded in x around inf 69.4%
if -1.6e47 < a < 3.79999999999999979e102Initial program 87.2%
associate-*l/94.9%
Simplified94.9%
Taylor expanded in z around inf 61.3%
Final simplification64.7%
(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 85.9%
associate-*l/96.6%
Simplified96.6%
Taylor expanded in a around 0 59.5%
associate-*r/59.5%
neg-mul-159.5%
neg-sub059.5%
associate--r-59.5%
neg-sub059.5%
Simplified59.5%
Taylor expanded in y around inf 50.3%
associate-*r/50.3%
associate-*r*50.3%
neg-mul-150.3%
Simplified50.3%
Taylor expanded in x around inf 53.8%
Final simplification53.8%
(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 2023293
(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))))