
(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
(let* ((t_1 (/ (* t (- y z)) (- a z))))
(if (<= t_1 (- INFINITY))
(- x (* (- y z) (/ t (- z a))))
(if (<= t_1 5e+289) (+ x t_1) (+ x (/ (- y z) (/ (- a z) t)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t * (y - z)) / (a - z);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = x - ((y - z) * (t / (z - a)));
} else if (t_1 <= 5e+289) {
tmp = x + t_1;
} else {
tmp = x + ((y - z) / ((a - z) / t));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (t * (y - z)) / (a - z);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = x - ((y - z) * (t / (z - a)));
} else if (t_1 <= 5e+289) {
tmp = x + t_1;
} else {
tmp = x + ((y - z) / ((a - z) / t));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (t * (y - z)) / (a - z) tmp = 0 if t_1 <= -math.inf: tmp = x - ((y - z) * (t / (z - a))) elif t_1 <= 5e+289: tmp = x + t_1 else: tmp = x + ((y - z) / ((a - z) / t)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(t * Float64(y - z)) / Float64(a - z)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(x - Float64(Float64(y - z) * Float64(t / Float64(z - a)))); elseif (t_1 <= 5e+289) tmp = Float64(x + t_1); else tmp = Float64(x + Float64(Float64(y - z) / Float64(Float64(a - z) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (t * (y - z)) / (a - z); tmp = 0.0; if (t_1 <= -Inf) tmp = x - ((y - z) * (t / (z - a))); elseif (t_1 <= 5e+289) tmp = x + t_1; else tmp = x + ((y - z) / ((a - z) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x - N[(N[(y - z), $MachinePrecision] * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+289], N[(x + t$95$1), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t \cdot \left(y - z\right)}{a - z}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;x - \left(y - z\right) \cdot \frac{t}{z - a}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+289}:\\
\;\;\;\;x + t\_1\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y - z}{\frac{a - z}{t}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -inf.0Initial program 38.2%
associate-/l*99.8%
Simplified99.8%
if -inf.0 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 5.00000000000000031e289Initial program 99.9%
if 5.00000000000000031e289 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 31.1%
associate-/l*99.6%
Simplified99.6%
clear-num99.5%
un-div-inv99.7%
Applied egg-rr99.7%
Final simplification99.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* t (- y z)) (- a z))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 5e+289)))
(- x (* (- y z) (/ t (- z a))))
(+ x t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t * (y - z)) / (a - z);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 5e+289)) {
tmp = x - ((y - z) * (t / (z - a)));
} else {
tmp = x + t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (t * (y - z)) / (a - z);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 5e+289)) {
tmp = x - ((y - z) * (t / (z - a)));
} else {
tmp = x + t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (t * (y - z)) / (a - z) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 5e+289): tmp = x - ((y - z) * (t / (z - a))) else: tmp = x + t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(t * Float64(y - z)) / Float64(a - z)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 5e+289)) tmp = Float64(x - Float64(Float64(y - z) * Float64(t / Float64(z - a)))); else tmp = Float64(x + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (t * (y - z)) / (a - z); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 5e+289))) tmp = x - ((y - z) * (t / (z - a))); else tmp = x + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 5e+289]], $MachinePrecision]], N[(x - N[(N[(y - z), $MachinePrecision] * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t \cdot \left(y - z\right)}{a - z}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 5 \cdot 10^{+289}\right):\\
\;\;\;\;x - \left(y - z\right) \cdot \frac{t}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -inf.0 or 5.00000000000000031e289 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 34.4%
associate-/l*99.7%
Simplified99.7%
if -inf.0 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 5.00000000000000031e289Initial program 99.9%
Final simplification99.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.3e+87) (not (<= z 9.8e+210))) (+ x t) (+ x (* t (/ y (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.3e+87) || !(z <= 9.8e+210)) {
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.3d+87)) .or. (.not. (z <= 9.8d+210))) 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.3e+87) || !(z <= 9.8e+210)) {
tmp = x + t;
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.3e+87) or not (z <= 9.8e+210): 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.3e+87) || !(z <= 9.8e+210)) 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.3e+87) || ~((z <= 9.8e+210))) 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.3e+87], N[Not[LessEqual[z, 9.8e+210]], $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.3 \cdot 10^{+87} \lor \neg \left(z \leq 9.8 \cdot 10^{+210}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if z < -1.29999999999999999e87 or 9.80000000000000013e210 < z Initial program 63.9%
associate-/l*97.4%
Simplified97.4%
Taylor expanded in z around inf 85.5%
if -1.29999999999999999e87 < z < 9.80000000000000013e210Initial program 92.1%
associate-/l*93.6%
Simplified93.6%
Taylor expanded in y around inf 81.5%
associate-/l*85.9%
Simplified85.9%
Final simplification85.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -3e-107) (not (<= y 5e+46))) (+ x (* t (/ y (- a z)))) (- x (* t (/ z (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -3e-107) || !(y <= 5e+46)) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x - (t * (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 <= (-3d-107)) .or. (.not. (y <= 5d+46))) then
tmp = x + (t * (y / (a - z)))
else
tmp = x - (t * (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 <= -3e-107) || !(y <= 5e+46)) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x - (t * (z / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -3e-107) or not (y <= 5e+46): tmp = x + (t * (y / (a - z))) else: tmp = x - (t * (z / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -3e-107) || !(y <= 5e+46)) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); else tmp = Float64(x - Float64(t * Float64(z / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -3e-107) || ~((y <= 5e+46))) tmp = x + (t * (y / (a - z))); else tmp = x - (t * (z / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -3e-107], N[Not[LessEqual[y, 5e+46]], $MachinePrecision]], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{-107} \lor \neg \left(y \leq 5 \cdot 10^{+46}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \frac{z}{a - z}\\
\end{array}
\end{array}
if y < -2.9999999999999997e-107 or 5.0000000000000002e46 < y Initial program 80.6%
associate-/l*94.5%
Simplified94.5%
Taylor expanded in y around inf 76.7%
associate-/l*86.2%
Simplified86.2%
if -2.9999999999999997e-107 < y < 5.0000000000000002e46Initial program 87.1%
associate-/l*95.2%
Simplified95.2%
Taylor expanded in y around 0 80.7%
mul-1-neg80.7%
unsub-neg80.7%
associate-/l*93.6%
Simplified93.6%
Final simplification89.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.2e+46) (not (<= z 3e-43))) (+ x t) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.2e+46) || !(z <= 3e-43)) {
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 <= (-5.2d+46)) .or. (.not. (z <= 3d-43))) 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 <= -5.2e+46) || !(z <= 3e-43)) {
tmp = x + t;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.2e+46) or not (z <= 3e-43): tmp = x + t else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.2e+46) || !(z <= 3e-43)) 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 <= -5.2e+46) || ~((z <= 3e-43))) tmp = x + t; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.2e+46], N[Not[LessEqual[z, 3e-43]], $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 -5.2 \cdot 10^{+46} \lor \neg \left(z \leq 3 \cdot 10^{-43}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -5.20000000000000027e46 or 3.00000000000000003e-43 < z Initial program 73.7%
associate-/l*95.6%
Simplified95.6%
Taylor expanded in z around inf 78.2%
if -5.20000000000000027e46 < z < 3.00000000000000003e-43Initial program 93.9%
associate-/l*93.9%
Simplified93.9%
Taylor expanded in z around 0 69.7%
*-commutative69.7%
associate-/l*72.5%
Simplified72.5%
Final simplification75.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.8e+46) (not (<= z 2.8e-45))) (+ x t) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.8e+46) || !(z <= 2.8e-45)) {
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 <= (-5.8d+46)) .or. (.not. (z <= 2.8d-45))) 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 <= -5.8e+46) || !(z <= 2.8e-45)) {
tmp = x + t;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.8e+46) or not (z <= 2.8e-45): tmp = x + t else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.8e+46) || !(z <= 2.8e-45)) 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 <= -5.8e+46) || ~((z <= 2.8e-45))) tmp = x + t; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.8e+46], N[Not[LessEqual[z, 2.8e-45]], $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 -5.8 \cdot 10^{+46} \lor \neg \left(z \leq 2.8 \cdot 10^{-45}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -5.8000000000000004e46 or 2.8000000000000001e-45 < z Initial program 73.7%
associate-/l*95.6%
Simplified95.6%
Taylor expanded in z around inf 78.2%
if -5.8000000000000004e46 < z < 2.8000000000000001e-45Initial program 93.9%
associate-/l*93.9%
Simplified93.9%
Taylor expanded in z around 0 69.7%
+-commutative69.7%
associate-/l*74.1%
Simplified74.1%
Final simplification76.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6.4e+46) (not (<= z 3.4e-43))) (+ x t) (+ x (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.4e+46) || !(z <= 3.4e-43)) {
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 <= (-6.4d+46)) .or. (.not. (z <= 3.4d-43))) 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 <= -6.4e+46) || !(z <= 3.4e-43)) {
tmp = x + t;
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6.4e+46) or not (z <= 3.4e-43): tmp = x + t else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6.4e+46) || !(z <= 3.4e-43)) 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 <= -6.4e+46) || ~((z <= 3.4e-43))) tmp = x + t; else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6.4e+46], N[Not[LessEqual[z, 3.4e-43]], $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 -6.4 \cdot 10^{+46} \lor \neg \left(z \leq 3.4 \cdot 10^{-43}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -6.3999999999999996e46 or 3.4000000000000001e-43 < z Initial program 73.7%
associate-/l*95.6%
Simplified95.6%
Taylor expanded in z around inf 78.2%
if -6.3999999999999996e46 < z < 3.4000000000000001e-43Initial program 93.9%
associate-/l*93.9%
Simplified93.9%
Taylor expanded in z around 0 69.7%
+-commutative69.7%
associate-/l*74.1%
Simplified74.1%
clear-num74.0%
un-div-inv74.1%
Applied egg-rr74.1%
Final simplification76.3%
(FPCore (x y z t a) :precision binary64 (if (<= a -4.8e+50) x (if (<= a 2.3e+139) (+ x t) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.8e+50) {
tmp = x;
} else if (a <= 2.3e+139) {
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.8d+50)) then
tmp = x
else if (a <= 2.3d+139) 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.8e+50) {
tmp = x;
} else if (a <= 2.3e+139) {
tmp = x + t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -4.8e+50: tmp = x elif a <= 2.3e+139: tmp = x + t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4.8e+50) tmp = x; elseif (a <= 2.3e+139) 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.8e+50) tmp = x; elseif (a <= 2.3e+139) tmp = x + t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.8e+50], x, If[LessEqual[a, 2.3e+139], N[(x + t), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.8 \cdot 10^{+50}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{+139}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -4.8000000000000004e50 or 2.3e139 < a Initial program 78.1%
associate-/l*98.8%
Simplified98.8%
Taylor expanded in x around inf 66.5%
if -4.8000000000000004e50 < a < 2.3e139Initial program 86.2%
associate-/l*92.8%
Simplified92.8%
Taylor expanded in z around inf 61.8%
Final simplification63.4%
(FPCore (x y z t a) :precision binary64 (+ x (* t (* (/ -1.0 (- z a)) (- y z)))))
double code(double x, double y, double z, double t, double a) {
return x + (t * ((-1.0 / (z - a)) * (y - 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 * (((-1.0d0) / (z - a)) * (y - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (t * ((-1.0 / (z - a)) * (y - z)));
}
def code(x, y, z, t, a): return x + (t * ((-1.0 / (z - a)) * (y - z)))
function code(x, y, z, t, a) return Float64(x + Float64(t * Float64(Float64(-1.0 / Float64(z - a)) * Float64(y - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + (t * ((-1.0 / (z - a)) * (y - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(t * N[(N[(-1.0 / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + t \cdot \left(\frac{-1}{z - a} \cdot \left(y - z\right)\right)
\end{array}
Initial program 83.5%
associate-*r/94.8%
*-commutative94.8%
div-inv94.7%
associate-*l*98.3%
Applied egg-rr98.3%
Final simplification98.3%
(FPCore (x y z t a) :precision binary64 (- x (* (- y z) (/ t (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) * (t / (z - a)));
}
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 / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) * (t / (z - a)));
}
def code(x, y, z, t, a): return x - ((y - z) * (t / (z - a)))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) * Float64(t / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) * (t / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \left(y - z\right) \cdot \frac{t}{z - a}
\end{array}
Initial program 83.5%
associate-/l*94.8%
Simplified94.8%
Final simplification94.8%
(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 83.5%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in x around inf 50.4%
Final simplification50.4%
(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 2024077
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
:alt
(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))))