
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - z) * t) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - z) * t) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* (- y z) t) (- a z))))
(if (<= t_1 (- INFINITY))
(+ x (/ (- y z) (/ (- a z) t)))
(if (<= t_1 2e+275) (+ t_1 x) (+ x (* (- y z) (/ t (- a z))))))))
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)) {
tmp = x + ((y - z) / ((a - z) / t));
} else if (t_1 <= 2e+275) {
tmp = t_1 + x;
} else {
tmp = x + ((y - z) * (t / (a - z)));
}
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) {
tmp = x + ((y - z) / ((a - z) / t));
} else if (t_1 <= 2e+275) {
tmp = t_1 + x;
} else {
tmp = x + ((y - z) * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((y - z) * t) / (a - z) tmp = 0 if t_1 <= -math.inf: tmp = x + ((y - z) / ((a - z) / t)) elif t_1 <= 2e+275: tmp = t_1 + x else: tmp = x + ((y - z) * (t / (a - z))) 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)) tmp = Float64(x + Float64(Float64(y - z) / Float64(Float64(a - z) / t))); elseif (t_1 <= 2e+275) tmp = Float64(t_1 + x); else tmp = Float64(x + Float64(Float64(y - z) * Float64(t / Float64(a - z)))); 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) tmp = x + ((y - z) / ((a - z) / t)); elseif (t_1 <= 2e+275) tmp = t_1 + x; else tmp = x + ((y - z) * (t / (a - z))); 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[LessEqual[t$95$1, (-Infinity)], N[(x + N[(N[(y - z), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+275], N[(t$95$1 + x), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;x + \frac{y - z}{\frac{a - z}{t}}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+275}:\\
\;\;\;\;t\_1 + x\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -inf.0Initial program 36.3%
associate-/l*99.7%
Simplified99.7%
clear-num99.7%
un-div-inv99.9%
Applied egg-rr99.9%
if -inf.0 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 1.99999999999999992e275Initial program 99.9%
if 1.99999999999999992e275 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 41.3%
associate-/l*99.8%
Simplified99.8%
Final simplification99.9%
(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+275)))
(+ x (* (- y z) (/ t (- a z))))
(+ t_1 x))))
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+275)) {
tmp = x + ((y - z) * (t / (a - z)));
} else {
tmp = t_1 + x;
}
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+275)) {
tmp = x + ((y - z) * (t / (a - z)));
} else {
tmp = t_1 + x;
}
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+275): tmp = x + ((y - z) * (t / (a - z))) else: tmp = t_1 + x 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+275)) tmp = Float64(x + Float64(Float64(y - z) * Float64(t / Float64(a - z)))); else tmp = Float64(t_1 + x); 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+275))) tmp = x + ((y - z) * (t / (a - z))); else tmp = t_1 + x; 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+275]], $MachinePrecision]], N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + x), $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^{+275}\right):\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1 + x\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -inf.0 or 1.99999999999999992e275 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 38.1%
associate-/l*99.8%
Simplified99.8%
if -inf.0 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 1.99999999999999992e275Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.3e-28) (not (<= y 1.48e-27))) (+ x (* y (/ t (- a z)))) (+ x (* z (/ t (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.3e-28) || !(y <= 1.48e-27)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (z * (t / (z - 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 ((y <= (-1.3d-28)) .or. (.not. (y <= 1.48d-27))) then
tmp = x + (y * (t / (a - z)))
else
tmp = x + (z * (t / (z - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.3e-28) || !(y <= 1.48e-27)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (z * (t / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.3e-28) or not (y <= 1.48e-27): tmp = x + (y * (t / (a - z))) else: tmp = x + (z * (t / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.3e-28) || !(y <= 1.48e-27)) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); else tmp = Float64(x + Float64(z * Float64(t / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1.3e-28) || ~((y <= 1.48e-27))) tmp = x + (y * (t / (a - z))); else tmp = x + (z * (t / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.3e-28], N[Not[LessEqual[y, 1.48e-27]], $MachinePrecision]], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{-28} \lor \neg \left(y \leq 1.48 \cdot 10^{-27}\right):\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{t}{z - a}\\
\end{array}
\end{array}
if y < -1.3e-28 or 1.48000000000000008e-27 < y Initial program 83.5%
associate-/l*96.0%
Simplified96.0%
Taylor expanded in y around inf 87.0%
if -1.3e-28 < y < 1.48000000000000008e-27Initial program 82.6%
associate-/l*94.6%
Simplified94.6%
Taylor expanded in y around 0 79.4%
associate-*r/79.4%
mul-1-neg79.4%
distribute-rgt-neg-out79.4%
associate-*l/92.3%
*-commutative92.3%
distribute-lft-neg-out92.3%
distribute-rgt-neg-in92.3%
distribute-frac-neg292.3%
neg-sub092.3%
sub-neg92.3%
+-commutative92.3%
associate--r+92.3%
neg-sub092.3%
remove-double-neg92.3%
Simplified92.3%
Final simplification89.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.8e+86) (not (<= z 1.6e+151))) (+ t x) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.8e+86) || !(z <= 1.6e+151)) {
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 <= (-2.8d+86)) .or. (.not. (z <= 1.6d+151))) 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 <= -2.8e+86) || !(z <= 1.6e+151)) {
tmp = t + x;
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.8e+86) or not (z <= 1.6e+151): tmp = t + x else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.8e+86) || !(z <= 1.6e+151)) 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 <= -2.8e+86) || ~((z <= 1.6e+151))) 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, -2.8e+86], N[Not[LessEqual[z, 1.6e+151]], $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 -2.8 \cdot 10^{+86} \lor \neg \left(z \leq 1.6 \cdot 10^{+151}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -2.80000000000000004e86 or 1.59999999999999997e151 < z Initial program 65.1%
associate-/l*93.8%
Simplified93.8%
Taylor expanded in z around inf 85.5%
if -2.80000000000000004e86 < z < 1.59999999999999997e151Initial program 91.8%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in y around inf 87.9%
Final simplification87.1%
(FPCore (x y z t a) :precision binary64 (if (<= y -6.5e-30) (+ x (/ y (/ (- a z) t))) (if (<= y 1.45e-33) (+ x (* z (/ t (- z a)))) (+ x (* y (/ t (- a z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -6.5e-30) {
tmp = x + (y / ((a - z) / t));
} else if (y <= 1.45e-33) {
tmp = x + (z * (t / (z - a)));
} 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 (y <= (-6.5d-30)) then
tmp = x + (y / ((a - z) / t))
else if (y <= 1.45d-33) then
tmp = x + (z * (t / (z - a)))
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 (y <= -6.5e-30) {
tmp = x + (y / ((a - z) / t));
} else if (y <= 1.45e-33) {
tmp = x + (z * (t / (z - a)));
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -6.5e-30: tmp = x + (y / ((a - z) / t)) elif y <= 1.45e-33: tmp = x + (z * (t / (z - a))) else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -6.5e-30) tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); elseif (y <= 1.45e-33) tmp = Float64(x + Float64(z * Float64(t / Float64(z - a)))); 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 (y <= -6.5e-30) tmp = x + (y / ((a - z) / t)); elseif (y <= 1.45e-33) tmp = x + (z * (t / (z - a))); else tmp = x + (y * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -6.5e-30], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.45e-33], N[(x + N[(z * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{-30}:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{-33}:\\
\;\;\;\;x + z \cdot \frac{t}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if y < -6.5000000000000005e-30Initial program 84.3%
associate-/l*97.1%
Simplified97.1%
Taylor expanded in y around inf 85.1%
clear-num85.1%
div-inv85.2%
Applied egg-rr85.2%
if -6.5000000000000005e-30 < y < 1.45000000000000001e-33Initial program 82.6%
associate-/l*94.6%
Simplified94.6%
Taylor expanded in y around 0 79.4%
associate-*r/79.4%
mul-1-neg79.4%
distribute-rgt-neg-out79.4%
associate-*l/92.3%
*-commutative92.3%
distribute-lft-neg-out92.3%
distribute-rgt-neg-in92.3%
distribute-frac-neg292.3%
neg-sub092.3%
sub-neg92.3%
+-commutative92.3%
associate--r+92.3%
neg-sub092.3%
remove-double-neg92.3%
Simplified92.3%
if 1.45000000000000001e-33 < y Initial program 82.3%
associate-/l*94.7%
Simplified94.7%
Taylor expanded in y around inf 89.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.5e+81) (not (<= z 7.2e+74))) (+ t x) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.5e+81) || !(z <= 7.2e+74)) {
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 <= (-4.5d+81)) .or. (.not. (z <= 7.2d+74))) 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 <= -4.5e+81) || !(z <= 7.2e+74)) {
tmp = t + x;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.5e+81) or not (z <= 7.2e+74): tmp = t + x else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.5e+81) || !(z <= 7.2e+74)) 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 <= -4.5e+81) || ~((z <= 7.2e+74))) tmp = t + x; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.5e+81], N[Not[LessEqual[z, 7.2e+74]], $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 -4.5 \cdot 10^{+81} \lor \neg \left(z \leq 7.2 \cdot 10^{+74}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -4.50000000000000017e81 or 7.19999999999999975e74 < z Initial program 67.1%
associate-/l*94.5%
Simplified94.5%
Taylor expanded in z around inf 82.2%
if -4.50000000000000017e81 < z < 7.19999999999999975e74Initial program 92.4%
associate-/l*95.8%
Simplified95.8%
Taylor expanded in z around 0 74.7%
+-commutative74.7%
associate-/l*77.6%
Simplified77.6%
Final simplification79.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.05e+37) (not (<= z 8.2e+73))) (+ t x) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.05e+37) || !(z <= 8.2e+73)) {
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 <= (-3.05d+37)) .or. (.not. (z <= 8.2d+73))) 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 <= -3.05e+37) || !(z <= 8.2e+73)) {
tmp = t + x;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.05e+37) or not (z <= 8.2e+73): tmp = t + x else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.05e+37) || !(z <= 8.2e+73)) tmp = Float64(t + x); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.05e+37) || ~((z <= 8.2e+73))) tmp = t + x; else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.05e+37], N[Not[LessEqual[z, 8.2e+73]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.05 \cdot 10^{+37} \lor \neg \left(z \leq 8.2 \cdot 10^{+73}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -3.05e37 or 8.1999999999999996e73 < z Initial program 66.6%
associate-/l*94.4%
Simplified94.4%
Taylor expanded in z around inf 78.3%
if -3.05e37 < z < 8.1999999999999996e73Initial program 96.0%
associate-/l*96.0%
Simplified96.0%
Taylor expanded in z around 0 78.2%
Final simplification78.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.4e+64) (not (<= z 1.95e+73))) (+ t x) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.4e+64) || !(z <= 1.95e+73)) {
tmp = t + x;
} 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 <= (-2.4d+64)) .or. (.not. (z <= 1.95d+73))) then
tmp = t + x
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 <= -2.4e+64) || !(z <= 1.95e+73)) {
tmp = t + x;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.4e+64) or not (z <= 1.95e+73): tmp = t + x else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.4e+64) || !(z <= 1.95e+73)) tmp = Float64(t + x); 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 <= -2.4e+64) || ~((z <= 1.95e+73))) tmp = t + x; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.4e+64], N[Not[LessEqual[z, 1.95e+73]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{+64} \lor \neg \left(z \leq 1.95 \cdot 10^{+73}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -2.39999999999999999e64 or 1.95e73 < z Initial program 66.7%
associate-/l*94.0%
Simplified94.0%
Taylor expanded in z around inf 79.2%
if -2.39999999999999999e64 < z < 1.95e73Initial program 94.4%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in y around inf 88.8%
clear-num88.7%
div-inv89.5%
Applied egg-rr89.5%
Taylor expanded in a around inf 76.7%
Final simplification77.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.55e+64) (not (<= z 1.38e+73))) (+ t x) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.55e+64) || !(z <= 1.38e+73)) {
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 <= (-2.55d+64)) .or. (.not. (z <= 1.38d+73))) 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 <= -2.55e+64) || !(z <= 1.38e+73)) {
tmp = t + x;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.55e+64) or not (z <= 1.38e+73): tmp = t + x else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.55e+64) || !(z <= 1.38e+73)) 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 <= -2.55e+64) || ~((z <= 1.38e+73))) tmp = t + x; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.55e+64], N[Not[LessEqual[z, 1.38e+73]], $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 -2.55 \cdot 10^{+64} \lor \neg \left(z \leq 1.38 \cdot 10^{+73}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -2.55000000000000012e64 or 1.38000000000000007e73 < z Initial program 66.7%
associate-/l*94.0%
Simplified94.0%
Taylor expanded in z around inf 79.2%
if -2.55000000000000012e64 < z < 1.38000000000000007e73Initial program 94.4%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in y around inf 88.8%
Taylor expanded in a around inf 76.7%
Final simplification77.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.2e-79) (not (<= z 5.5e-86))) (+ t x) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.2e-79) || !(z <= 5.5e-86)) {
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 <= (-7.2d-79)) .or. (.not. (z <= 5.5d-86))) 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 <= -7.2e-79) || !(z <= 5.5e-86)) {
tmp = t + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.2e-79) or not (z <= 5.5e-86): tmp = t + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.2e-79) || !(z <= 5.5e-86)) 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 <= -7.2e-79) || ~((z <= 5.5e-86))) tmp = t + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.2e-79], N[Not[LessEqual[z, 5.5e-86]], $MachinePrecision]], N[(t + x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{-79} \lor \neg \left(z \leq 5.5 \cdot 10^{-86}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -7.2000000000000005e-79 or 5.5e-86 < z Initial program 75.6%
associate-/l*95.6%
Simplified95.6%
Taylor expanded in z around inf 71.5%
if -7.2000000000000005e-79 < z < 5.5e-86Initial program 96.8%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in x around inf 55.5%
Final simplification65.9%
(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(y - z) * Float64(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[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \frac{t}{a - z}
\end{array}
Initial program 83.0%
associate-/l*95.3%
Simplified95.3%
(FPCore (x y z t a) :precision binary64 (if (<= t -9.5e+221) t x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -9.5e+221) {
tmp = t;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-9.5d+221)) then
tmp = t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -9.5e+221) {
tmp = t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -9.5e+221: tmp = t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -9.5e+221) tmp = t; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -9.5e+221) tmp = t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -9.5e+221], t, x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.5 \cdot 10^{+221}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -9.50000000000000044e221Initial program 49.4%
associate-/l*95.3%
Simplified95.3%
Taylor expanded in z around inf 47.1%
Taylor expanded in x around 0 46.4%
if -9.50000000000000044e221 < t Initial program 85.9%
associate-/l*95.3%
Simplified95.3%
Taylor expanded in x around inf 57.4%
(FPCore (x y z t a) :precision binary64 t)
double code(double x, double y, double z, double t, double a) {
return t;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = t
end function
public static double code(double x, double y, double z, double t, double a) {
return t;
}
def code(x, y, z, t, a): return t
function code(x, y, z, t, a) return t end
function tmp = code(x, y, z, t, a) tmp = t; end
code[x_, y_, z_, t_, a_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 83.0%
associate-/l*95.3%
Simplified95.3%
Taylor expanded in z around inf 62.0%
Taylor expanded in x around 0 16.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 2024132
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (if (< t -10682974490174067/10000000000000000000000000000000000000000000000000000000) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 312887599100691/80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t)))))
(+ x (/ (* (- y z) t) (- a z))))