
(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 (+ x (* (/ (- y z) (- a z)) t)))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) / (a - z)) * 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 = x + (((y - z) / (a - z)) * t)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) / (a - z)) * t);
}
def code(x, y, z, t, a): return x + (((y - z) / (a - z)) * t)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) / Float64(a - z)) * t)) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) / (a - z)) * t); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y - z}{a - z} \cdot t
\end{array}
Initial program 85.6%
associate-*l/98.0%
Simplified98.0%
Final simplification98.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (/ t (/ z y)))))
(if (<= z -7e+183)
(+ x t)
(if (<= z -25000000000000.0)
t_1
(if (<= z 4.8e-66)
(+ x (/ y (/ a t)))
(if (<= z 4200.0)
(- t (* y (/ t z)))
(if (<= z 1.85e+50)
(+ x (/ t (/ a y)))
(if (<= z 5e+123) t_1 (+ x t)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (t / (z / y));
double tmp;
if (z <= -7e+183) {
tmp = x + t;
} else if (z <= -25000000000000.0) {
tmp = t_1;
} else if (z <= 4.8e-66) {
tmp = x + (y / (a / t));
} else if (z <= 4200.0) {
tmp = t - (y * (t / z));
} else if (z <= 1.85e+50) {
tmp = x + (t / (a / y));
} else if (z <= 5e+123) {
tmp = t_1;
} else {
tmp = x + t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x - (t / (z / y))
if (z <= (-7d+183)) then
tmp = x + t
else if (z <= (-25000000000000.0d0)) then
tmp = t_1
else if (z <= 4.8d-66) then
tmp = x + (y / (a / t))
else if (z <= 4200.0d0) then
tmp = t - (y * (t / z))
else if (z <= 1.85d+50) then
tmp = x + (t / (a / y))
else if (z <= 5d+123) then
tmp = t_1
else
tmp = x + t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x - (t / (z / y));
double tmp;
if (z <= -7e+183) {
tmp = x + t;
} else if (z <= -25000000000000.0) {
tmp = t_1;
} else if (z <= 4.8e-66) {
tmp = x + (y / (a / t));
} else if (z <= 4200.0) {
tmp = t - (y * (t / z));
} else if (z <= 1.85e+50) {
tmp = x + (t / (a / y));
} else if (z <= 5e+123) {
tmp = t_1;
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (t / (z / y)) tmp = 0 if z <= -7e+183: tmp = x + t elif z <= -25000000000000.0: tmp = t_1 elif z <= 4.8e-66: tmp = x + (y / (a / t)) elif z <= 4200.0: tmp = t - (y * (t / z)) elif z <= 1.85e+50: tmp = x + (t / (a / y)) elif z <= 5e+123: tmp = t_1 else: tmp = x + t return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(t / Float64(z / y))) tmp = 0.0 if (z <= -7e+183) tmp = Float64(x + t); elseif (z <= -25000000000000.0) tmp = t_1; elseif (z <= 4.8e-66) tmp = Float64(x + Float64(y / Float64(a / t))); elseif (z <= 4200.0) tmp = Float64(t - Float64(y * Float64(t / z))); elseif (z <= 1.85e+50) tmp = Float64(x + Float64(t / Float64(a / y))); elseif (z <= 5e+123) tmp = t_1; else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (t / (z / y)); tmp = 0.0; if (z <= -7e+183) tmp = x + t; elseif (z <= -25000000000000.0) tmp = t_1; elseif (z <= 4.8e-66) tmp = x + (y / (a / t)); elseif (z <= 4200.0) tmp = t - (y * (t / z)); elseif (z <= 1.85e+50) tmp = x + (t / (a / y)); elseif (z <= 5e+123) tmp = t_1; else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(t / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7e+183], N[(x + t), $MachinePrecision], If[LessEqual[z, -25000000000000.0], t$95$1, If[LessEqual[z, 4.8e-66], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4200.0], N[(t - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.85e+50], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5e+123], t$95$1, N[(x + t), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \frac{t}{\frac{z}{y}}\\
\mathbf{if}\;z \leq -7 \cdot 10^{+183}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq -25000000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-66}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;z \leq 4200:\\
\;\;\;\;t - y \cdot \frac{t}{z}\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{+50}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;z \leq 5 \cdot 10^{+123}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -6.99999999999999974e183 or 4.99999999999999974e123 < z Initial program 62.5%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 84.1%
if -6.99999999999999974e183 < z < -2.5e13 or 1.85e50 < z < 4.99999999999999974e123Initial program 87.3%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in a around 0 74.1%
+-commutative74.1%
mul-1-neg74.1%
unsub-neg74.1%
associate-/l*81.8%
Simplified81.8%
Taylor expanded in z around 0 72.3%
if -2.5e13 < z < 4.80000000000000052e-66Initial program 93.1%
associate-*l/96.0%
Simplified96.0%
Taylor expanded in z around 0 81.4%
associate-/l*86.0%
Simplified86.0%
if 4.80000000000000052e-66 < z < 4200Initial program 99.9%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in a around 0 90.5%
+-commutative90.5%
mul-1-neg90.5%
unsub-neg90.5%
associate-/l*90.5%
Simplified90.5%
Taylor expanded in z around 0 90.5%
associate-*l/90.5%
+-commutative90.5%
neg-mul-190.5%
unsub-neg90.5%
Simplified90.5%
Taylor expanded in x around 0 83.2%
associate-*r/83.2%
Simplified83.2%
if 4200 < z < 1.85e50Initial program 89.4%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around 0 58.2%
*-commutative58.2%
associate-/l*68.6%
Simplified68.6%
Final simplification81.7%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.1e+90)
(+ x t)
(if (<= z 1.8e-65)
(+ x (/ y (/ a t)))
(if (<= z 4200.0)
(- t (* y (/ t z)))
(if (<= z 9.8e+123) (+ x (/ t (/ a y))) (+ x t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.1e+90) {
tmp = x + t;
} else if (z <= 1.8e-65) {
tmp = x + (y / (a / t));
} else if (z <= 4200.0) {
tmp = t - (y * (t / z));
} else if (z <= 9.8e+123) {
tmp = x + (t / (a / y));
} else {
tmp = x + t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-3.1d+90)) then
tmp = x + t
else if (z <= 1.8d-65) then
tmp = x + (y / (a / t))
else if (z <= 4200.0d0) then
tmp = t - (y * (t / z))
else if (z <= 9.8d+123) then
tmp = x + (t / (a / y))
else
tmp = x + t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.1e+90) {
tmp = x + t;
} else if (z <= 1.8e-65) {
tmp = x + (y / (a / t));
} else if (z <= 4200.0) {
tmp = t - (y * (t / z));
} else if (z <= 9.8e+123) {
tmp = x + (t / (a / y));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.1e+90: tmp = x + t elif z <= 1.8e-65: tmp = x + (y / (a / t)) elif z <= 4200.0: tmp = t - (y * (t / z)) elif z <= 9.8e+123: tmp = x + (t / (a / y)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.1e+90) tmp = Float64(x + t); elseif (z <= 1.8e-65) tmp = Float64(x + Float64(y / Float64(a / t))); elseif (z <= 4200.0) tmp = Float64(t - Float64(y * Float64(t / z))); elseif (z <= 9.8e+123) tmp = Float64(x + Float64(t / Float64(a / y))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.1e+90) tmp = x + t; elseif (z <= 1.8e-65) tmp = x + (y / (a / t)); elseif (z <= 4200.0) tmp = t - (y * (t / z)); elseif (z <= 9.8e+123) tmp = x + (t / (a / y)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.1e+90], N[(x + t), $MachinePrecision], If[LessEqual[z, 1.8e-65], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4200.0], N[(t - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.8e+123], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+90}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-65}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;z \leq 4200:\\
\;\;\;\;t - y \cdot \frac{t}{z}\\
\mathbf{elif}\;z \leq 9.8 \cdot 10^{+123}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -3.09999999999999988e90 or 9.79999999999999952e123 < z Initial program 69.0%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 77.2%
if -3.09999999999999988e90 < z < 1.7999999999999999e-65Initial program 92.7%
associate-*l/96.5%
Simplified96.5%
Taylor expanded in z around 0 77.3%
associate-/l*81.2%
Simplified81.2%
if 1.7999999999999999e-65 < z < 4200Initial program 99.9%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in a around 0 90.5%
+-commutative90.5%
mul-1-neg90.5%
unsub-neg90.5%
associate-/l*90.5%
Simplified90.5%
Taylor expanded in z around 0 90.5%
associate-*l/90.5%
+-commutative90.5%
neg-mul-190.5%
unsub-neg90.5%
Simplified90.5%
Taylor expanded in x around 0 83.2%
associate-*r/83.2%
Simplified83.2%
if 4200 < z < 9.79999999999999952e123Initial program 91.7%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around 0 58.3%
*-commutative58.3%
associate-/l*66.5%
Simplified66.5%
Final simplification78.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.7e+110) (not (<= z 2.5e-86))) (+ x (- t (* t (/ y z)))) (+ x (* t (/ y (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.7e+110) || !(z <= 2.5e-86)) {
tmp = x + (t - (t * (y / z)));
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.7d+110)) .or. (.not. (z <= 2.5d-86))) then
tmp = x + (t - (t * (y / z)))
else
tmp = x + (t * (y / (a - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.7e+110) || !(z <= 2.5e-86)) {
tmp = x + (t - (t * (y / z)));
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.7e+110) or not (z <= 2.5e-86): tmp = x + (t - (t * (y / z))) else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.7e+110) || !(z <= 2.5e-86)) tmp = Float64(x + Float64(t - Float64(t * Float64(y / z)))); else tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.7e+110) || ~((z <= 2.5e-86))) tmp = x + (t - (t * (y / z))); else tmp = x + (t * (y / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.7e+110], N[Not[LessEqual[z, 2.5e-86]], $MachinePrecision]], N[(x + N[(t - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+110} \lor \neg \left(z \leq 2.5 \cdot 10^{-86}\right):\\
\;\;\;\;x + \left(t - t \cdot \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if z < -1.7000000000000001e110 or 2.4999999999999999e-86 < z Initial program 78.3%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in a around 0 72.9%
+-commutative72.9%
mul-1-neg72.9%
unsub-neg72.9%
associate-/l*90.5%
Simplified90.5%
Taylor expanded in z around 0 83.6%
associate-*l/90.4%
+-commutative90.4%
neg-mul-190.4%
unsub-neg90.4%
Simplified90.4%
if -1.7000000000000001e110 < z < 2.4999999999999999e-86Initial program 91.4%
associate-*l/96.6%
Simplified96.6%
Taylor expanded in y around inf 88.0%
Final simplification89.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -3600000000.0) (not (<= y 3.2e-120))) (+ x (* t (/ y (- a z)))) (- x (/ t (+ (/ a z) -1.0)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -3600000000.0) || !(y <= 3.2e-120)) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x - (t / ((a / z) + -1.0));
}
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 <= (-3600000000.0d0)) .or. (.not. (y <= 3.2d-120))) then
tmp = x + (t * (y / (a - z)))
else
tmp = x - (t / ((a / z) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -3600000000.0) || !(y <= 3.2e-120)) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x - (t / ((a / z) + -1.0));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -3600000000.0) or not (y <= 3.2e-120): tmp = x + (t * (y / (a - z))) else: tmp = x - (t / ((a / z) + -1.0)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -3600000000.0) || !(y <= 3.2e-120)) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); else tmp = Float64(x - Float64(t / Float64(Float64(a / z) + -1.0))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -3600000000.0) || ~((y <= 3.2e-120))) tmp = x + (t * (y / (a - z))); else tmp = x - (t / ((a / z) + -1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -3600000000.0], N[Not[LessEqual[y, 3.2e-120]], $MachinePrecision]], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t / N[(N[(a / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3600000000 \lor \neg \left(y \leq 3.2 \cdot 10^{-120}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{t}{\frac{a}{z} + -1}\\
\end{array}
\end{array}
if y < -3.6e9 or 3.1999999999999999e-120 < y Initial program 82.7%
associate-*l/96.9%
Simplified96.9%
Taylor expanded in y around inf 86.2%
if -3.6e9 < y < 3.1999999999999999e-120Initial program 90.4%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around 0 84.4%
+-commutative84.4%
mul-1-neg84.4%
unsub-neg84.4%
associate-/l*93.9%
div-sub93.9%
*-inverses93.9%
Simplified93.9%
Final simplification89.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.7e+184) (+ x t) (if (<= z 1.52e+124) (+ x (* t (/ y (- a z)))) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.7e+184) {
tmp = x + t;
} else if (z <= 1.52e+124) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2.7d+184)) then
tmp = x + t
else if (z <= 1.52d+124) then
tmp = x + (t * (y / (a - z)))
else
tmp = x + t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.7e+184) {
tmp = x + t;
} else if (z <= 1.52e+124) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.7e+184: tmp = x + t elif z <= 1.52e+124: tmp = x + (t * (y / (a - z))) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.7e+184) tmp = Float64(x + t); elseif (z <= 1.52e+124) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.7e+184) tmp = x + t; elseif (z <= 1.52e+124) tmp = x + (t * (y / (a - z))); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.7e+184], N[(x + t), $MachinePrecision], If[LessEqual[z, 1.52e+124], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+184}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 1.52 \cdot 10^{+124}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -2.6999999999999999e184 or 1.51999999999999998e124 < z Initial program 63.6%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 85.6%
if -2.6999999999999999e184 < z < 1.51999999999999998e124Initial program 91.3%
associate-*l/97.6%
Simplified97.6%
Taylor expanded in y around inf 84.9%
Final simplification85.0%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.02e-159) (+ x t) (if (<= t 7.2e+52) x (if (<= t 9e+197) (+ x t) (* (/ t z) (- y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.02e-159) {
tmp = x + t;
} else if (t <= 7.2e+52) {
tmp = x;
} else if (t <= 9e+197) {
tmp = x + t;
} else {
tmp = (t / z) * -y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-1.02d-159)) then
tmp = x + t
else if (t <= 7.2d+52) then
tmp = x
else if (t <= 9d+197) then
tmp = x + t
else
tmp = (t / z) * -y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.02e-159) {
tmp = x + t;
} else if (t <= 7.2e+52) {
tmp = x;
} else if (t <= 9e+197) {
tmp = x + t;
} else {
tmp = (t / z) * -y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.02e-159: tmp = x + t elif t <= 7.2e+52: tmp = x elif t <= 9e+197: tmp = x + t else: tmp = (t / z) * -y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.02e-159) tmp = Float64(x + t); elseif (t <= 7.2e+52) tmp = x; elseif (t <= 9e+197) tmp = Float64(x + t); else tmp = Float64(Float64(t / z) * Float64(-y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.02e-159) tmp = x + t; elseif (t <= 7.2e+52) tmp = x; elseif (t <= 9e+197) tmp = x + t; else tmp = (t / z) * -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.02e-159], N[(x + t), $MachinePrecision], If[LessEqual[t, 7.2e+52], x, If[LessEqual[t, 9e+197], N[(x + t), $MachinePrecision], N[(N[(t / z), $MachinePrecision] * (-y)), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.02 \cdot 10^{-159}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{+52}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 9 \cdot 10^{+197}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{z} \cdot \left(-y\right)\\
\end{array}
\end{array}
if t < -1.02e-159 or 7.2e52 < t < 9.0000000000000006e197Initial program 75.3%
associate-*l/98.3%
Simplified98.3%
Taylor expanded in z around inf 54.9%
if -1.02e-159 < t < 7.2e52Initial program 99.0%
associate-*l/97.1%
Simplified97.1%
Taylor expanded in x around inf 75.2%
if 9.0000000000000006e197 < t Initial program 84.9%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in a around 0 62.9%
+-commutative62.9%
mul-1-neg62.9%
unsub-neg62.9%
associate-/l*62.9%
Simplified62.9%
Taylor expanded in z around 0 62.7%
associate-*l/62.9%
+-commutative62.9%
neg-mul-162.9%
unsub-neg62.9%
Simplified62.9%
Taylor expanded in y around inf 56.5%
mul-1-neg56.5%
associate-*r/56.8%
distribute-rgt-neg-in56.8%
distribute-neg-frac56.8%
Simplified56.8%
Final simplification63.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.3e+91) (not (<= z 1.22e+124))) (+ x t) (+ x (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.3e+91) || !(z <= 1.22e+124)) {
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 <= (-1.3d+91)) .or. (.not. (z <= 1.22d+124))) 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 <= -1.3e+91) || !(z <= 1.22e+124)) {
tmp = x + t;
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.3e+91) or not (z <= 1.22e+124): tmp = x + t else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.3e+91) || !(z <= 1.22e+124)) 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 <= -1.3e+91) || ~((z <= 1.22e+124))) tmp = x + t; else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.3e+91], N[Not[LessEqual[z, 1.22e+124]], $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 -1.3 \cdot 10^{+91} \lor \neg \left(z \leq 1.22 \cdot 10^{+124}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -1.3e91 or 1.22e124 < z Initial program 68.6%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 78.0%
if -1.3e91 < z < 1.22e124Initial program 93.1%
associate-*l/97.2%
Simplified97.2%
Taylor expanded in z around 0 71.0%
*-commutative71.0%
associate-/l*74.1%
Simplified74.1%
Final simplification75.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.45e+91) (+ x t) (if (<= z 1.06e+124) (+ x (/ y (/ a t))) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.45e+91) {
tmp = x + t;
} else if (z <= 1.06e+124) {
tmp = x + (y / (a / t));
} else {
tmp = x + t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.45d+91)) then
tmp = x + t
else if (z <= 1.06d+124) then
tmp = x + (y / (a / t))
else
tmp = x + t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.45e+91) {
tmp = x + t;
} else if (z <= 1.06e+124) {
tmp = x + (y / (a / t));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.45e+91: tmp = x + t elif z <= 1.06e+124: tmp = x + (y / (a / t)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.45e+91) tmp = Float64(x + t); elseif (z <= 1.06e+124) tmp = Float64(x + Float64(y / Float64(a / t))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.45e+91) tmp = x + t; elseif (z <= 1.06e+124) tmp = x + (y / (a / t)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.45e+91], N[(x + t), $MachinePrecision], If[LessEqual[z, 1.06e+124], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{+91}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 1.06 \cdot 10^{+124}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -1.45000000000000007e91 or 1.06e124 < z Initial program 68.6%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 78.0%
if -1.45000000000000007e91 < z < 1.06e124Initial program 93.1%
associate-*l/97.2%
Simplified97.2%
Taylor expanded in z around 0 71.0%
associate-/l*74.8%
Simplified74.8%
Final simplification75.8%
(FPCore (x y z t a) :precision binary64 (if (<= a 3.2e+149) (+ x t) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 3.2e+149) {
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 <= 3.2d+149) 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 <= 3.2e+149) {
tmp = x + t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 3.2e+149: tmp = x + t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 3.2e+149) 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 <= 3.2e+149) tmp = x + t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 3.2e+149], N[(x + t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.2 \cdot 10^{+149}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < 3.2000000000000002e149Initial program 86.9%
associate-*l/97.8%
Simplified97.8%
Taylor expanded in z around inf 57.5%
if 3.2000000000000002e149 < a Initial program 76.7%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in x around inf 64.1%
Final simplification58.3%
(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.6%
associate-*l/98.0%
Simplified98.0%
Taylor expanded in x around inf 47.1%
Final simplification47.1%
(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 2023268
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(if (< t -1.0682974490174067e-39) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t))))
(+ x (/ (* (- y z) t) (- a z))))