
(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 8 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 86.4%
associate-*l/98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ t (/ (- a z) y)))) (t_2 (+ x (* (/ t z) (- z y)))))
(if (<= z -2.5e+106)
t_2
(if (<= z -10200000000000.0)
t_1
(if (<= z -9.4e-20)
t_2
(if (<= z -2e-265)
(+ x (* (- y z) (/ t a)))
(if (<= z 3.8e-16) t_1 (+ x t))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t / ((a - z) / y));
double t_2 = x + ((t / z) * (z - y));
double tmp;
if (z <= -2.5e+106) {
tmp = t_2;
} else if (z <= -10200000000000.0) {
tmp = t_1;
} else if (z <= -9.4e-20) {
tmp = t_2;
} else if (z <= -2e-265) {
tmp = x + ((y - z) * (t / a));
} else if (z <= 3.8e-16) {
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) :: t_2
real(8) :: tmp
t_1 = x + (t / ((a - z) / y))
t_2 = x + ((t / z) * (z - y))
if (z <= (-2.5d+106)) then
tmp = t_2
else if (z <= (-10200000000000.0d0)) then
tmp = t_1
else if (z <= (-9.4d-20)) then
tmp = t_2
else if (z <= (-2d-265)) then
tmp = x + ((y - z) * (t / a))
else if (z <= 3.8d-16) 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 / ((a - z) / y));
double t_2 = x + ((t / z) * (z - y));
double tmp;
if (z <= -2.5e+106) {
tmp = t_2;
} else if (z <= -10200000000000.0) {
tmp = t_1;
} else if (z <= -9.4e-20) {
tmp = t_2;
} else if (z <= -2e-265) {
tmp = x + ((y - z) * (t / a));
} else if (z <= 3.8e-16) {
tmp = t_1;
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (t / ((a - z) / y)) t_2 = x + ((t / z) * (z - y)) tmp = 0 if z <= -2.5e+106: tmp = t_2 elif z <= -10200000000000.0: tmp = t_1 elif z <= -9.4e-20: tmp = t_2 elif z <= -2e-265: tmp = x + ((y - z) * (t / a)) elif z <= 3.8e-16: tmp = t_1 else: tmp = x + t return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(t / Float64(Float64(a - z) / y))) t_2 = Float64(x + Float64(Float64(t / z) * Float64(z - y))) tmp = 0.0 if (z <= -2.5e+106) tmp = t_2; elseif (z <= -10200000000000.0) tmp = t_1; elseif (z <= -9.4e-20) tmp = t_2; elseif (z <= -2e-265) tmp = Float64(x + Float64(Float64(y - z) * Float64(t / a))); elseif (z <= 3.8e-16) 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 / ((a - z) / y)); t_2 = x + ((t / z) * (z - y)); tmp = 0.0; if (z <= -2.5e+106) tmp = t_2; elseif (z <= -10200000000000.0) tmp = t_1; elseif (z <= -9.4e-20) tmp = t_2; elseif (z <= -2e-265) tmp = x + ((y - z) * (t / a)); elseif (z <= 3.8e-16) 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[(N[(a - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(t / z), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.5e+106], t$95$2, If[LessEqual[z, -10200000000000.0], t$95$1, If[LessEqual[z, -9.4e-20], t$95$2, If[LessEqual[z, -2e-265], N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e-16], t$95$1, N[(x + t), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{t}{\frac{a - z}{y}}\\
t_2 := x + \frac{t}{z} \cdot \left(z - y\right)\\
\mathbf{if}\;z \leq -2.5 \cdot 10^{+106}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -10200000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -9.4 \cdot 10^{-20}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -2 \cdot 10^{-265}:\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-16}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -2.4999999999999999e106 or -1.02e13 < z < -9.4000000000000003e-20Initial program 76.3%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in a around 0 74.1%
mul-1-neg74.1%
unsub-neg74.1%
associate-/l*97.9%
associate-/r/95.7%
Simplified95.7%
if -2.4999999999999999e106 < z < -1.02e13 or -1.99999999999999997e-265 < z < 3.80000000000000012e-16Initial program 91.5%
associate-*l/98.0%
Simplified98.0%
Taylor expanded in y around inf 86.0%
associate-/l*89.7%
Simplified89.7%
if -9.4000000000000003e-20 < z < -1.99999999999999997e-265Initial program 88.2%
associate-*l/96.5%
Simplified96.5%
Taylor expanded in a around inf 80.7%
+-commutative80.7%
associate-/l*89.0%
associate-/r/88.9%
Simplified88.9%
if 3.80000000000000012e-16 < z Initial program 82.9%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 88.9%
Final simplification90.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -3.4e+26) (not (<= y 6.5e-50))) (+ x (/ t (/ (- a z) y))) (- x (/ t (/ (- a z) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -3.4e+26) || !(y <= 6.5e-50)) {
tmp = x + (t / ((a - z) / y));
} else {
tmp = x - (t / ((a - z) / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((y <= (-3.4d+26)) .or. (.not. (y <= 6.5d-50))) then
tmp = x + (t / ((a - z) / y))
else
tmp = x - (t / ((a - z) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -3.4e+26) || !(y <= 6.5e-50)) {
tmp = x + (t / ((a - z) / y));
} else {
tmp = x - (t / ((a - z) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -3.4e+26) or not (y <= 6.5e-50): tmp = x + (t / ((a - z) / y)) else: tmp = x - (t / ((a - z) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -3.4e+26) || !(y <= 6.5e-50)) tmp = Float64(x + Float64(t / Float64(Float64(a - z) / y))); else tmp = Float64(x - Float64(t / Float64(Float64(a - z) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -3.4e+26) || ~((y <= 6.5e-50))) tmp = x + (t / ((a - z) / y)); else tmp = x - (t / ((a - z) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -3.4e+26], N[Not[LessEqual[y, 6.5e-50]], $MachinePrecision]], N[(x + N[(t / N[(N[(a - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t / N[(N[(a - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{+26} \lor \neg \left(y \leq 6.5 \cdot 10^{-50}\right):\\
\;\;\;\;x + \frac{t}{\frac{a - z}{y}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{t}{\frac{a - z}{z}}\\
\end{array}
\end{array}
if y < -3.4000000000000003e26 or 6.49999999999999987e-50 < y Initial program 82.4%
associate-*l/97.5%
Simplified97.5%
Taylor expanded in y around inf 79.1%
associate-/l*87.8%
Simplified87.8%
if -3.4000000000000003e26 < y < 6.49999999999999987e-50Initial program 89.9%
associate-*l/99.2%
Simplified99.2%
Taylor expanded in y around 0 81.0%
mul-1-neg81.0%
unsub-neg81.0%
associate-/l*91.0%
Simplified91.0%
Final simplification89.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.5e+138) (+ x t) (if (<= z 3.8e-16) (+ x (/ t (/ (- a z) y))) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.5e+138) {
tmp = x + t;
} else if (z <= 3.8e-16) {
tmp = x + (t / ((a - z) / 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 <= (-1.5d+138)) then
tmp = x + t
else if (z <= 3.8d-16) then
tmp = x + (t / ((a - z) / 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 <= -1.5e+138) {
tmp = x + t;
} else if (z <= 3.8e-16) {
tmp = x + (t / ((a - z) / y));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.5e+138: tmp = x + t elif z <= 3.8e-16: tmp = x + (t / ((a - z) / y)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.5e+138) tmp = Float64(x + t); elseif (z <= 3.8e-16) tmp = Float64(x + Float64(t / Float64(Float64(a - z) / y))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.5e+138) tmp = x + t; elseif (z <= 3.8e-16) tmp = x + (t / ((a - z) / y)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.5e+138], N[(x + t), $MachinePrecision], If[LessEqual[z, 3.8e-16], N[(x + N[(t / N[(N[(a - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+138}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-16}:\\
\;\;\;\;x + \frac{t}{\frac{a - z}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -1.50000000000000005e138 or 3.80000000000000012e-16 < z Initial program 78.8%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 91.7%
if -1.50000000000000005e138 < z < 3.80000000000000012e-16Initial program 90.1%
associate-*l/97.7%
Simplified97.7%
Taylor expanded in y around inf 82.2%
associate-/l*87.1%
Simplified87.1%
Final simplification88.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6.2e+71) (not (<= z 1e-59))) (+ x t) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.2e+71) || !(z <= 1e-59)) {
tmp = x + t;
} 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 <= (-6.2d+71)) .or. (.not. (z <= 1d-59))) then
tmp = x + t
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 <= -6.2e+71) || !(z <= 1e-59)) {
tmp = x + t;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6.2e+71) or not (z <= 1e-59): tmp = x + t else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6.2e+71) || !(z <= 1e-59)) tmp = Float64(x + t); 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 <= -6.2e+71) || ~((z <= 1e-59))) tmp = x + t; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6.2e+71], N[Not[LessEqual[z, 1e-59]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{+71} \lor \neg \left(z \leq 10^{-59}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -6.20000000000000036e71 or 1e-59 < z Initial program 81.6%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 85.5%
if -6.20000000000000036e71 < z < 1e-59Initial program 90.1%
associate-*l/97.3%
Simplified97.3%
Taylor expanded in z around 0 76.1%
+-commutative76.1%
*-commutative76.1%
associate-/l*82.7%
Simplified82.7%
div-inv82.7%
clear-num82.7%
Applied egg-rr82.7%
Final simplification84.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.8e+69) (+ x t) (if (<= z 3.2e-57) (+ x (/ y (/ a t))) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.8e+69) {
tmp = x + t;
} else if (z <= 3.2e-57) {
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.8d+69)) then
tmp = x + t
else if (z <= 3.2d-57) 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.8e+69) {
tmp = x + t;
} else if (z <= 3.2e-57) {
tmp = x + (y / (a / t));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.8e+69: tmp = x + t elif z <= 3.2e-57: tmp = x + (y / (a / t)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.8e+69) tmp = Float64(x + t); elseif (z <= 3.2e-57) 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.8e+69) tmp = x + t; elseif (z <= 3.2e-57) tmp = x + (y / (a / t)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.8e+69], N[(x + t), $MachinePrecision], If[LessEqual[z, 3.2e-57], 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.8 \cdot 10^{+69}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-57}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -2.79999999999999982e69 or 3.2000000000000001e-57 < z Initial program 81.6%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 85.5%
if -2.79999999999999982e69 < z < 3.2000000000000001e-57Initial program 90.1%
associate-*l/97.3%
Simplified97.3%
Taylor expanded in z around 0 76.1%
+-commutative76.1%
*-commutative76.1%
associate-/l*82.7%
Simplified82.7%
Final simplification84.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.95e-97) (+ x t) (if (<= z 2.6e-70) x (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.95e-97) {
tmp = x + t;
} else if (z <= 2.6e-70) {
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 (z <= (-1.95d-97)) then
tmp = x + t
else if (z <= 2.6d-70) 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 (z <= -1.95e-97) {
tmp = x + t;
} else if (z <= 2.6e-70) {
tmp = x;
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.95e-97: tmp = x + t elif z <= 2.6e-70: tmp = x else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.95e-97) tmp = Float64(x + t); elseif (z <= 2.6e-70) tmp = x; else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.95e-97) tmp = x + t; elseif (z <= 2.6e-70) tmp = x; else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.95e-97], N[(x + t), $MachinePrecision], If[LessEqual[z, 2.6e-70], x, N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{-97}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-70}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -1.9499999999999999e-97 or 2.60000000000000002e-70 < z Initial program 82.1%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 77.0%
if -1.9499999999999999e-97 < z < 2.60000000000000002e-70Initial program 91.8%
associate-*l/96.6%
Simplified96.6%
Taylor expanded in x around inf 52.3%
Final simplification66.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 86.4%
associate-*l/98.4%
Simplified98.4%
Taylor expanded in x around inf 51.8%
Final simplification51.8%
(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 2023279
(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))))