
(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 (or (<= t_1 (- INFINITY)) (not (<= t_1 5e+214)))
(+ x (/ (- y z) (/ (- a z) t)))
(+ 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 <= 5e+214)) {
tmp = x + ((y - z) / ((a - z) / t));
} 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 <= 5e+214)) {
tmp = x + ((y - z) / ((a - z) / t));
} 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 <= 5e+214): tmp = x + ((y - z) / ((a - z) / t)) 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 <= 5e+214)) tmp = Float64(x + Float64(Float64(y - z) / Float64(Float64(a - z) / t))); 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 <= 5e+214))) tmp = x + ((y - z) / ((a - z) / t)); 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, 5e+214]], $MachinePrecision]], N[(x + N[(N[(y - z), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / t), $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 5 \cdot 10^{+214}\right):\\
\;\;\;\;x + \frac{y - z}{\frac{a - z}{t}}\\
\mathbf{else}:\\
\;\;\;\;t\_1 + x\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -inf.0 or 4.99999999999999953e214 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 38.5%
associate-/l*99.8%
Simplified99.8%
clear-num99.6%
un-div-inv99.9%
Applied egg-rr99.9%
if -inf.0 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 4.99999999999999953e214Initial program 99.9%
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 1e+230)))
(- x (* (/ t (- a z)) (- z y)))
(+ 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 <= 1e+230)) {
tmp = x - ((t / (a - z)) * (z - y));
} 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 <= 1e+230)) {
tmp = x - ((t / (a - z)) * (z - y));
} 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 <= 1e+230): tmp = x - ((t / (a - z)) * (z - y)) 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 <= 1e+230)) tmp = Float64(x - Float64(Float64(t / Float64(a - z)) * Float64(z - y))); 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 <= 1e+230))) tmp = x - ((t / (a - z)) * (z - y)); 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, 1e+230]], $MachinePrecision]], N[(x - N[(N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(z - y), $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 10^{+230}\right):\\
\;\;\;\;x - \frac{t}{a - z} \cdot \left(z - y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + x\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -inf.0 or 1.0000000000000001e230 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 35.8%
associate-/l*99.8%
Simplified99.8%
if -inf.0 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 1.0000000000000001e230Initial program 99.9%
Final simplification99.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.2e+35) (not (<= z 5.4e+147))) (+ t x) (- x (/ (* y t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.2e+35) || !(z <= 5.4e+147)) {
tmp = t + x;
} else {
tmp = x - ((y * 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 ((z <= (-3.2d+35)) .or. (.not. (z <= 5.4d+147))) then
tmp = t + x
else
tmp = x - ((y * 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 ((z <= -3.2e+35) || !(z <= 5.4e+147)) {
tmp = t + x;
} else {
tmp = x - ((y * t) / (z - a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.2e+35) or not (z <= 5.4e+147): tmp = t + x else: tmp = x - ((y * t) / (z - a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.2e+35) || !(z <= 5.4e+147)) tmp = Float64(t + x); else tmp = Float64(x - Float64(Float64(y * t) / Float64(z - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.2e+35) || ~((z <= 5.4e+147))) tmp = t + x; else tmp = x - ((y * t) / (z - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.2e+35], N[Not[LessEqual[z, 5.4e+147]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(x - N[(N[(y * t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+35} \lor \neg \left(z \leq 5.4 \cdot 10^{+147}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot t}{z - a}\\
\end{array}
\end{array}
if z < -3.19999999999999983e35 or 5.39999999999999995e147 < z Initial program 69.7%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in z around inf 87.2%
if -3.19999999999999983e35 < z < 5.39999999999999995e147Initial program 97.7%
associate-/l*95.6%
Simplified95.6%
Taylor expanded in y around inf 88.0%
Final simplification87.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.12e-10) (not (<= z 5.5e+147))) (+ x (* t (/ z (- z a)))) (- x (/ (* y t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.12e-10) || !(z <= 5.5e+147)) {
tmp = x + (t * (z / (z - a)));
} else {
tmp = x - ((y * 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 ((z <= (-1.12d-10)) .or. (.not. (z <= 5.5d+147))) then
tmp = x + (t * (z / (z - a)))
else
tmp = x - ((y * 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 ((z <= -1.12e-10) || !(z <= 5.5e+147)) {
tmp = x + (t * (z / (z - a)));
} else {
tmp = x - ((y * t) / (z - a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.12e-10) or not (z <= 5.5e+147): tmp = x + (t * (z / (z - a))) else: tmp = x - ((y * t) / (z - a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.12e-10) || !(z <= 5.5e+147)) tmp = Float64(x + Float64(t * Float64(z / Float64(z - a)))); else tmp = Float64(x - Float64(Float64(y * t) / Float64(z - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.12e-10) || ~((z <= 5.5e+147))) tmp = x + (t * (z / (z - a))); else tmp = x - ((y * t) / (z - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.12e-10], N[Not[LessEqual[z, 5.5e+147]], $MachinePrecision]], N[(x + N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.12 \cdot 10^{-10} \lor \neg \left(z \leq 5.5 \cdot 10^{+147}\right):\\
\;\;\;\;x + t \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot t}{z - a}\\
\end{array}
\end{array}
if z < -1.12e-10 or 5.4999999999999997e147 < z Initial program 73.1%
associate-/l*97.6%
Simplified97.6%
Taylor expanded in y around 0 65.6%
mul-1-neg65.6%
unsub-neg65.6%
associate-/l*86.1%
Simplified86.1%
if -1.12e-10 < z < 5.4999999999999997e147Initial program 98.1%
associate-/l*95.2%
Simplified95.2%
Taylor expanded in y around inf 89.7%
Final simplification88.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.55e-33) (not (<= z 9.8e-32))) (+ x (* t (/ (- z y) z))) (- x (/ (* y t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.55e-33) || !(z <= 9.8e-32)) {
tmp = x + (t * ((z - y) / z));
} else {
tmp = x - ((y * 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 ((z <= (-1.55d-33)) .or. (.not. (z <= 9.8d-32))) then
tmp = x + (t * ((z - y) / z))
else
tmp = x - ((y * 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 ((z <= -1.55e-33) || !(z <= 9.8e-32)) {
tmp = x + (t * ((z - y) / z));
} else {
tmp = x - ((y * t) / (z - a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.55e-33) or not (z <= 9.8e-32): tmp = x + (t * ((z - y) / z)) else: tmp = x - ((y * t) / (z - a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.55e-33) || !(z <= 9.8e-32)) tmp = Float64(x + Float64(t * Float64(Float64(z - y) / z))); else tmp = Float64(x - Float64(Float64(y * t) / Float64(z - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.55e-33) || ~((z <= 9.8e-32))) tmp = x + (t * ((z - y) / z)); else tmp = x - ((y * t) / (z - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.55e-33], N[Not[LessEqual[z, 9.8e-32]], $MachinePrecision]], N[(x + N[(t * N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{-33} \lor \neg \left(z \leq 9.8 \cdot 10^{-32}\right):\\
\;\;\;\;x + t \cdot \frac{z - y}{z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot t}{z - a}\\
\end{array}
\end{array}
if z < -1.54999999999999998e-33 or 9.7999999999999996e-32 < z Initial program 79.5%
associate-/l*96.3%
Simplified96.3%
Taylor expanded in a around 0 71.9%
mul-1-neg71.9%
unsub-neg71.9%
associate-/l*90.0%
Simplified90.0%
if -1.54999999999999998e-33 < z < 9.7999999999999996e-32Initial program 99.0%
associate-/l*95.9%
Simplified95.9%
Taylor expanded in y around inf 92.7%
Final simplification91.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.4e-34) (not (<= z 9.8e-32))) (+ t x) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.4e-34) || !(z <= 9.8e-32)) {
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 <= (-7.4d-34)) .or. (.not. (z <= 9.8d-32))) 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 <= -7.4e-34) || !(z <= 9.8e-32)) {
tmp = t + x;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.4e-34) or not (z <= 9.8e-32): tmp = t + x else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.4e-34) || !(z <= 9.8e-32)) 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 <= -7.4e-34) || ~((z <= 9.8e-32))) tmp = t + x; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.4e-34], N[Not[LessEqual[z, 9.8e-32]], $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 -7.4 \cdot 10^{-34} \lor \neg \left(z \leq 9.8 \cdot 10^{-32}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -7.39999999999999976e-34 or 9.7999999999999996e-32 < z Initial program 79.5%
associate-/l*96.3%
Simplified96.3%
Taylor expanded in z around inf 76.9%
if -7.39999999999999976e-34 < z < 9.7999999999999996e-32Initial program 99.0%
associate-/l*95.9%
Simplified95.9%
Taylor expanded in z around 0 82.3%
*-commutative82.3%
associate-/l*80.6%
Simplified80.6%
Final simplification78.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.55e-33) (not (<= z 4.9e-33))) (+ t x) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.55e-33) || !(z <= 4.9e-33)) {
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 <= (-1.55d-33)) .or. (.not. (z <= 4.9d-33))) 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 <= -1.55e-33) || !(z <= 4.9e-33)) {
tmp = t + x;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.55e-33) or not (z <= 4.9e-33): tmp = t + x else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.55e-33) || !(z <= 4.9e-33)) 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 <= -1.55e-33) || ~((z <= 4.9e-33))) tmp = t + x; else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.55e-33], N[Not[LessEqual[z, 4.9e-33]], $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 -1.55 \cdot 10^{-33} \lor \neg \left(z \leq 4.9 \cdot 10^{-33}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -1.54999999999999998e-33 or 4.8999999999999998e-33 < z Initial program 79.5%
associate-/l*96.3%
Simplified96.3%
Taylor expanded in z around inf 76.9%
if -1.54999999999999998e-33 < z < 4.8999999999999998e-33Initial program 99.0%
associate-/l*95.9%
Simplified95.9%
Taylor expanded in z around 0 82.3%
Final simplification79.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.6e-43) (not (<= z 2.7e-33))) (+ t x) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.6e-43) || !(z <= 2.7e-33)) {
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 <= (-5.6d-43)) .or. (.not. (z <= 2.7d-33))) 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 <= -5.6e-43) || !(z <= 2.7e-33)) {
tmp = t + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.6e-43) or not (z <= 2.7e-33): tmp = t + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.6e-43) || !(z <= 2.7e-33)) 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 <= -5.6e-43) || ~((z <= 2.7e-33))) tmp = t + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.6e-43], N[Not[LessEqual[z, 2.7e-33]], $MachinePrecision]], N[(t + x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{-43} \lor \neg \left(z \leq 2.7 \cdot 10^{-33}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -5.5999999999999996e-43 or 2.7000000000000001e-33 < z Initial program 79.9%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in z around inf 76.0%
if -5.5999999999999996e-43 < z < 2.7000000000000001e-33Initial program 99.0%
associate-/l*95.8%
Simplified95.8%
Taylor expanded in x around inf 60.0%
Final simplification68.7%
(FPCore (x y z t a) :precision binary64 (if (<= t -9.5e+52) t (if (<= t 4.4e+106) x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -9.5e+52) {
tmp = t;
} else if (t <= 4.4e+106) {
tmp = x;
} else {
tmp = 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 (t <= (-9.5d+52)) then
tmp = t
else if (t <= 4.4d+106) then
tmp = x
else
tmp = t
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+52) {
tmp = t;
} else if (t <= 4.4e+106) {
tmp = x;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -9.5e+52: tmp = t elif t <= 4.4e+106: tmp = x else: tmp = t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -9.5e+52) tmp = t; elseif (t <= 4.4e+106) tmp = x; else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -9.5e+52) tmp = t; elseif (t <= 4.4e+106) tmp = x; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -9.5e+52], t, If[LessEqual[t, 4.4e+106], x, t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.5 \cdot 10^{+52}:\\
\;\;\;\;t\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{+106}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if t < -9.49999999999999994e52 or 4.39999999999999983e106 < t Initial program 66.5%
associate-/l*93.2%
Simplified93.2%
clear-num93.0%
un-div-inv93.2%
Applied egg-rr93.2%
Taylor expanded in a around 0 33.5%
mul-1-neg33.5%
*-commutative33.5%
associate-*r/57.4%
sub-neg57.4%
Simplified57.4%
Taylor expanded in t around inf 56.5%
Taylor expanded in y around 0 38.7%
if -9.49999999999999994e52 < t < 4.39999999999999983e106Initial program 99.4%
associate-/l*97.5%
Simplified97.5%
Taylor expanded in x around inf 70.9%
Final simplification60.3%
(FPCore (x y z t a) :precision binary64 (- x (* (/ t (- a z)) (- z y))))
double code(double x, double y, double z, double t, double a) {
return x - ((t / (a - z)) * (z - y));
}
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 / (a - z)) * (z - y))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((t / (a - z)) * (z - y));
}
def code(x, y, z, t, a): return x - ((t / (a - z)) * (z - y))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(t / Float64(a - z)) * Float64(z - y))) end
function tmp = code(x, y, z, t, a) tmp = x - ((t / (a - z)) * (z - y)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{t}{a - z} \cdot \left(z - y\right)
\end{array}
Initial program 88.6%
associate-/l*96.1%
Simplified96.1%
Final simplification96.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 88.6%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in x around inf 53.0%
Final simplification53.0%
(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 2024053
(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))))