
(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 9 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 88.2%
associate-*l/98.5%
Simplified98.5%
Final simplification98.5%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.25e+128)
(+ x t)
(if (<= z -1.22e-82)
(- x (/ t (/ z y)))
(if (<= z 6.5e-34) (+ x (/ y (/ a t))) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.25e+128) {
tmp = x + t;
} else if (z <= -1.22e-82) {
tmp = x - (t / (z / y));
} else if (z <= 6.5e-34) {
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 <= (-2.25d+128)) then
tmp = x + t
else if (z <= (-1.22d-82)) then
tmp = x - (t / (z / y))
else if (z <= 6.5d-34) 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 <= -2.25e+128) {
tmp = x + t;
} else if (z <= -1.22e-82) {
tmp = x - (t / (z / y));
} else if (z <= 6.5e-34) {
tmp = x + (y / (a / t));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.25e+128: tmp = x + t elif z <= -1.22e-82: tmp = x - (t / (z / y)) elif z <= 6.5e-34: tmp = x + (y / (a / t)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.25e+128) tmp = Float64(x + t); elseif (z <= -1.22e-82) tmp = Float64(x - Float64(t / Float64(z / y))); elseif (z <= 6.5e-34) 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 <= -2.25e+128) tmp = x + t; elseif (z <= -1.22e-82) tmp = x - (t / (z / y)); elseif (z <= 6.5e-34) tmp = x + (y / (a / t)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.25e+128], N[(x + t), $MachinePrecision], If[LessEqual[z, -1.22e-82], N[(x - N[(t / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5e-34], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.25 \cdot 10^{+128}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq -1.22 \cdot 10^{-82}:\\
\;\;\;\;x - \frac{t}{\frac{z}{y}}\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-34}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -2.2500000000000001e128 or 6.49999999999999985e-34 < z Initial program 74.8%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 80.5%
if -2.2500000000000001e128 < z < -1.22000000000000001e-82Initial program 97.8%
+-commutative97.8%
associate-*r/98.2%
fma-def98.2%
Simplified98.2%
Taylor expanded in a around 0 73.6%
+-commutative73.6%
mul-1-neg73.6%
unsub-neg73.6%
associate-/l*73.7%
Simplified73.7%
Taylor expanded in z around 0 72.1%
*-commutative72.1%
associate-/l*72.2%
Simplified72.2%
if -1.22000000000000001e-82 < z < 6.49999999999999985e-34Initial program 99.0%
+-commutative99.0%
associate-*r/98.9%
fma-def98.9%
Simplified98.9%
Taylor expanded in z around 0 84.1%
associate-/l*85.1%
Simplified85.1%
Final simplification80.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.62e-34) (not (<= z 3e-212))) (+ x (* t (/ z (- z a)))) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.62e-34) || !(z <= 3e-212)) {
tmp = x + (t * (z / (z - a)));
} 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 <= (-1.62d-34)) .or. (.not. (z <= 3d-212))) then
tmp = x + (t * (z / (z - a)))
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 <= -1.62e-34) || !(z <= 3e-212)) {
tmp = x + (t * (z / (z - a)));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.62e-34) or not (z <= 3e-212): tmp = x + (t * (z / (z - a))) else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.62e-34) || !(z <= 3e-212)) tmp = Float64(x + Float64(t * Float64(z / Float64(z - a)))); 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 <= -1.62e-34) || ~((z <= 3e-212))) tmp = x + (t * (z / (z - a))); else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.62e-34], N[Not[LessEqual[z, 3e-212]], $MachinePrecision]], N[(x + N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.62 \cdot 10^{-34} \lor \neg \left(z \leq 3 \cdot 10^{-212}\right):\\
\;\;\;\;x + t \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -1.62000000000000006e-34 or 3.0000000000000003e-212 < z Initial program 84.0%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around 0 83.8%
neg-mul-183.8%
distribute-neg-frac83.8%
Simplified83.8%
frac-2neg83.8%
div-inv83.7%
remove-double-neg83.7%
sub-neg83.7%
distribute-neg-in83.7%
remove-double-neg83.7%
Applied egg-rr83.7%
associate-*r/83.8%
*-rgt-identity83.8%
+-commutative83.8%
unsub-neg83.8%
Simplified83.8%
if -1.62000000000000006e-34 < z < 3.0000000000000003e-212Initial program 98.7%
+-commutative98.7%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in z around 0 91.0%
associate-/l*92.2%
Simplified92.2%
Final simplification86.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.45e-55) (not (<= y 4.9e+67))) (+ x (/ (* y t) (- a z))) (+ x (* t (/ z (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.45e-55) || !(y <= 4.9e+67)) {
tmp = x + ((y * t) / (a - z));
} else {
tmp = x + (t * (z / (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.45d-55)) .or. (.not. (y <= 4.9d+67))) then
tmp = x + ((y * t) / (a - z))
else
tmp = x + (t * (z / (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.45e-55) || !(y <= 4.9e+67)) {
tmp = x + ((y * t) / (a - z));
} else {
tmp = x + (t * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.45e-55) or not (y <= 4.9e+67): tmp = x + ((y * t) / (a - z)) else: tmp = x + (t * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.45e-55) || !(y <= 4.9e+67)) tmp = Float64(x + Float64(Float64(y * t) / Float64(a - z))); else tmp = Float64(x + Float64(t * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1.45e-55) || ~((y <= 4.9e+67))) tmp = x + ((y * t) / (a - z)); else tmp = x + (t * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.45e-55], N[Not[LessEqual[y, 4.9e+67]], $MachinePrecision]], N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{-55} \lor \neg \left(y \leq 4.9 \cdot 10^{+67}\right):\\
\;\;\;\;x + \frac{y \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if y < -1.45e-55 or 4.8999999999999999e67 < y Initial program 89.6%
associate-*l/97.5%
Simplified97.5%
Taylor expanded in y around inf 85.4%
if -1.45e-55 < y < 4.8999999999999999e67Initial program 86.9%
associate-*l/99.3%
Simplified99.3%
Taylor expanded in y around 0 93.7%
neg-mul-193.7%
distribute-neg-frac93.7%
Simplified93.7%
frac-2neg93.7%
div-inv93.6%
remove-double-neg93.6%
sub-neg93.6%
distribute-neg-in93.6%
remove-double-neg93.6%
Applied egg-rr93.6%
associate-*r/93.7%
*-rgt-identity93.7%
+-commutative93.7%
unsub-neg93.7%
Simplified93.7%
Final simplification89.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -6.6e+31) (+ x (* t (/ z (- z a)))) (if (<= z 3.2e-65) (+ x (/ (* y t) (- a z))) (+ x (* (/ t z) (- z y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.6e+31) {
tmp = x + (t * (z / (z - a)));
} else if (z <= 3.2e-65) {
tmp = x + ((y * t) / (a - z));
} else {
tmp = x + ((t / z) * (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 (z <= (-6.6d+31)) then
tmp = x + (t * (z / (z - a)))
else if (z <= 3.2d-65) then
tmp = x + ((y * t) / (a - z))
else
tmp = x + ((t / z) * (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 (z <= -6.6e+31) {
tmp = x + (t * (z / (z - a)));
} else if (z <= 3.2e-65) {
tmp = x + ((y * t) / (a - z));
} else {
tmp = x + ((t / z) * (z - y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.6e+31: tmp = x + (t * (z / (z - a))) elif z <= 3.2e-65: tmp = x + ((y * t) / (a - z)) else: tmp = x + ((t / z) * (z - y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.6e+31) tmp = Float64(x + Float64(t * Float64(z / Float64(z - a)))); elseif (z <= 3.2e-65) tmp = Float64(x + Float64(Float64(y * t) / Float64(a - z))); else tmp = Float64(x + Float64(Float64(t / z) * Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6.6e+31) tmp = x + (t * (z / (z - a))); elseif (z <= 3.2e-65) tmp = x + ((y * t) / (a - z)); else tmp = x + ((t / z) * (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.6e+31], N[(x + N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.2e-65], N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t / z), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{+31}:\\
\;\;\;\;x + t \cdot \frac{z}{z - a}\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-65}:\\
\;\;\;\;x + \frac{y \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{z} \cdot \left(z - y\right)\\
\end{array}
\end{array}
if z < -6.59999999999999985e31Initial program 78.4%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around 0 92.9%
neg-mul-192.9%
distribute-neg-frac92.9%
Simplified92.9%
frac-2neg92.9%
div-inv92.8%
remove-double-neg92.8%
sub-neg92.8%
distribute-neg-in92.8%
remove-double-neg92.8%
Applied egg-rr92.8%
associate-*r/92.9%
*-rgt-identity92.9%
+-commutative92.9%
unsub-neg92.9%
Simplified92.9%
if -6.59999999999999985e31 < z < 3.1999999999999999e-65Initial program 99.1%
associate-*l/96.7%
Simplified96.7%
Taylor expanded in y around inf 91.9%
if 3.1999999999999999e-65 < z Initial program 80.0%
+-commutative80.0%
associate-*r/95.4%
fma-def95.4%
Simplified95.4%
Taylor expanded in a around 0 71.1%
+-commutative71.1%
mul-1-neg71.1%
unsub-neg71.1%
associate-/l*88.7%
Simplified88.7%
associate-/r/85.2%
Applied egg-rr85.2%
Final simplification89.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -5.5e+31) (+ x (* t (/ z (- z a)))) (if (<= z 2.3e-62) (+ x (/ (* y t) (- a z))) (+ x (- t (/ t (/ z y)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.5e+31) {
tmp = x + (t * (z / (z - a)));
} else if (z <= 2.3e-62) {
tmp = x + ((y * t) / (a - z));
} else {
tmp = x + (t - (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 (z <= (-5.5d+31)) then
tmp = x + (t * (z / (z - a)))
else if (z <= 2.3d-62) then
tmp = x + ((y * t) / (a - z))
else
tmp = x + (t - (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 (z <= -5.5e+31) {
tmp = x + (t * (z / (z - a)));
} else if (z <= 2.3e-62) {
tmp = x + ((y * t) / (a - z));
} else {
tmp = x + (t - (t / (z / y)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.5e+31: tmp = x + (t * (z / (z - a))) elif z <= 2.3e-62: tmp = x + ((y * t) / (a - z)) else: tmp = x + (t - (t / (z / y))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.5e+31) tmp = Float64(x + Float64(t * Float64(z / Float64(z - a)))); elseif (z <= 2.3e-62) tmp = Float64(x + Float64(Float64(y * t) / Float64(a - z))); else tmp = Float64(x + Float64(t - Float64(t / Float64(z / y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.5e+31) tmp = x + (t * (z / (z - a))); elseif (z <= 2.3e-62) tmp = x + ((y * t) / (a - z)); else tmp = x + (t - (t / (z / y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.5e+31], N[(x + N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.3e-62], N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t - N[(t / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+31}:\\
\;\;\;\;x + t \cdot \frac{z}{z - a}\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-62}:\\
\;\;\;\;x + \frac{y \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + \left(t - \frac{t}{\frac{z}{y}}\right)\\
\end{array}
\end{array}
if z < -5.50000000000000002e31Initial program 78.4%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around 0 92.9%
neg-mul-192.9%
distribute-neg-frac92.9%
Simplified92.9%
frac-2neg92.9%
div-inv92.8%
remove-double-neg92.8%
sub-neg92.8%
distribute-neg-in92.8%
remove-double-neg92.8%
Applied egg-rr92.8%
associate-*r/92.9%
*-rgt-identity92.9%
+-commutative92.9%
unsub-neg92.9%
Simplified92.9%
if -5.50000000000000002e31 < z < 2.3e-62Initial program 99.1%
associate-*l/96.7%
Simplified96.7%
Taylor expanded in y around inf 91.9%
if 2.3e-62 < z Initial program 80.0%
+-commutative80.0%
associate-*r/95.4%
fma-def95.4%
Simplified95.4%
Taylor expanded in a around 0 71.1%
+-commutative71.1%
mul-1-neg71.1%
unsub-neg71.1%
associate-/l*88.7%
Simplified88.7%
Taylor expanded in z around 0 83.1%
neg-mul-183.1%
+-commutative83.1%
unsub-neg83.1%
*-commutative83.1%
associate-/l*88.7%
Simplified88.7%
Final simplification91.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -4.1e+18) (+ x t) (if (<= z 5.1e-34) (+ x (/ y (/ a t))) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.1e+18) {
tmp = x + t;
} else if (z <= 5.1e-34) {
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 <= (-4.1d+18)) then
tmp = x + t
else if (z <= 5.1d-34) 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 <= -4.1e+18) {
tmp = x + t;
} else if (z <= 5.1e-34) {
tmp = x + (y / (a / t));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.1e+18: tmp = x + t elif z <= 5.1e-34: tmp = x + (y / (a / t)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.1e+18) tmp = Float64(x + t); elseif (z <= 5.1e-34) 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 <= -4.1e+18) tmp = x + t; elseif (z <= 5.1e-34) tmp = x + (y / (a / t)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.1e+18], N[(x + t), $MachinePrecision], If[LessEqual[z, 5.1e-34], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.1 \cdot 10^{+18}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 5.1 \cdot 10^{-34}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -4.1e18 or 5.1000000000000001e-34 < z Initial program 78.9%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 76.1%
if -4.1e18 < z < 5.1000000000000001e-34Initial program 99.1%
+-commutative99.1%
associate-*r/99.1%
fma-def99.1%
Simplified99.1%
Taylor expanded in z around 0 79.6%
associate-/l*80.4%
Simplified80.4%
Final simplification78.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -9e+141) x (+ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -9e+141) {
tmp = x;
} 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 (a <= (-9d+141)) then
tmp = x
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 (a <= -9e+141) {
tmp = x;
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -9e+141: tmp = x else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -9e+141) tmp = x; else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -9e+141) tmp = x; else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -9e+141], x, N[(x + t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9 \cdot 10^{+141}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if a < -9.0000000000000003e141Initial program 76.0%
+-commutative76.0%
associate-*r/97.4%
fma-def97.4%
Simplified97.4%
Taylor expanded in t around 0 73.0%
if -9.0000000000000003e141 < a Initial program 90.4%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in z around inf 65.1%
Final simplification66.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 88.2%
+-commutative88.2%
associate-*r/96.9%
fma-def96.9%
Simplified96.9%
Taylor expanded in t around 0 52.3%
Final simplification52.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 2023230
(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))))