
(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 (/ (* (- y z) t) (- a z))))
(if (<= t_1 (- INFINITY))
(+ x (* (- y z) (/ t (- a z))))
(if (<= t_1 2e+250) (+ t_1 x) (+ x (/ (- y z) (/ (- a z) t)))))))
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) * (t / (a - z)));
} else if (t_1 <= 2e+250) {
tmp = t_1 + x;
} 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 = ((y - z) * t) / (a - z);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = x + ((y - z) * (t / (a - z)));
} else if (t_1 <= 2e+250) {
tmp = t_1 + x;
} else {
tmp = x + ((y - z) / ((a - z) / t));
}
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) * (t / (a - z))) elif t_1 <= 2e+250: tmp = t_1 + x else: tmp = x + ((y - z) / ((a - z) / t)) 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(t / Float64(a - z)))); elseif (t_1 <= 2e+250) tmp = Float64(t_1 + x); 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 = ((y - z) * t) / (a - z); tmp = 0.0; if (t_1 <= -Inf) tmp = x + ((y - z) * (t / (a - z))); elseif (t_1 <= 2e+250) tmp = t_1 + x; 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[(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[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+250], N[(t$95$1 + x), $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{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a - z}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+250}:\\
\;\;\;\;t\_1 + x\\
\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 29.3%
associate-/l*99.9%
Simplified99.9%
if -inf.0 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 1.9999999999999998e250Initial program 99.4%
if 1.9999999999999998e250 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 42.2%
associate-/l*99.7%
Simplified99.7%
clear-num99.3%
un-div-inv99.9%
Applied egg-rr99.9%
Final simplification99.5%
(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+250)))
(+ 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+250)) {
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+250)) {
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+250): 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+250)) 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+250))) 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+250]], $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^{+250}\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.9999999999999998e250 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 36.6%
associate-/l*99.8%
Simplified99.8%
if -inf.0 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 1.9999999999999998e250Initial program 99.4%
Final simplification99.5%
(FPCore (x y z t a)
:precision binary64
(if (<= z -8.5e+64)
(+ t x)
(if (<= z 3.8e-98)
(+ x (/ (* y t) a))
(if (<= z 860000.0) (- x (/ (* y t) z)) (+ t x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.5e+64) {
tmp = t + x;
} else if (z <= 3.8e-98) {
tmp = x + ((y * t) / a);
} else if (z <= 860000.0) {
tmp = x - ((y * t) / z);
} else {
tmp = t + x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-8.5d+64)) then
tmp = t + x
else if (z <= 3.8d-98) then
tmp = x + ((y * t) / a)
else if (z <= 860000.0d0) then
tmp = x - ((y * t) / z)
else
tmp = t + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.5e+64) {
tmp = t + x;
} else if (z <= 3.8e-98) {
tmp = x + ((y * t) / a);
} else if (z <= 860000.0) {
tmp = x - ((y * t) / z);
} else {
tmp = t + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8.5e+64: tmp = t + x elif z <= 3.8e-98: tmp = x + ((y * t) / a) elif z <= 860000.0: tmp = x - ((y * t) / z) else: tmp = t + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.5e+64) tmp = Float64(t + x); elseif (z <= 3.8e-98) tmp = Float64(x + Float64(Float64(y * t) / a)); elseif (z <= 860000.0) tmp = Float64(x - Float64(Float64(y * t) / z)); else tmp = Float64(t + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -8.5e+64) tmp = t + x; elseif (z <= 3.8e-98) tmp = x + ((y * t) / a); elseif (z <= 860000.0) tmp = x - ((y * t) / z); else tmp = t + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.5e+64], N[(t + x), $MachinePrecision], If[LessEqual[z, 3.8e-98], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 860000.0], N[(x - N[(N[(y * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(t + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+64}:\\
\;\;\;\;t + x\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-98}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\mathbf{elif}\;z \leq 860000:\\
\;\;\;\;x - \frac{y \cdot t}{z}\\
\mathbf{else}:\\
\;\;\;\;t + x\\
\end{array}
\end{array}
if z < -8.4999999999999998e64 or 8.6e5 < z Initial program 74.1%
associate-/l*94.4%
Simplified94.4%
Taylor expanded in z around inf 80.8%
if -8.4999999999999998e64 < z < 3.8000000000000003e-98Initial program 96.5%
associate-/l*94.7%
Simplified94.7%
Taylor expanded in z around 0 78.4%
+-commutative78.4%
Simplified78.4%
if 3.8000000000000003e-98 < z < 8.6e5Initial program 93.3%
Taylor expanded in y around inf 83.4%
Taylor expanded in a around 0 76.6%
+-commutative76.6%
associate-*r/76.6%
associate-*r*76.6%
*-commutative76.6%
neg-mul-176.6%
Simplified76.6%
Final simplification79.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -8.5e+64)
(+ t x)
(if (<= z 3.6e-98)
(+ x (/ (* y t) a))
(if (<= z 400000.0) (- x (* y (/ t z))) (+ t x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.5e+64) {
tmp = t + x;
} else if (z <= 3.6e-98) {
tmp = x + ((y * t) / a);
} else if (z <= 400000.0) {
tmp = x - (y * (t / z));
} else {
tmp = t + x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-8.5d+64)) then
tmp = t + x
else if (z <= 3.6d-98) then
tmp = x + ((y * t) / a)
else if (z <= 400000.0d0) then
tmp = x - (y * (t / z))
else
tmp = t + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.5e+64) {
tmp = t + x;
} else if (z <= 3.6e-98) {
tmp = x + ((y * t) / a);
} else if (z <= 400000.0) {
tmp = x - (y * (t / z));
} else {
tmp = t + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8.5e+64: tmp = t + x elif z <= 3.6e-98: tmp = x + ((y * t) / a) elif z <= 400000.0: tmp = x - (y * (t / z)) else: tmp = t + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.5e+64) tmp = Float64(t + x); elseif (z <= 3.6e-98) tmp = Float64(x + Float64(Float64(y * t) / a)); elseif (z <= 400000.0) tmp = Float64(x - Float64(y * Float64(t / z))); else tmp = Float64(t + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -8.5e+64) tmp = t + x; elseif (z <= 3.6e-98) tmp = x + ((y * t) / a); elseif (z <= 400000.0) tmp = x - (y * (t / z)); else tmp = t + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.5e+64], N[(t + x), $MachinePrecision], If[LessEqual[z, 3.6e-98], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 400000.0], N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+64}:\\
\;\;\;\;t + x\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-98}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\mathbf{elif}\;z \leq 400000:\\
\;\;\;\;x - y \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t + x\\
\end{array}
\end{array}
if z < -8.4999999999999998e64 or 4e5 < z Initial program 74.1%
associate-/l*94.4%
Simplified94.4%
Taylor expanded in z around inf 80.8%
if -8.4999999999999998e64 < z < 3.6000000000000002e-98Initial program 96.5%
associate-/l*94.7%
Simplified94.7%
Taylor expanded in z around 0 78.4%
+-commutative78.4%
Simplified78.4%
if 3.6000000000000002e-98 < z < 4e5Initial program 93.3%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in y around inf 89.8%
Taylor expanded in a around 0 76.4%
associate-*r/76.4%
neg-mul-176.4%
Simplified76.4%
Final simplification79.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -4.2e+62)
(+ t x)
(if (<= z 6.2e-78)
(+ x (* t (/ y a)))
(if (<= z 9500000.0) (- x (* t (/ y z))) (+ t x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.2e+62) {
tmp = t + x;
} else if (z <= 6.2e-78) {
tmp = x + (t * (y / a));
} else if (z <= 9500000.0) {
tmp = x - (t * (y / z));
} else {
tmp = t + x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-4.2d+62)) then
tmp = t + x
else if (z <= 6.2d-78) then
tmp = x + (t * (y / a))
else if (z <= 9500000.0d0) then
tmp = x - (t * (y / z))
else
tmp = t + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.2e+62) {
tmp = t + x;
} else if (z <= 6.2e-78) {
tmp = x + (t * (y / a));
} else if (z <= 9500000.0) {
tmp = x - (t * (y / z));
} else {
tmp = t + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.2e+62: tmp = t + x elif z <= 6.2e-78: tmp = x + (t * (y / a)) elif z <= 9500000.0: tmp = x - (t * (y / z)) else: tmp = t + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.2e+62) tmp = Float64(t + x); elseif (z <= 6.2e-78) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (z <= 9500000.0) tmp = Float64(x - Float64(t * Float64(y / z))); else tmp = Float64(t + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4.2e+62) tmp = t + x; elseif (z <= 6.2e-78) tmp = x + (t * (y / a)); elseif (z <= 9500000.0) tmp = x - (t * (y / z)); else tmp = t + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.2e+62], N[(t + x), $MachinePrecision], If[LessEqual[z, 6.2e-78], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9500000.0], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{+62}:\\
\;\;\;\;t + x\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{-78}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 9500000:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;t + x\\
\end{array}
\end{array}
if z < -4.2e62 or 9.5e6 < z Initial program 74.6%
associate-/l*94.5%
Simplified94.5%
Taylor expanded in z around inf 81.1%
if -4.2e62 < z < 6.20000000000000035e-78Initial program 95.8%
associate-/l*95.0%
Simplified95.0%
Taylor expanded in z around 0 75.1%
associate-/l*75.9%
Simplified75.9%
if 6.20000000000000035e-78 < z < 9.5e6Initial program 95.5%
Taylor expanded in y around inf 86.8%
Taylor expanded in a around 0 86.8%
mul-1-neg86.8%
unsub-neg86.8%
associate-/l*86.8%
Simplified86.8%
Final simplification79.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -880000000000.0) (not (<= y 2.9e+155))) (+ 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 <= -880000000000.0) || !(y <= 2.9e+155)) {
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 <= (-880000000000.0d0)) .or. (.not. (y <= 2.9d+155))) 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 <= -880000000000.0) || !(y <= 2.9e+155)) {
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 <= -880000000000.0) or not (y <= 2.9e+155): 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 <= -880000000000.0) || !(y <= 2.9e+155)) 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 <= -880000000000.0) || ~((y <= 2.9e+155))) 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, -880000000000.0], N[Not[LessEqual[y, 2.9e+155]], $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 -880000000000 \lor \neg \left(y \leq 2.9 \cdot 10^{+155}\right):\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{t}{z - a}\\
\end{array}
\end{array}
if y < -8.8e11 or 2.8999999999999999e155 < y Initial program 87.8%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in y around inf 91.7%
if -8.8e11 < y < 2.8999999999999999e155Initial program 84.8%
associate-/l*93.6%
Simplified93.6%
Taylor expanded in y around 0 76.1%
associate-*r/76.1%
mul-1-neg76.1%
distribute-rgt-neg-out76.1%
associate-*l/86.6%
*-commutative86.6%
distribute-lft-neg-out86.6%
distribute-rgt-neg-in86.6%
distribute-frac-neg286.6%
neg-sub086.6%
sub-neg86.6%
+-commutative86.6%
associate--r+86.6%
neg-sub086.6%
remove-double-neg86.6%
Simplified86.6%
Final simplification88.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.75e+67) (not (<= z 950000000.0))) (+ t x) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.75e+67) || !(z <= 950000000.0)) {
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 <= (-1.75d+67)) .or. (.not. (z <= 950000000.0d0))) 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 <= -1.75e+67) || !(z <= 950000000.0)) {
tmp = t + x;
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.75e+67) or not (z <= 950000000.0): tmp = t + x else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.75e+67) || !(z <= 950000000.0)) 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 <= -1.75e+67) || ~((z <= 950000000.0))) 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, -1.75e+67], N[Not[LessEqual[z, 950000000.0]], $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 -1.75 \cdot 10^{+67} \lor \neg \left(z \leq 950000000\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -1.75e67 or 9.5e8 < z Initial program 74.1%
associate-/l*94.4%
Simplified94.4%
Taylor expanded in z around inf 80.8%
if -1.75e67 < z < 9.5e8Initial program 95.8%
associate-/l*95.8%
Simplified95.8%
Taylor expanded in y around inf 86.0%
Final simplification83.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.1e+62) (not (<= z 4.5e-63))) (+ t x) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.1e+62) || !(z <= 4.5e-63)) {
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.1d+62)) .or. (.not. (z <= 4.5d-63))) 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.1e+62) || !(z <= 4.5e-63)) {
tmp = t + x;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.1e+62) or not (z <= 4.5e-63): tmp = t + x else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.1e+62) || !(z <= 4.5e-63)) 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.1e+62) || ~((z <= 4.5e-63))) 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.1e+62], N[Not[LessEqual[z, 4.5e-63]], $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.1 \cdot 10^{+62} \lor \neg \left(z \leq 4.5 \cdot 10^{-63}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -4.09999999999999984e62 or 4.5e-63 < z Initial program 77.3%
associate-/l*95.2%
Simplified95.2%
Taylor expanded in z around inf 76.1%
if -4.09999999999999984e62 < z < 4.5e-63Initial program 95.9%
associate-/l*95.1%
Simplified95.1%
Taylor expanded in z around 0 75.8%
associate-/l*76.5%
Simplified76.5%
Final simplification76.3%
(FPCore (x y z t a) :precision binary64 (if (<= a -4.2e+181) x (if (<= a 6.8e+140) (+ t x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.2e+181) {
tmp = x;
} else if (a <= 6.8e+140) {
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 (a <= (-4.2d+181)) then
tmp = x
else if (a <= 6.8d+140) 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 (a <= -4.2e+181) {
tmp = x;
} else if (a <= 6.8e+140) {
tmp = t + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -4.2e+181: tmp = x elif a <= 6.8e+140: tmp = t + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4.2e+181) tmp = x; elseif (a <= 6.8e+140) tmp = Float64(t + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -4.2e+181) tmp = x; elseif (a <= 6.8e+140) tmp = t + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.2e+181], x, If[LessEqual[a, 6.8e+140], N[(t + x), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.2 \cdot 10^{+181}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 6.8 \cdot 10^{+140}:\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -4.19999999999999995e181 or 6.8e140 < a Initial program 82.5%
associate-/l*97.6%
Simplified97.6%
Taylor expanded in x around inf 68.2%
if -4.19999999999999995e181 < a < 6.8e140Initial program 86.9%
associate-/l*94.4%
Simplified94.4%
Taylor expanded in z around inf 64.7%
Final simplification65.5%
(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 85.9%
associate-/l*95.1%
Simplified95.1%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 85.9%
associate-/l*95.1%
Simplified95.1%
Taylor expanded in x around inf 49.3%
(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 2024158
(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))))