
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
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)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
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)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (<= (+ x (/ (* y (- z t)) (- z a))) 1e-95) (fma y (/ (- z t) (- z a)) x) (fma (- z t) (/ y (- z a)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x + ((y * (z - t)) / (z - a))) <= 1e-95) {
tmp = fma(y, ((z - t) / (z - a)), x);
} else {
tmp = fma((z - t), (y / (z - a)), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) <= 1e-95) tmp = fma(y, Float64(Float64(z - t) / Float64(z - a)), x); else tmp = fma(Float64(z - t), Float64(y / Float64(z - a)), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e-95], N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + \frac{y \cdot \left(z - t\right)}{z - a} \leq 10^{-95}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y}{z - a}, x\right)\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))) < 9.99999999999999989e-96Initial program 85.2%
+-commutative85.2%
associate-/l*98.1%
fma-define98.2%
Simplified98.2%
if 9.99999999999999989e-96 < (+.f64 x (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))) Initial program 77.6%
+-commutative77.6%
*-commutative77.6%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
(FPCore (x y z t a) :precision binary64 (if (<= (+ x (/ (* y (- z t)) (- z a))) 20000.0) (fma y (/ (- z t) (- z a)) x) (- x (/ 1.0 (/ (/ (- z a) y) (- t z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x + ((y * (z - t)) / (z - a))) <= 20000.0) {
tmp = fma(y, ((z - t) / (z - a)), x);
} else {
tmp = x - (1.0 / (((z - a) / y) / (t - z)));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) <= 20000.0) tmp = fma(y, Float64(Float64(z - t) / Float64(z - a)), x); else tmp = Float64(x - Float64(1.0 / Float64(Float64(Float64(z - a) / y) / Float64(t - z)))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 20000.0], N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(x - N[(1.0 / N[(N[(N[(z - a), $MachinePrecision] / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + \frac{y \cdot \left(z - t\right)}{z - a} \leq 20000:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;x - \frac{1}{\frac{\frac{z - a}{y}}{t - z}}\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))) < 2e4Initial program 86.4%
+-commutative86.4%
associate-/l*98.3%
fma-define98.3%
Simplified98.3%
if 2e4 < (+.f64 x (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))) Initial program 73.5%
clear-num73.5%
inv-pow73.5%
Applied egg-rr73.5%
unpow-173.5%
associate-/r*99.8%
Simplified99.8%
Final simplification98.8%
(FPCore (x y z t a) :precision binary64 (if (<= (+ x (/ (* y (- z t)) (- z a))) 20000.0) (+ x (* y (/ (- z t) (- z a)))) (- x (/ 1.0 (/ (/ (- z a) y) (- t z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x + ((y * (z - t)) / (z - a))) <= 20000.0) {
tmp = x + (y * ((z - t) / (z - a)));
} else {
tmp = x - (1.0 / (((z - a) / y) / (t - 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 ((x + ((y * (z - t)) / (z - a))) <= 20000.0d0) then
tmp = x + (y * ((z - t) / (z - a)))
else
tmp = x - (1.0d0 / (((z - a) / y) / (t - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x + ((y * (z - t)) / (z - a))) <= 20000.0) {
tmp = x + (y * ((z - t) / (z - a)));
} else {
tmp = x - (1.0 / (((z - a) / y) / (t - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x + ((y * (z - t)) / (z - a))) <= 20000.0: tmp = x + (y * ((z - t) / (z - a))) else: tmp = x - (1.0 / (((z - a) / y) / (t - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) <= 20000.0) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))); else tmp = Float64(x - Float64(1.0 / Float64(Float64(Float64(z - a) / y) / Float64(t - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x + ((y * (z - t)) / (z - a))) <= 20000.0) tmp = x + (y * ((z - t) / (z - a))); else tmp = x - (1.0 / (((z - a) / y) / (t - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 20000.0], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(1.0 / N[(N[(N[(z - a), $MachinePrecision] / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + \frac{y \cdot \left(z - t\right)}{z - a} \leq 20000:\\
\;\;\;\;x + y \cdot \frac{z - t}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{1}{\frac{\frac{z - a}{y}}{t - z}}\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))) < 2e4Initial program 86.4%
associate-/l*98.3%
*-commutative98.3%
Applied egg-rr98.3%
if 2e4 < (+.f64 x (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))) Initial program 73.5%
clear-num73.5%
inv-pow73.5%
Applied egg-rr73.5%
unpow-173.5%
associate-/r*99.8%
Simplified99.8%
Final simplification98.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* y (/ z (- a z))))))
(if (<= z -1.05e-19)
t_1
(if (<= z -2.35e-83)
(* y (/ (- z t) (- z a)))
(if (<= z 2.9e-71) (+ x (/ t (/ a y))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y * (z / (a - z)));
double tmp;
if (z <= -1.05e-19) {
tmp = t_1;
} else if (z <= -2.35e-83) {
tmp = y * ((z - t) / (z - a));
} else if (z <= 2.9e-71) {
tmp = x + (t / (a / y));
} 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)))
if (z <= (-1.05d-19)) then
tmp = t_1
else if (z <= (-2.35d-83)) then
tmp = y * ((z - t) / (z - a))
else if (z <= 2.9d-71) then
tmp = x + (t / (a / y))
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)));
double tmp;
if (z <= -1.05e-19) {
tmp = t_1;
} else if (z <= -2.35e-83) {
tmp = y * ((z - t) / (z - a));
} else if (z <= 2.9e-71) {
tmp = x + (t / (a / y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (y * (z / (a - z))) tmp = 0 if z <= -1.05e-19: tmp = t_1 elif z <= -2.35e-83: tmp = y * ((z - t) / (z - a)) elif z <= 2.9e-71: tmp = x + (t / (a / y)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y * Float64(z / Float64(a - z)))) tmp = 0.0 if (z <= -1.05e-19) tmp = t_1; elseif (z <= -2.35e-83) tmp = Float64(y * Float64(Float64(z - t) / Float64(z - a))); elseif (z <= 2.9e-71) tmp = Float64(x + Float64(t / Float64(a / y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (y * (z / (a - z))); tmp = 0.0; if (z <= -1.05e-19) tmp = t_1; elseif (z <= -2.35e-83) tmp = y * ((z - t) / (z - a)); elseif (z <= 2.9e-71) tmp = x + (t / (a / y)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(y * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.05e-19], t$95$1, If[LessEqual[z, -2.35e-83], N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.9e-71], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot \frac{z}{a - z}\\
\mathbf{if}\;z \leq -1.05 \cdot 10^{-19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.35 \cdot 10^{-83}:\\
\;\;\;\;y \cdot \frac{z - t}{z - a}\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-71}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.0499999999999999e-19 or 2.8999999999999999e-71 < z Initial program 72.8%
Taylor expanded in t around 0 63.3%
associate-/l*82.3%
Simplified82.3%
if -1.0499999999999999e-19 < z < -2.3500000000000002e-83Initial program 77.1%
+-commutative77.1%
associate-/l*99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in y around -inf 77.1%
associate-/l*99.8%
*-commutative99.8%
Applied egg-rr99.8%
if -2.3500000000000002e-83 < z < 2.8999999999999999e-71Initial program 97.0%
+-commutative97.0%
associate-/l*92.2%
fma-define92.3%
Simplified92.3%
Taylor expanded in z around 0 87.3%
+-commutative87.3%
associate-/l*85.8%
Simplified85.8%
clear-num85.8%
un-div-inv87.6%
Applied egg-rr87.6%
Final simplification84.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.01e-19)
(+ x y)
(if (<= z -1.24e-82)
(* y (/ (- z t) (- z a)))
(if (<= z 5.3e+54) (+ x (/ t (/ a y))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.01e-19) {
tmp = x + y;
} else if (z <= -1.24e-82) {
tmp = y * ((z - t) / (z - a));
} else if (z <= 5.3e+54) {
tmp = x + (t / (a / y));
} else {
tmp = x + 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.01d-19)) then
tmp = x + y
else if (z <= (-1.24d-82)) then
tmp = y * ((z - t) / (z - a))
else if (z <= 5.3d+54) then
tmp = x + (t / (a / y))
else
tmp = x + 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.01e-19) {
tmp = x + y;
} else if (z <= -1.24e-82) {
tmp = y * ((z - t) / (z - a));
} else if (z <= 5.3e+54) {
tmp = x + (t / (a / y));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.01e-19: tmp = x + y elif z <= -1.24e-82: tmp = y * ((z - t) / (z - a)) elif z <= 5.3e+54: tmp = x + (t / (a / y)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.01e-19) tmp = Float64(x + y); elseif (z <= -1.24e-82) tmp = Float64(y * Float64(Float64(z - t) / Float64(z - a))); elseif (z <= 5.3e+54) tmp = Float64(x + Float64(t / Float64(a / y))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.01e-19) tmp = x + y; elseif (z <= -1.24e-82) tmp = y * ((z - t) / (z - a)); elseif (z <= 5.3e+54) tmp = x + (t / (a / y)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.01e-19], N[(x + y), $MachinePrecision], If[LessEqual[z, -1.24e-82], N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.3e+54], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.01 \cdot 10^{-19}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -1.24 \cdot 10^{-82}:\\
\;\;\;\;y \cdot \frac{z - t}{z - a}\\
\mathbf{elif}\;z \leq 5.3 \cdot 10^{+54}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.00999999999999995e-19 or 5.30000000000000018e54 < z Initial program 71.3%
+-commutative71.3%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 77.4%
+-commutative77.4%
Simplified77.4%
if -1.00999999999999995e-19 < z < -1.23999999999999997e-82Initial program 77.1%
+-commutative77.1%
associate-/l*99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in y around -inf 77.1%
associate-/l*99.8%
*-commutative99.8%
Applied egg-rr99.8%
if -1.23999999999999997e-82 < z < 5.30000000000000018e54Initial program 93.9%
+-commutative93.9%
associate-/l*93.7%
fma-define93.7%
Simplified93.7%
Taylor expanded in z around 0 79.3%
+-commutative79.3%
associate-/l*81.7%
Simplified81.7%
clear-num81.7%
un-div-inv83.2%
Applied egg-rr83.2%
Final simplification80.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.4e-113) (not (<= z 1.1e+49))) (+ x (* y (/ (- z t) z))) (+ x (* y (/ (- t z) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.4e-113) || !(z <= 1.1e+49)) {
tmp = x + (y * ((z - t) / 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.4d-113)) .or. (.not. (z <= 1.1d+49))) then
tmp = x + (y * ((z - t) / 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.4e-113) || !(z <= 1.1e+49)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + (y * ((t - z) / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.4e-113) or not (z <= 1.1e+49): tmp = x + (y * ((z - t) / z)) else: tmp = x + (y * ((t - z) / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.4e-113) || !(z <= 1.1e+49)) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); else tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.4e-113) || ~((z <= 1.1e+49))) tmp = x + (y * ((z - t) / z)); else tmp = x + (y * ((t - z) / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.4e-113], N[Not[LessEqual[z, 1.1e+49]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{-113} \lor \neg \left(z \leq 1.1 \cdot 10^{+49}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\end{array}
\end{array}
if z < -1.4e-113 or 1.1e49 < z Initial program 73.1%
+-commutative73.1%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in a around 0 65.4%
+-commutative65.4%
associate-/l*86.3%
Simplified86.3%
if -1.4e-113 < z < 1.1e49Initial program 93.5%
+-commutative93.5%
associate-/l*93.3%
fma-define93.4%
Simplified93.4%
Taylor expanded in a around inf 82.8%
mul-1-neg82.8%
unsub-neg82.8%
associate-/l*85.5%
Simplified85.5%
Final simplification85.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.6e-105) (not (<= z 1.1e+49))) (+ x (* y (/ (- z t) z))) (+ x (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.6e-105) || !(z <= 1.1e+49)) {
tmp = x + (y * ((z - t) / z));
} 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 <= (-4.6d-105)) .or. (.not. (z <= 1.1d+49))) then
tmp = x + (y * ((z - t) / z))
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 <= -4.6e-105) || !(z <= 1.1e+49)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.6e-105) or not (z <= 1.1e+49): tmp = x + (y * ((z - t) / z)) else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.6e-105) || !(z <= 1.1e+49)) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); 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 <= -4.6e-105) || ~((z <= 1.1e+49))) tmp = x + (y * ((z - t) / z)); else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.6e-105], N[Not[LessEqual[z, 1.1e+49]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.6 \cdot 10^{-105} \lor \neg \left(z \leq 1.1 \cdot 10^{+49}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -4.6000000000000002e-105 or 1.1e49 < z Initial program 73.1%
+-commutative73.1%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in a around 0 65.4%
+-commutative65.4%
associate-/l*86.3%
Simplified86.3%
if -4.6000000000000002e-105 < z < 1.1e49Initial program 93.5%
+-commutative93.5%
associate-/l*93.3%
fma-define93.4%
Simplified93.4%
Taylor expanded in z around 0 78.7%
+-commutative78.7%
associate-/l*81.2%
Simplified81.2%
clear-num81.2%
un-div-inv82.8%
Applied egg-rr82.8%
Final simplification84.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.15e+60) (- x (* y (/ z (- a z)))) (if (<= z 1.75e+65) (+ x (* t (/ y (- a z)))) (+ x (* y (/ (- z t) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.15e+60) {
tmp = x - (y * (z / (a - z)));
} else if (z <= 1.75e+65) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (y * ((z - t) / 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 <= (-3.15d+60)) then
tmp = x - (y * (z / (a - z)))
else if (z <= 1.75d+65) then
tmp = x + (t * (y / (a - z)))
else
tmp = x + (y * ((z - t) / 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 <= -3.15e+60) {
tmp = x - (y * (z / (a - z)));
} else if (z <= 1.75e+65) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (y * ((z - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.15e+60: tmp = x - (y * (z / (a - z))) elif z <= 1.75e+65: tmp = x + (t * (y / (a - z))) else: tmp = x + (y * ((z - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.15e+60) tmp = Float64(x - Float64(y * Float64(z / Float64(a - z)))); elseif (z <= 1.75e+65) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); else tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.15e+60) tmp = x - (y * (z / (a - z))); elseif (z <= 1.75e+65) tmp = x + (t * (y / (a - z))); else tmp = x + (y * ((z - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.15e+60], N[(x - N[(y * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.75e+65], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.15 \cdot 10^{+60}:\\
\;\;\;\;x - y \cdot \frac{z}{a - z}\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{+65}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\end{array}
\end{array}
if z < -3.1500000000000002e60Initial program 74.0%
Taylor expanded in t around 0 66.3%
associate-/l*86.2%
Simplified86.2%
if -3.1500000000000002e60 < z < 1.75e65Initial program 92.6%
Taylor expanded in t around inf 86.3%
mul-1-neg86.3%
associate-/l*89.7%
distribute-rgt-neg-in89.7%
distribute-frac-neg289.7%
Simplified89.7%
if 1.75e65 < z Initial program 56.4%
+-commutative56.4%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in a around 0 56.3%
+-commutative56.3%
associate-/l*97.4%
Simplified97.4%
Final simplification90.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.4e-105) (not (<= z 3.8e+49))) (+ x y) (+ x (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.4e-105) || !(z <= 3.8e+49)) {
tmp = x + y;
} 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 <= (-5.4d-105)) .or. (.not. (z <= 3.8d+49))) then
tmp = x + y
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 <= -5.4e-105) || !(z <= 3.8e+49)) {
tmp = x + y;
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.4e-105) or not (z <= 3.8e+49): tmp = x + y else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.4e-105) || !(z <= 3.8e+49)) tmp = Float64(x + y); 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 <= -5.4e-105) || ~((z <= 3.8e+49))) tmp = x + y; else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.4e-105], N[Not[LessEqual[z, 3.8e+49]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.4 \cdot 10^{-105} \lor \neg \left(z \leq 3.8 \cdot 10^{+49}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -5.39999999999999985e-105 or 3.7999999999999999e49 < z Initial program 73.1%
+-commutative73.1%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 75.8%
+-commutative75.8%
Simplified75.8%
if -5.39999999999999985e-105 < z < 3.7999999999999999e49Initial program 93.5%
+-commutative93.5%
associate-/l*93.3%
fma-define93.4%
Simplified93.4%
Taylor expanded in z around 0 78.7%
+-commutative78.7%
associate-/l*81.2%
Simplified81.2%
clear-num81.2%
un-div-inv82.8%
Applied egg-rr82.8%
Final simplification79.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.9e-146) (not (<= z 8.5e+50))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.9e-146) || !(z <= 8.5e+50)) {
tmp = x + y;
} 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 <= (-3.9d-146)) .or. (.not. (z <= 8.5d+50))) then
tmp = x + y
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 <= -3.9e-146) || !(z <= 8.5e+50)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.9e-146) or not (z <= 8.5e+50): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.9e-146) || !(z <= 8.5e+50)) tmp = Float64(x + y); 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 <= -3.9e-146) || ~((z <= 8.5e+50))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.9e-146], N[Not[LessEqual[z, 8.5e+50]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.9 \cdot 10^{-146} \lor \neg \left(z \leq 8.5 \cdot 10^{+50}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -3.90000000000000002e-146 or 8.49999999999999961e50 < z Initial program 74.5%
+-commutative74.5%
associate-/l*99.3%
fma-define99.3%
Simplified99.3%
Taylor expanded in z around inf 75.8%
+-commutative75.8%
Simplified75.8%
if -3.90000000000000002e-146 < z < 8.49999999999999961e50Initial program 93.0%
associate-/l*93.8%
*-commutative93.8%
Applied egg-rr93.8%
Taylor expanded in z around 0 81.8%
Final simplification78.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.2e+172) (not (<= t 3.5e+261))) (* t (/ y a)) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.2e+172) || !(t <= 3.5e+261)) {
tmp = t * (y / a);
} else {
tmp = x + 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 <= (-4.2d+172)) .or. (.not. (t <= 3.5d+261))) then
tmp = t * (y / a)
else
tmp = x + 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 <= -4.2e+172) || !(t <= 3.5e+261)) {
tmp = t * (y / a);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.2e+172) or not (t <= 3.5e+261): tmp = t * (y / a) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.2e+172) || !(t <= 3.5e+261)) tmp = Float64(t * Float64(y / a)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4.2e+172) || ~((t <= 3.5e+261))) tmp = t * (y / a); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.2e+172], N[Not[LessEqual[t, 3.5e+261]], $MachinePrecision]], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{+172} \lor \neg \left(t \leq 3.5 \cdot 10^{+261}\right):\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -4.2000000000000003e172 or 3.49999999999999997e261 < t Initial program 75.6%
+-commutative75.6%
associate-/l*89.7%
fma-define89.7%
Simplified89.7%
Taylor expanded in y around -inf 57.8%
Taylor expanded in z around 0 40.5%
associate-/l*57.2%
Simplified57.2%
if -4.2000000000000003e172 < t < 3.49999999999999997e261Initial program 83.5%
+-commutative83.5%
associate-/l*98.2%
fma-define98.2%
Simplified98.2%
Taylor expanded in z around inf 69.3%
+-commutative69.3%
Simplified69.3%
Final simplification67.5%
(FPCore (x y z t a) :precision binary64 (if (<= y -1.6e+95) y (if (<= y 2.05e+170) x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.6e+95) {
tmp = y;
} else if (y <= 2.05e+170) {
tmp = x;
} else {
tmp = 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 (y <= (-1.6d+95)) then
tmp = y
else if (y <= 2.05d+170) then
tmp = x
else
tmp = y
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.6e+95) {
tmp = y;
} else if (y <= 2.05e+170) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.6e+95: tmp = y elif y <= 2.05e+170: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.6e+95) tmp = y; elseif (y <= 2.05e+170) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.6e+95) tmp = y; elseif (y <= 2.05e+170) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.6e+95], y, If[LessEqual[y, 2.05e+170], x, y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{+95}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 2.05 \cdot 10^{+170}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -1.6e95 or 2.05e170 < y Initial program 51.2%
+-commutative51.2%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in y around -inf 43.2%
Taylor expanded in z around inf 43.9%
if -1.6e95 < y < 2.05e170Initial program 94.7%
+-commutative94.7%
associate-/l*95.7%
fma-define95.8%
Simplified95.8%
Taylor expanded in y around 0 61.8%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
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) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Initial program 82.3%
associate-/l*96.9%
*-commutative96.9%
Applied egg-rr96.9%
Final simplification96.9%
(FPCore (x y z t a) :precision binary64 (+ x y))
double code(double x, double y, double z, double t, double a) {
return x + 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 + y
end function
public static double code(double x, double y, double z, double t, double a) {
return x + y;
}
def code(x, y, z, t, a): return x + y
function code(x, y, z, t, a) return Float64(x + y) end
function tmp = code(x, y, z, t, a) tmp = x + y; end
code[x_, y_, z_, t_, a_] := N[(x + y), $MachinePrecision]
\begin{array}{l}
\\
x + y
\end{array}
Initial program 82.3%
+-commutative82.3%
associate-/l*96.9%
fma-define97.0%
Simplified97.0%
Taylor expanded in z around inf 62.8%
+-commutative62.8%
Simplified62.8%
Final simplification62.8%
(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 82.3%
+-commutative82.3%
associate-/l*96.9%
fma-define97.0%
Simplified97.0%
Taylor expanded in y around 0 49.2%
(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(y / Float64(Float64(z - a) / Float64(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[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2024157
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- z a) (- z t)))))
(+ x (/ (* y (- z t)) (- z a))))